Eric Qwen Conditioning Encode
Turn an image + instruction into a reusable embedding
- pipeline
- image
- conditioning
Every workflow in Eric's conditioning system starts here. Eric Qwen Conditioning Encode takes an image plus an edit instruction and runs them through the model's built-in Qwen2.5-VL vision-language encoder, producing a QWEN_CONDITIONING - a bundle of token embeddings that everything downstream (Interpolate, Blend, Direction Compute, and finally Conditioned Edit) operates on.
The pitch is simple: once something is encoded, you can do arithmetic on it. Encode the same portrait twice with different instructions and the difference between the two conditionings is a direction you can apply to any other portrait at any strength. That's the whole trick this system is built around, and Encode is the input side of it.
What it actually does
Qwen2.5-VL processes your image and prompt together into a prompt_embeds tensor - a sequence of ~3584-dimension vectors. For a typical input that sequence splits into roughly three regions: a few chat-template header tokens, ~176–196 image vision tokens (each covering a 28×28 pixel patch of the ~384px VL image), and the instruction text tokens. The node stores this on CPU as a dict with the embeddings, a padding mask, and metadata about token layout - that metadata is what lets the other nodes auto-detect where "image" ends and "text" begins.
Don't worry about the details on day one. What you should notice in the console is the layout line:
[EricQwenEncode] token layout: ~176 image + ~22 text (prefix_N=176 for skip_prefix_N scope)
That prefix_N value is the boundary the Interpolate and Direction Apply nodes read automatically when you leave their prefix_N at 0.
Inputs that matter
image- the reference. Note the tooltip: it's resized to ~384px internally, so a 20 MP photo is a waste here. Feed it the composition you care about, not maximum pixels.prompt- the edit instruction, exactly as you'd type it into Eric Qwen-Edit Image. "Change the background to a sunset", "make the person smile".max_sequence_length- token budget, default 512. With ~195 image tokens and template overhead, that leaves roughly 300 tokens (~200 words) for your instruction. Raise to 768–1024 only for very long, detailed descriptions; unused positions are masked out so there's no quality penalty, just a few more MB of compute.
Output is the single conditioning socket. That's it - one output, wire it to an Interpolate, a Blend, a Direction Compute, or straight into Conditioned Edit if you just want to skip the text encoder on later reruns.
Installing it
Same pack, same story. ComfyUI Manager → search "Eric Qwen-Edit", or:
cd ComfyUI/custom_nodes
git clone https://github.com/EricRollei/Eric_Qwen_Edit_Experiments.git
Restart, then load Qwen-Image-Edit-2511 (or 2509) via one of the pack's loader nodes - Qwen/Qwen-Image-Edit-2511, ~54 GB. This pack runs the real diffusers pipeline, so its own loaders are mandatory; ComfyUI's stock model-loading nodes produce incompatible wrappers.
Gotchas
- Encoding is cheap and worth redoing. It's a small VL model pass on a ~384px image - much cheaper than a diffusion run. If your edit instruction changes, just re-encode rather than trying to hack the embedding.
- The image you encode and the image you pass to Conditioned Edit should usually match. Encode's image defines what the model sees; Conditioned Edit's image drives the pixel path and output resolution. Mismatch them and you're telling the model one thing while rendering another.
- Don't pad the prompt to fill the budget.
max_sequence_lengthis a ceiling, not a target. Keep 512 unless you have a genuinely long description.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| pipeline | QWEN_EDIT_PIPELINE | Loaded Qwen-Edit pipeline (from any Loader node) | |
| image | IMAGE | Reference image - used for VL semantic conditioning. Resized to ~384px internally; full resolution is NOT needed here. | |
| prompt | STRING | Edit this image to... | Edit instruction - exactly as you would type in Eric Qwen-Edit Image |
| max_sequence_lengthopt | INT | 512128–1024 | Max prompt token budget. 512 is sufficient for most prompts. Raise to 768-1024 only for very long detailed descriptions. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| conditioning | QWEN_CONDITIONING | — |