ComfyUI Node

K2 Region

One named box, one prompt, and the start of real multi-character control

By ping1979ping·Created 6 months ago·Updated about a month ago· 0
K2 Region
  • regions
  • regions
nameSubject
prompt
x0
y0
width512
height1024
roleauto
priority100
enabledtrue
identity_prompt
negative_prompt
region_id

K2 Region is the building block of the whole K2 Lab suite in comfyui-FVMtools. It's one named rectangle on your canvas with one prompt, and when you chain a few of them together you get the thing the community kept asking for all through 2026: two different characters, each bound to their own part of the frame, without them blending into one averaged mess. Each region's prompt gets compiled into the unified Krea 2 prompt with an explicit location clause, and the K2 attention router binds exactly those text tokens to the image tokens inside that box.

The boxes are given in output pixels of the final image - one image token in Krea 2 covers a 16×16 block of output pixels, so that's the coordinate space the node thinks in.

The inputs that matter

  • name - the label used everywhere else: in the generated spatial instructions ("Anna is to the left of Bea"), in face assignment, in reports. Keep it short and distinct.
  • prompt - what appears inside the box. An empty prompt disables the region.
  • x, y, width, height - the box, in output pixels.
  • role - how hard the region is bound. subject gets the full outside penalty and competes with other subjects for overlapping tokens; background only gets a quarter of the penalty and may feather beyond its box (how far is controlled by the falloff_pixels field on spatial tuning); auto promotes any box covering 70%+ of canvas width to background.
  • priority - higher compiles first and claims ambiguous detected faces first. The tooltip is worth quoting: it is not a strength and not an image z-index. Don't crank it expecting a stronger effect.

Optional inputs: identity_prompt (face/identity description - it's placed first in the clause, can be protected from the projector delta, and is preferred by K2 Regional Face Detail), negative_prompt (stored for tooling; Krea 2 Turbo is CFG-free so it has no separate regional negative branch), and region_id (a stable id if you don't want an autogenerated one).

Chain them

The regions output plugs into the next K2 Region's regions input, building a chain that ends at K2 Compose. It's a linked list rather than a bus - if you need to merge two independently-built chains, use K2 Region Combine.

A couple of habits the author's own testing suggests: keep people out of the global prompt and describe subjects here (a scene-only global prompt produced 2 faces, "…a woman standing…" produced 3). And put framing into the region prompt, not the global one - "shown full length" belongs here, because the model reads camera distance from whichever prompt the tokens are attached to.

Install is the same as the rest of the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/ping1979ping/comfyui-FVMtools

Restart ComfyUI and the nodes appear under FVM Tools/K2. No extra Python dependencies for this suite, and no model files beyond the Krea 2 checkpoint, encoder, and VAE you already need to run Krea 2 at all.

If you'd rather not hand-type boxes, use K2 Region Builder for a visual editor or K2 Region from BBox to pull boxes straight off a detector. Two to three subjects land reliably with this approach; four narrow full-body boxes get tight, and the fix is more width per box plus inside_strength around 2.6.

CategoryFVM Tools/K2

Inputs (13)

NameTypeDefaultDescription
nameSTRINGSubjectHuman readable label. Used in the generated spatial instructions ('Anna is to the left of Bea'), in face assignment and in the report. Keep it short and distinct.
promptSTRINGWhat should appear inside this box. An empty prompt disables the region.
xINT00–16384Left edge in output pixels.
yINT00–16384Top edge in output pixels.
widthINT51216–16384Box width in output pixels.
heightINT102416–16384Box height in output pixels.
roleCOMBOautosubject: full outside penalty, competes with other subjects for overlapping tokens. background: softer penalty, may feather beyond its box. auto: boxes covering >=70% of canvas width become background.
priorityINT100-1000–1000Higher compiles first and claims ambiguous detected faces first. It is NOT a strength and NOT an image z-index.
enabledBOOLEANtrueExclude the region without deleting it.
regionsoptK2_REGIONChain input: previously defined regions.
identity_promptoptSTRINGFace/identity description. It is placed first in the clause, can be protected from the projector delta, and is preferred by K2 Face Detail.
negative_promptoptSTRINGRegion-local negative text. Stored for tooling; Krea 2 Turbo has no separate regional negative branch (CFG-free).
region_idoptSTRINGStable internal id. Leave empty for an automatic one. Regional LoRAs reference regions by name or id.

Outputs (1)

NameTypeDescription
regionsK2_REGION