Nodes/Krea2 Regional/Krea2 Regions from Ideogram JSON
ComfyUI Node

Krea2 Regions from Ideogram JSON

Turn Ideogram-4-style caption JSON into Krea 2 regions without ever opening the canvas

By januspluto·Created 2 months ago·Updated about a month ago· 9
Krea2 Regions from Ideogram JSON
  • clip
  • prev_regions
  • extra_base_loras
  • regions
  • base_conditioning
  • base_loras
  • masks
  • base_prompt
  • region_prompts
caption_json
width1024
height1024
grow_px0
feather_px0
coord_modenormalized
bbox_orderyx
lora_map
include_style_in_basetrue
include_unplaced_in_basetrue
include_palettesfalse
base_prepend
base_append
region_append

The KB's regional-prompting panel makes a sharp observation about Ideogram 4: it's the first model where bounding boxes are part of the trained caption schema, not something you bolt on. Krea 2 picked a Qwen3-VL text encoder that was itself trained on bounding boxes, so Ideogram-style layout JSON partly works on it zero-shot. That coincidence is the whole reason this node exists.

Krea2 Regions from Ideogram JSON is a headless bridge: feed it an Ideogram-4-style caption JSON, and it turns every placed element into a Krea 2 region - conditioning, mask, and LoRAs - with no canvas involved. It's for pipelines that get their layout from a text model or a captioner rather than from your mouse.

The honest caveat up front

The Builder supersedes this node. It imports the same JSON via its import_json input and lets you edit the result on a canvas, which is the normal workflow now. This node is kept for no-UI pipelines: batch runs, automation, anywhere a human won't be tweaking boxes between runs. If you're an interactive user, go use the Builder's import instead - this one is the same machinery with the editing step removed.

How it works

Each placed element in the caption JSON (which carries a bbox plus a description) becomes one region. The description is encoded through your Krea 2 clip into conditioning; the bbox becomes a mask, dilated by grow_px and softened by feather_px. LoRAs are attached two ways: inline <lora:name:strength> tags inside the descriptions, or lora_map rules. Base LoRAs - from tags in the high-level description, or base => rules - come out the base_loras output.

lora_map is the clever bit and worth learning if you use this node at all. One rule per line, matcher => lora_name @ strength:

wizard => mychar @ 0.9
base  => neonstyle @ 0.7

Matchers can be * (all regions), base (base prompt), an integer (1-based region order), or a substring of the region's description. So a single rule file can route ten regions to their correct character LoRAs with zero per-region setup.

Inputs that matter

caption_json accepts the output of a captioner that emits Ideogram-style layout JSON (paste it, or wire a builder's prompt output). coord_mode and bbox_order are the two settings that will bite you: they must match the JSON producer's conventions - normalized 0–1000 grid vs absolute pixels, and yx (Ideogram [ymin,xmin,ymax,xmax]) vs xy (Qwen [xmin,ymin,xmax,ymax]). Get those wrong and every region lands in the wrong corner or collapses to a dot.

include_style_in_base and include_unplaced_in_base control what gets folded into the base prompt (style fields, and elements without a bbox); include_palettes adds the palette info. base_prepend/base_append/region_append are for global LoRA trigger words and shared style tags. If the input isn't valid JSON at all, the node degrades gracefully to treating the whole string as a plain base prompt.

Outputs

regions, base_conditioning, base_loras wire into Krea2 Apply Regional exactly like the Builder's outputs; masks is a preview MASK; base_prompt and region_prompts are strings if you want to inspect what it built.

Install

Same pack as everything else:

cd ComfyUI/custom_nodes
git clone https://github.com/januspluto/ComfyUI-Krea2-Regional.git

or ComfyUI Manager, search Krea2 Regional, restart. Requires ComfyUI with native Krea 2 support (v0.26+), no extra dependencies.

Where people get burned

The coord_mode/bbox_order mismatch is the number-one failure - the node even has a test file (test_bridge.py) that leans on matching them. Second is feeding it a caption from a model that doesn't emit Ideogram-style JSON with boxes; anything without bboxes just becomes one giant base prompt, which defeats the purpose. For anything interactive, again: the Builder's import_json does this with a live editor on top, so you'll usually want that instead.

Categoryconditioning/krea2_regional

Inputs (17)

NameTypeDefaultDescription
clipCLIP
caption_jsonSTRINGWire the KJ builder's `prompt` output here, or paste the caption JSON directly.
widthINT102464–16384
heightINT102464–16384
grow_pxINT00–512Dilate every bbox mask by this many pixels.
feather_pxINT00–512Gaussian-soften mask edges. Soft values feather regional-LoRA strength; the attention mask binarizes at 0.5.
coord_modeCOMBOnormalizedMatch the KJ builder's toolbar setting (normalized 0-1000 grid vs absolute pixels).
bbox_orderCOMBOyxMatch the KJ builder's toolbar setting (yx = Ideogram [ymin,xmin,ymax,xmax]; xy = Qwen [xmin,ymin,xmax,ymax]).
lora_mapSTRINGOne rule per line: matcher => lora_name @ strength matcher: * (all regions), base (base prompt), an integer (1-based region order), or a substring of the region's desc. e.g. wizard => mychar @ 0.9 Inline <lora:name:0.8> tags inside descs also work.
include_style_in_baseBOOLEANtrue
include_unplaced_in_baseBOOLEANtrueElements without a bbox get folded into the base prompt.
include_palettesBOOLEANfalse
base_prependSTRINGPrepended to the base prompt (global LoRA trigger words etc.).
base_appendSTRING
region_appendSTRINGAppended to every region prompt (shared style tag etc.).
prev_regionsoptKREA2_REGIONS
extra_base_lorasoptKREA2_LORAS

Outputs (6)

NameTypeDescription
regionsKREA2_REGIONS
base_conditioningCONDITIONING
base_lorasKREA2_LORAS
masksMASK
base_promptSTRING
region_promptsSTRING