kijai's `data` drops per-region labels for OD/dense_region_caption, so
florence_data gives empty-desc boxes. Add a dedicated `florence_regions` STRING
input for a region task's raw `caption` (label<loc_..>), parsed into elements with
desc=label — so you can feed a caption task -> florence_caption (HLD) AND a region
task's caption -> florence_regions (labeled boxes) at the same time. florence_data
remains for labelless/OCR boxes. Element priority: regions > loc-in-caption > data.
Example workflow rewired (region caption -> florence_regions). 21 tests passing.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A region-task Florence2Run `caption` output is the raw "label<loc_x1><loc_y1>
<loc_x2><loc_y2>..." string (loc tokens kept). Wired into florence_caption it
was dumped verbatim into high_level_description. Now _loc_elements parses it into
v15 elements with desc=label (<loc_> is 0-999 normalized -> 0-1000, no image dims
needed) — which also recovers the per-region labels that kijai's `data` drops for
OD/dense_region_caption. Plain prose captions still become the HLD. 4 new tests
(20 passing). README clarifies the wiring.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Seed the editor from an image without embedding Florence-2 — consume kijai's
comfyui-florence2 Florence2Run outputs:
- florence_caption (STRING) -> high_level_description
- florence_data (JSON) -> region/OCR boxes as elements, normalized from the
connected image's pixel space to the 0-1000 grid.
nodes.py: pure _florence_elements (handles {bboxes,labels} grounding, bare box
lists incl. one wrapping level for OD/dense, and [{label,box}] OCR with 4-rects
or 8-quads) + _image_dims + _florence_caption_obj; build() emits the assembled
v15 caption under ui.florence.
JS: onExecuted applies ui.florence via loadCaption only when it changed (per-node
guard) so re-runs don't clobber manual edits. 6 new tests (17 passing). README +
design doc.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Outputs (was: only prompt):
- preview (IMAGE): boxes + numbered tags + desc/text rendered over the canvas
or the dimmed reference image.
- bboxes (BOUNDING_BOX): pixel-space, nested [[{x,y,width,height}]] for SAM3 /
crop / mask consumers.
- width / height (INT): resolved canvas size (passthrough).
Inputs:
- image (optional): reference image, dimmed behind the preview and shown as the
editor backdrop (via ui.bg_image on run).
- import_json (force_input): caption JSON loaded into the editor on run; output
always reflects the editor.
Optional style_description (v14): off by default; toggle in the editor with a
photo/art_style kind, aesthetics/lighting/medium and a #hex color_palette. Emitted
with the canonical key order; validation stays silent. Importing a caption with
style_description loads it back. Drops the old "legacy format" warning.
nodes.py refactored into pure helpers (_resolve_canvas, _pixel_bboxes, _elements)
+ a thin build(); torch/PIL/numpy imported lazily so the module/tests stay light.
Tests rewritten to cover the pure helpers (11 passing). Stays on the v1 node API
(search_aliases is v3-only and omitted). README + design doc updated.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- nodes.py: add width/height INT inputs (default 0 = use editor AR). When both
> 0, build() overrides the caption's aspect_ratio with reduced W:H. Convert to
input to wire a resolution node.
- JS: read width/height widgets, derive the ratio and fit the canvas to it; hook
their callbacks to re-sync; apply on init so real size wins over the caption AR.
- tests: width/height override + zero-size passthrough (7 passing).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds the Python node scaffold with thin JSON pass-through/validation logic,
package init, and 5 TDD tests. Includes pyproject.toml and conftest.py to
support pytest on Python 3.14 with a hyphenated package directory name.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>