ComfyUI Node

Stack_condi

Five Masked Regions, One Background, One Conditioning Bundle

By cardenluo·Created 2 years ago·Updated 17 days ago· 309
Stack_condi
  • mask_1
  • mask_2
  • mask_3
  • mask_4
  • mask_5
  • condi_stack
pos1
pos2
pos3
pos4
pos5
mask_1_strength1.00
mask_2_strength1.00
mask_3_strength1.00
mask_4_strength1.00
mask_5_strength1.00
backgroundbackground is sea
background_strength1.00
negPoor quality

Putting two or three specifically-described things in specific places in one image is one of the genuinely unsolved problems in text-to-image - the community's own framing is that multiple distinct subjects in one shot is "largely unsolved without spatial scaffolding." Stack_condi is that scaffolding: up to five independent text prompts, each with its own mask and its own strength, composited over a shared background prompt, all rolled into one conditioning bundle.

How it's laid out

  • pos1 through pos5 - five independent positive text prompts, each optional. You don't need to fill all five; use as many regions as your composition actually needs.
  • mask_1 through mask_5 - a mask per region, telling the node where each posN prompt applies.
  • mask_1_strength through mask_5_strength (default 1, range 0–10) - how strongly each region's prompt is weighted relative to the others.
  • background (multiline text, default background is sea - yes, that's the author's own placeholder) and background_strength (default 1) - the prompt covering whatever isn't claimed by one of the five masks.
  • neg (default Poor quality) - a single shared negative prompt covering the whole composite.

Output: condi_stack, a STACK_CONDI object meant to feed into Apt_Preset's own downstream sampler node.

What it's actually doing

This is regional conditioning: instead of one prompt describing the whole frame, you paint five masks over your canvas and give each one its own description - "a knight" over one region, "a dragon" over another, "a stone tower" over a third - while the background prompt fills in whatever's left unmasked. Each region's mask and strength control how firmly that text's conditioning is applied within its boundary; everything is composited into one CONDITIONING-shaped bundle before it reaches the sampler, rather than you manually chaining ConditioningSetMask and ConditioningCombine nodes five times over.

Setting it up

Start with fewer regions than you think you need - two or three well-placed masks beat five overlapping ones. Keep strengths near the default (1) until you see whether a region is being under- or over-expressed, then nudge individual posN_strength values rather than the whole composition's CFG. The background prompt matters more than it looks like it should: anything your masks don't cover falls back to it, so a vague background prompt (or the sample "background is sea" left un-edited) will bleed into any gaps in your mask coverage.

Install

ComfyUI Manager: search "ComfyUI-Apt_Preset," install, restart. By hand: cd ComfyUI/custom_nodes && git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git, then restart. The pack's install.bat dependency installer is Windows-only - on Linux or a cloud instance, open it to see what it installs and pip-install those packages yourself, or trust ComfyUI Manager's "install missing nodes" prompt the first time you load a graph that needs it.

Troubleshooting

The schema doesn't spell out what happens to a mask that doesn't match your canvas's resolution - assume it needs to line up and check your output carefully if a region looks warped or misplaced rather than assuming it auto-corrects.

Leaving a posN field empty presumably means that mask's region just falls back toward the background prompt rather than getting its own override, though the exact fallback isn't documented - if a region isn't behaving how you expect, double-check you actually typed something into its posN field.

This pack has real, reported import failures independent of Stack_condi specifically - a comfyui subreddit thread shows (IMPORT FAILED): ...ComfyUI-Apt_Preset in someone's console after loading a workflow that used one of its nodes. ComfyUI Manager's "install missing custom nodes" fixed it for them, as did manually re-cloning the repo and restarting.

CategoryApt_Preset/stack/😺backup

Inputs (18)

NameTypeDefaultDescription
pos1optSTRING
pos2optSTRING
pos3optSTRING
pos4optSTRING
pos5optSTRING
mask_1optMASK
mask_2optMASK
mask_3optMASK
mask_4optMASK
mask_5optMASK
mask_1_strengthoptFLOAT1.000–10
mask_2_strengthoptFLOAT1.000–10
mask_3_strengthoptFLOAT1.000–10
mask_4_strengthoptFLOAT1.000–10
mask_5_strengthoptFLOAT1.000–10
backgroundoptSTRINGbackground is sea
background_strengthoptFLOAT1.000–10
negoptSTRINGPoor quality

Outputs (1)

NameTypeDescription
condi_stackSTACK_CONDI