Qwen EliGen Entity Control
Paint a mask, give each region its own prompt
- conditioning
- entity1_mask
- entity2_mask
- entity3_mask
- entity4_mask
- conditioning
- entity_preview
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.multiplyis 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.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| conditioning | CONDITIONING | — | |
| global_prompt | STRING | A beautiful landscape | Global prompt that applies to the entire image |
| entity1_maskopt | MASK | Mask for entity 1 (white=entity, black=ignore) | |
| entity1_promptopt | STRING | Prompt for what to generate in entity 1 region | |
| entity1_weightopt | FLOAT | 1.00–2 | Weight for entity 1 influence |
| entity2_maskopt | MASK | Mask for entity 2 | |
| entity2_promptopt | STRING | Prompt for entity 2 | |
| entity2_weightopt | FLOAT | 1.00–2 | — |
| entity3_maskopt | MASK | Mask for entity 3 | |
| entity3_promptopt | STRING | Prompt for entity 3 | |
| entity3_weightopt | FLOAT | 1.00–2 | — |
| entity4_maskopt | MASK | Mask for entity 4 | |
| entity4_promptopt | STRING | Prompt for entity 4 | |
| entity4_weightopt | FLOAT | 1.00–2 | — |
| apply_to_negativeopt | BOOLEAN | false | Also apply entity control to negative prompt |
| blend_modeopt | COMBO | multiply | How to blend overlapping entity regions |
| debug_modeopt | BOOLEAN | false | Show debug info about entity processing |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| conditioning | CONDITIONING | — |
| entity_preview | IMAGE | — |