Nodes/ComfyUI-QwenImageWanBridge/Qwen EliGen Entity Control
ComfyUI Node

Qwen EliGen Entity Control

Paint a mask, give each region its own prompt

By fblissjr·Created 12 months ago·Updated 4 months ago· 188
Qwen EliGen Entity Control
  • conditioning
  • entity1_mask
  • entity2_mask
  • entity3_mask
  • entity4_mask
  • conditioning
  • entity_preview
global_promptA beautiful landscape
entity1_prompt
entity1_weight1.0
entity2_prompt
entity2_weight1.0
entity3_prompt
entity3_weight1.0
entity4_prompt
entity4_weight1.0
apply_to_negativefalse
blend_modemultiply
debug_modefalse

This is regional prompting for Qwen-Image: hand it a base conditioning, draw a mask for each thing you want to place, give each mask its own little prompt, and the node bolts that spatial control onto the conditioning before it reaches your sampler. If you've ever tried to put "a woman in a red dress on the left, a man in a blue suit on the right" in one prompt and watched the colors swap and bleed into each other, you know exactly the wound this is trying to close.

That wound is old and stubborn. Prompt adherence is global - a single prompt describing two subjects reliably smears their attributes together, and no amount of prompt engineering fixes it. Regional prompting has been the standing answer since 2023 (Latent Couple, Regional Prompter, Forge Couple), and it gets rebuilt for every new architecture because it's implemented against a specific attention layout and never ports. EliGen is one such rebuild - an entity-level control technique from DiffSynth-Studio - and this node is fblissjr's ComfyUI wiring of it onto the Qwen encoder.

How it works

You feed it a conditioning (your encoded global prompt) plus up to four entities, each being a mask, a short prompt, and a weight. The node masks the conditioning per region so "red dress" only applies where you painted the dress, and blends the regions back against the global_prompt. Mechanically this is the same family of trick as the rest of regional prompting: mask the conditioning in a region, then let it blend back to the base so you don't get a collaged look with hard seams.

Worth setting expectations honestly: the pack's own README files this under experimental nodes that are "available but likely not working or deprecated," and EliGen barely registers in community discussion - so this is a tinkerer's tool, not a battle-tested production path.

The inputs and outputs that matter

  • conditioning (required) - your base encoded prompt, in and out.
  • global_prompt - the whole-scene description everything blends toward.
  • entity1..4_mask / _prompt / _weight - the actual regional control. Mask says where, prompt says what, weight (0–2, default 1) says how hard. You don't need all four; wire only the entities you're using.
  • blend_mode (multiply / overlay / additive) - how region conditioning combines with the base. multiply is the default and the sane starting point.

Two outputs: conditioning (wire into your KSampler) and entity_preview (an IMAGE showing where your masks land, so you can sanity-check placement before spending a sample).

How to install it

ComfyUI Manager → search ComfyUI-QwenImageWanBridge → install → restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/fblissjr/ComfyUI-QwenImageWanBridge

then restart. You'll also need a Qwen-Image workflow standing (the 20B base or Edit line, usually as a community GGUF quant on consumer cards) since this node only shapes conditioning - it doesn't generate anything on its own. It pairs naturally with the pack's QwenEliGenMaskPainter for making the masks.

Common issues & troubleshooting

Regions leak into each other. That's the known failure mode of masking text tokens - it keeps regions aware of each other but sets loose bounds that spill. Turn the offending entity's weight up, tighten the mask, or accept that this technique has never fully escaped some bleed.

Seams and a collaged look. The opposite problem: too much hard masking held too long. There's no "stop masking early" knob exposed here, so lean on blend_mode and lower weights to soften the boundaries.

It seems to do nothing. Check entity_preview first - if your masks are empty or misaligned, the node has nothing to act on. And keep the README's warning in mind: this is experimental code in a research repo, so partial or no effect on a given Qwen build is entirely on the table.

CategoryQwenImage/EliGen

Inputs (17)

NameTypeDefaultDescription
conditioningCONDITIONING
global_promptSTRINGA beautiful landscapeGlobal prompt that applies to the entire image
entity1_maskoptMASKMask for entity 1 (white=entity, black=ignore)
entity1_promptoptSTRINGPrompt for what to generate in entity 1 region
entity1_weightoptFLOAT1.00–2Weight for entity 1 influence
entity2_maskoptMASKMask for entity 2
entity2_promptoptSTRINGPrompt for entity 2
entity2_weightoptFLOAT1.00–2
entity3_maskoptMASKMask for entity 3
entity3_promptoptSTRINGPrompt for entity 3
entity3_weightoptFLOAT1.00–2
entity4_maskoptMASKMask for entity 4
entity4_promptoptSTRINGPrompt for entity 4
entity4_weightoptFLOAT1.00–2
apply_to_negativeoptBOOLEANfalseAlso apply entity control to negative prompt
blend_modeoptCOMBOmultiplyHow to blend overlapping entity regions
debug_modeoptBOOLEANfalseShow debug info about entity processing

Outputs (2)

NameTypeDescription
conditioningCONDITIONING
entity_previewIMAGE