Skip to content

Conversation

@nolan4
Copy link

@nolan4 nolan4 commented Oct 25, 2025

Pull Request: Add Entity-Level Image Generation (EliGen) for Qwen Image

Summary

This update implements Entity-Level Image Generation (EliGen) for the Qwen Image model, allowing region-specific prompts through spatial masks. The feature provides fine-grained control over image generation by applying separate attention masks for each entity.

Key Features
• Spatial attention masking with isolated entity prompts
• Automatic mask resizing to match latent dimensions
• RoPE embedding implementation aligned with DiffSynth Studio
• Support for batch_size > 1
• Backward compatible with standard Qwen Image workflows

@krigeta
Copy link

krigeta commented Oct 28, 2025

Hey @nolan4 thank you so much for this amazing work! I am trying to test this out but not able to run it, I am using this PR and using the Eligen Lora provided by Diffsynth Studio and using this workflow, please check.

@krigeta
Copy link

krigeta commented Oct 29, 2025

hey @nolan4 may you please reply?

@nolan4
Copy link
Author

nolan4 commented Oct 29, 2025

Hi @krigeta — here’s a screenshot of my workflow, which is based on the Qwen text-to-image template. I’m also using the same EliGen LoRA from Diffsynth Studio that you linked. Hope this helps you get it running!
eligen example workflow

@krigeta
Copy link

krigeta commented Oct 29, 2025

Hey @nolan4 thank you so much for this, what if this branch is not merged then is it possible to create a custom node of this?

and yeah i will test this and share the results for sure.

@krigeta
Copy link

krigeta commented Oct 30, 2025

hey @nolan4 it is not working in my case, please check.
Screenshot (99)

@nolan4
Copy link
Author

nolan4 commented Oct 30, 2025

Looks like you have multiple loras, try just one for testing purposes. I tried your prompt with a few minor modifications:
dragonball z example

@Kosinkadink
Copy link
Collaborator

test locally and works, comfy will do a code review to see if anything else needs to be changed!

@krigeta
Copy link

krigeta commented Oct 31, 2025

Looks like you have multiple loras, try just one for testing purposes. I tried your prompt with a few minor modifications: dragonball z example

Will gonna test it asap and this time I am gonna test the official example as shown in the official Eligen lora implementation and one more thing I want to ask:

In the Diffsynth studio repo, they said it is important to make those colored masks with text overlays. Is that true?

As in their official example, the masks are overlaid to achieve smooth results.

@Amazon90
Copy link

2123 How can I get this node?

@krigeta
Copy link

krigeta commented Nov 1, 2025

2123 How can I get this node?

you have to install this PR and not the actual comfyUI setup to use this node, as of now it is not the part of the main repo.

@krigeta
Copy link

krigeta commented Nov 2, 2025

Hey @nolan4, I guess this implementation is missing the colour-coded masks that help the lora to differentiate between the regions when they overlap. Please look into it.

@geroldmeisinger
Copy link

btw something similar was implemented in the Inspire Pack called "regional conditioning by color masks" in case you need inspiration or code
https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Inspire-Pack/workflow/RegionalCFG-RegionalConditioning.png
RegionalCFG-RegionalConditioning
https://github.com/ltdrdata/ComfyUI-Inspire-Pack

@geroldmeisinger
Copy link

geroldmeisinger commented Nov 2, 2025

How can I get this node?

comfy-cli --workspace ./ComfyUI_eligen install --pr "#10473"
comfy-cli --workspace ./ComfyUI_eligen launch

@geroldmeisinger
Copy link

from https://www.modelscope.cn/models/DiffSynth-Studio/Qwen-Image-EliGen code example

global prompt:
The promotional poster for Qwen-Image-EliGen Magic Cafe features two magical coffee cups, one flaming and the other spitting out ice cones, against a light blue mist background. The poster reads "Qwen-Image-EliGen Magic Cafe" and "New Arrival."

entity prompts:
A red magical coffee cup with flames burning inside.
A red magical coffee cup surrounded by ice cones.
Text: "New Arrival"
Text: "Qwen-Image-EliGen Magic Cafe"

@geroldmeisinger
Copy link

geroldmeisinger commented Nov 2, 2025

Looks like you have multiple loras, try just one for testing purposes. I tried your prompt with a few minor modifications

I can confirm it works: 8step lora -> eligen lora -> ksampler

I guess this implementation is missing the colour-coded masks that help the lora to differentiate between the regions when they overlap. Please look into it.

I can confirm it works

Screenshot from 2025-11-02 21-01-08

eligen_colorspheres.json

mask_ball1 mask_ball2 mask_ball3

note i use euler+beta, cfg=1, 1328x1328 but that shouldn't make much difference

@krigeta
Copy link

krigeta commented Nov 3, 2025

Hey @geroldmeisinger , thank you so much for the share, is there any other social media where we can chat?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Core Core team dependency

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants