ComfyUI Node

K2 Compose

Compiles regions, regional LoRAs, emphases and the projector into a patched Krea 2 MODEL plus ordinary CONDITIONING, LATENT and MASK. What happens here: 1. every enabled region prompt is compiled into one unified Krea prompt with explicit location clauses and inter-subject relationships; 2. the compiled prompt is tokenized so each clause knows its token span; 3. the spatial attention router is installed on the model branch; 4. regional LoRAs are installed as unfused, token-gated forward adapters; 5. the projector delta is applied (token-selective if identity protection is on). Outputs stay standard types, so the patched model can feed ControlNet, guiders or any sampler. Use K2 Sampler when late-step relaxation or LoRA-delta adaptation is enabled.

By ping1979ping·Created 5 months ago·Updated 21 days ago· 0
K2 Compose
  • model
  • clip
  • regions
  • loras
  • emphasis
  • projector
  • tuning
  • model
  • positive
  • negative
  • latent
  • mask
  • plan
  • compiled_prompt
  • report
global_prompt
negative_prompt
width1024
height1024
batch_size1
CategoryFVM Tools/K2

Inputs (12)

NameTypeDefaultDescription
modelMODELKrea 2 MODEL. It is cloned and patched; the incoming branch stays untouched.
clipCLIPCLIPLoader with type 'krea2' (Qwen3-VL).
global_promptSTRINGScene-wide description — keep people OUT of it. Regional clauses are appended after it. Image tokens outside every region see only this text, so a person mentioned here is drawn there. Measured with two regions: scene-only → 2 faces, '…a woman standing…' → 3, 'group portrait…' → 5.
negative_promptSTRINGGlobal negative. Krea 2 Turbo runs CFG-free, so this only matters with CFG > 1.
widthINT102464–16384Output width AND the coordinate system for every region box. Changing it moves all boxes.
heightINT102464–16384Output height and vertical box coordinate system.
batch_sizeINT11–64Region and LoRA routing is broadcast across the batch.
regionsoptK2_REGIONRegion chain. Without it this behaves like a plain prompt encode.
lorasoptK2_LORALoRA assignments from K2 Regional LoRA.
emphasisoptK2_EMPHASISPhrase emphases.
projectoroptK2_PROJECTORProjector delta.
tuningoptK2_TUNINGSpatial tuning. Defaults are used when nothing is connected.

Outputs (8)

NameTypeDescription
modelMODEL
positiveCONDITIONING
negativeCONDITIONING
latentLATENT
maskMASK
planK2_PLAN
compiled_promptSTRING
reportSTRING