Nodes/kubakub nodes/kubakub region prompt
ComfyUI Node

kubakub region prompt

A prompt per region, and nothing else to type

By kubakubkub·Created 19 days ago·Updated about 18 hours ago· 10
kubakub region prompt
  • regions
  • plan
  • image
  • plan
  • which regions
  • preview
  • report
◄which►
◄prompt►
◄strategyinpaint►
◄denoise0.60►
◄seed0►
◄more►

Regional prompting has been a permanent fixture of this hobby since 2023, and the regional-prompting panel explains why: prompt adherence is global, so if you describe two subjects in one prompt their attributes smear into each other, and no amount of prompt engineering fixes it. What also never changes is that every time the architecture moves, the tooling breaks and somebody rebuilds it. Region masks are the durable answer.

On a building facade the same problem appears with a vengeance: forty windows, and you want three different looks across them, plus one floor that stays exactly as it is. kubakub region prompt is the pack's low-typing way to say that: pick the regions, write the prompt, set two fields, and it produces a plan - the thing kubakub region sampler diffuses region by region while the rest of the facade stays pixel-exact. (Rendering region by region rather than through a whole-frame edit model is exactly the property the inpainting doc calls out as unreachable for edit models: unmasked pixels come back bit-identical, and masked detail gets the model's full resolution budget.)

What you set

which is the region selection - and this is where the pick regions button earns its keep. Every which regions field in the pack has one: it lists the groups, floors, sections and single names your regions hold, and a click writes the right text in. Typing works too, and the syntax is the same as everywhere else in the pack: names with wildcards (W_F1_*), group:Windows, tag:front, region:3-7, comma for or, space for and, ! for not. Empty means every region, which is a useful default for a base look and a trap for anything else.

prompt is what those regions become. {a|b|c} picks one option per region - so a row of windows can each tell a different story from one line of text - and {name} and {group} get filled in, which is how you write per-window prompts without writing per-window prompts.

strategy is the interesting field. inpaint repaints in place from the prompt. keep leaves the regions untouched, and its real job is subtraction: put a keep node after a wide prompt and it carves regions back out of it. frame_in_frame makes the region its own little scene set into the opening, like a window onto somewhere else - the pack's dedicated perspective version of that idea lives in its own workflow.

denoise is how much may change, 0.3 for a nudge and 1.0 for painted anew, and the default 0.6 is a sensible "clearly different, still the same building". seed re-rolls region seeds and the {a|b} choices; in a chain, the last node's seed is the one that counts.

Chaining, and the second output

The node takes regions (from any kubakub regions node) and an optional plan. Feed another region prompt's plan into it and it stacks on top - where both name a region, the later node wins. That's the whole authoring model: one node per idea, three or four in a row, no rule file to maintain. If you'd rather write rules, kubakub region plan is the same thing as text ([section] blocks, and a [then] marker so later sections win).

Outputs: plan goes into kubakub region sampler. which regions is the selection as text, and it's the nicest bit of the design - wire it into the same field of a kubakub shader, mask field or regions-to-mask node, and you choose your windows once and the selection propagates. preview paints the regions by strategy and prompt (same colour = same treatment, grey = kept), which is the fast way to see whether the chain does what you think it does. report lists how many regions this prompt takes and, region by region, its strategy, denoise and prompt - read it when a window refuses to change.

more is the escape hatch to the rest of the per-region settings, one key = value per line (negative, lora, reference, color_match, feather_px, animate, video_prompt, …). Empty means the usual values, and the list lives in the pack's docs/generate.md. You won't need it for a first pass.

Install

Part of kubakubkub/ComfyUI_KubaNodes - either install it from ComfyUI Manager (search kubakub nodes) and restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/kubakubkub/ComfyUI_KubaNodes
python -m pip install -r ComfyUI_KubaNodes/requirements.txt

OpenCV is the only package that file adds, and the pack wants ComfyUI 0.37.0+ (V3 node API). Building the plan here needs no model at all; the sampler downstream is what wants Klein 4B (the smallest image model in the pack's examples) or Qwen Image 2.1. The workflow facade_regions_diffusion.json shows a two-prompt chain - one on the floor-1 windows, one on everything else - and runs on the sample facade with no files of your own.

Two gotchas

pick regions learns the names per node, once the regions node has run in the session. Open another workflow and the list is stale until you queue once. It also doesn't see into subgraphs, and that's a documented 0.4.0 limit, not you doing something wrong. Second: an empty which on a keep node means "keep everything", which achieves precisely nothing - if a region stubbornly stays as it was, check for a keep upstream that's quietly claiming it.

Categorykubakub/2d/generate

Inputs (9)

NameTypeDefaultDescription
whichSTRINGThe regions this prompt is for: use the pick regions button below, or type. Empty = every region. Written as in kubakub region plan: names with wildcards ('W_F1_*'), 'group:Windows', 'tag:front', 'region:3-7'; comma = or, space = and, '!' = not.
promptSTRINGWhat these regions become. {a|b|c} picks one per region, so a row of windows can tell different stories; {name} and {group} are filled in.
strategyCOMBOinpaintinpaint: repainted in place from the prompt. keep: left untouched (to take regions out of an earlier, wider prompt). frame_in_frame: a scene of its own, set into the region like a window onto it.
denoiseFLOAT0.600–1How much the regions may change: 0.3 = a little, 0.6 = clearly, 1 = painted anew.
seedINT00–18446744073709550000Another number = another result (region seeds and {a|b} choices). With a 'plan' connected, the seed of the last node in the chain counts.
regionsoptKUBA_REGIONSFrom any kubakub regions node. Not needed when 'plan' is connected: the plan brings its regions.
planoptKUBA_PLANThe prompts so far: another kubakub region prompt (or a kubakub region plan). This one is added on top: where both name a region, this node wins.
moreoptSTRINGOther settings for these regions, one key = value per line: negative, lora, reference, color_match, feather_px, animate, video_prompt ... (the list is in docs/generate.md). Empty = the usual values.
imageoptIMAGEBackground for the preview (the matrix). Another size than the regions is scaled to fit, for the preview only.

Outputs (4)

NameTypeDescription
planKUBA_PLANInto kubakub region sampler (or the next kubakub region prompt).
which regionsSTRINGThe text of 'which regions' as it is: connect it to the same field of a kubakub shader, mask field, regions to mask ... so the choice is made once.
previewIMAGESame colour = same strategy and prompt; grey = kept.
reportSTRINGHow many regions this prompt takes, then every region with its strategy, denoise and prompt.