K2 Spatial Tuning
A dozen knobs for the Krea 2 router, and the defaults are fine
- tuning
K2 Spatial Tuning is the least exciting node in the K2 Lab, and that's fine - it's a settings bag. It outputs a single K2_TUNING object you feed into K2 Compose, and it is entirely optional: Compose uses these exact same defaults when nothing is connected. You only reach for this node when a regional render misbehaves, which is how a tuning node should work.
The knobs tune the spatial attention router, the thing that makes regional prompting possible on Krea 2 at all. Krea 2 is a single-stream model - text and image tokens share one sequence - so there's no second conditioning branch to attach a second character to. The router works at the attention-logit level instead, biasing each region's text tokens toward the image tokens inside its box. This node dials that bias.
The three knobs that matter
inside_strength- how hard regional text binds to its box. Larger values bind harder; very large values flatten the image. If a subject's attributes are drifting into the background, nudge this up.outside_penalty- center-to-edge contrast, and how hard subject text is blocked outside its box. Background regions use a quarter of it.late_step_scale- how much spatial strength survives the last denoising steps. Relaxation starts after 55% progress, and this is what stops region edges from looking pasted on. Note it needs the K2 Regional Sampler; a plain KSampler won't drive it.
Then there's strict_isolation, the one boolean that changes the router's character. On (default), subject-owned text tokens are private to their subject and unreachable for image tokens outside the box. Off, it degrades to a soft bias and attributes bleed between subjects. Turning it off is the first thing to try when the hard partition makes two overlapping people look disembodied or stiff.
The rule that's easy to break
spatial_enabled off disables the router completely - which sounds harmless until you remember the router is what keeps regional LoRAs local. If a regional LoRA is active and you switch the router off, its text delta becomes shared scene conditioning and leaks into every region. The node won't let you do it, and for good reason.
Output and wiring
One output, tuning, into K2 Compose. That's the whole wiring story.
Measured advice, if you're going further
The K2 Lab docs are unusually honest about the multi-region ceiling: two to three subjects sit reliably, and at four the model starts staggering people into depth instead of sizing them evenly. The measured help is a landscape aspect, inside_strength around 2.6 with outside_penalty around 2.0, and "shown full length" in every region prompt. The included four-region example workflow ships with exactly those values.
Installing it
Same as the pack: git clone https://github.com/ping1979ping/comfyui-FVMtools into custom_nodes, restart ComfyUI. Zero extra dependencies - this node is pure configuration on top of the K2 runtime.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| spatial_enabled | BOOLEAN | true | Off disables the router completely. Not allowed while a regional LoRA is active — its text delta would become shared scene conditioning. |
| strict_isolation | BOOLEAN | true | Hard partition: subject-owned text tokens are private to their subject and unreachable for image tokens outside its box. Off = soft bias only (attributes can bleed between subjects). |
| inside_strength | FLOAT | 1.000.05–10 | Positive attention bias inside each region. Larger values bind regional text harder to its box; very large values can flatten the image. |
| outside_penalty | FLOAT | 1.000–10 | Background regions use one quarter of this value. |
| falloff_pixels | FLOAT | 1280–2048 | Soft edge width beyond a background box. Subject text stays hard-confined. |
| late_step_scale | FLOAT | 0.350–1 | Fraction of spatial strength kept at the last step. Relaxation starts after 55% progress. Needs K2 Sampler. |
| subject_competition | BOOLEAN | true | Overlapping subjects share tokens by squared field strength instead of both claiming them fully (prevents merged people). |
| subject_fill | BOOLEAN | true | Keeps the field strong towards box edges so subjects fill their area. |
| spatial_instructions | BOOLEAN | true | Adds the generated location sentences to the prompt. Off = attention-only routing (shorter prompt, weaker placement). |
| lora_delta_adaptation | BOOLEAN | false | Rebalances each region's spatial scale from the observed regional LoRA delta energy. Needs K2 Sampler. |
| lora_adaptation_gain | FLOAT | 0.350–1 | Maximum correction gain for LoRA-delta adaptation. 0 measures without correcting. |
| fuse_global_loras | BOOLEAN | true | Global LoRAs as normal fused patches (faster). Off routes them through the same unfused path as regional LoRAs. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| tuning | K2_TUNING | — |