Text Encode Qwen Edit Plus (Slots)
Stop hand-assembling Qwen edit prompts — build them in slots and encode in one node
- clip
- vae
- image1
- image2
- image3
- image4
- conditioning
- prompt
If you edit images with Qwen-Image-Edit, you know the dance: wire a reference image into ComfyUI's core TextEncodeQwenImageEditPlus node, then type one long comma-joined sentence of instructions into a single text box. Fine for a one-off. Miserable when you're A/B testing, because every tweak means editing one giant string and hoping you didn't nuke the part that was working.
Text Encode Qwen Edit Plus (Slots) is that core node with a prompt builder bolted on. You get up to 10 toggleable text slots with reorder buttons and a live preview of the combined result, and the node encodes it through the exact same Qwen Image Edit pipeline. The conditioning it produces is identical to the core node's - the author copied the encode logic straight from comfy_extras/nodes_qwen.py. This is a drop-in replacement, not a new pipeline.
Why Qwen edit prompts want slots
Qwen-Image-Edit is the open instruction-editing standard: a 20B multimodal model you steer with a reference image plus a plain-language sentence. Because the text encoder is an LLM (Qwen2.5-VL), you write sentences, not tag soup, and weighting syntax is inert - which is exactly why a modular builder pays off. Keep "change her dress to a navy trench coat" in slot 1, lock "keep the pose" in slot 2, then toggle slot 3 on and off to test "add subtle film grain" without touching the working parts. That's the whole pitch: iteration without anxiety.
What you actually set
The node needs a clip (your Qwen 2.5-VL CLIP - you already own this if you run any Qwen-Image-Edit workflow), plus a vae and up to four image1..image4 reference images, all optional. The controls that matter:
mode-Combine Enabledjoins your enabled, non-empty slots withseparator(default ", ");Select Oneemits a single chosen slot viaselect. Combine is what you'll use 95% of the time.slot_count- how many slots are visible, 1–10. Set it to 3 and hide the clutter.use_manual_edit-AUTOencodes the assembled slots;MANUALencodesfinal_promptverbatim. Flip it when you want to hand-tweak the preview before encoding.component_detail-Fullmatches the core node exactly.Balanced/Lightshrink the image2–4 reference latents, which matters when you run four images (more below).text_1..text_10+enable_1..enable_10- the slots, each with a native ON/OFF toggle and ▲/▼ reorder buttons.
Outputs are conditioning (wire straight into your sampler) and prompt (the exact text that got encoded, handy for logging or chaining).
Install
Via ComfyUI-Manager (Install via Git URL → paste the repo), or:
cd ComfyUI/custom_nodes
git clone https://github.com/normbarrette-arch/ComfyUI-QwenEditPlusSlots.git
Restart ComfyUI - and hard-refresh the browser tab, or the slot JavaScript won't load. The node shows up under advanced/conditioning. No extra pip dependencies in this pack; the heavy lift is the Qwen Image Edit checkpoint itself, which you already have if you've done a Qwen edit before.
Gotchas
The one that bites: the Qwen edit model is optimized for ≤3 reference images. image4 is an opt-in extra, and a 4th reference can reduce consistency. Leave it unconnected and the node behaves exactly like the 3-image core node; if you do use it, drop component_detail to Balanced so the extra reference doesn't crowd the prompt out of the model's attention. Unused image inputs are skipped, so there's no penalty for leaving them dangling.
One more thing to know before you fork it into a big project: because the encode pipeline mirrors ComfyUI core's GPL-3.0 nodes_qwen.py, this whole pack is GPL-3.0. Fine for personal use; it's a real constraint if you plan to ship a closed-source derivative.
Inputs (33)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| mode | COMBO | 2 options: Combine Enabled, Select One | |
| select | INT | 11–10 | Which slot to output in 'Select One' mode |
| separator | STRING | , | — |
| slot_count | INT | 21–10 | Number of visible text slots |
| use_manual_edit | BOOLEAN | false | AUTO: encode the combined slots. MANUAL: encode the edited final_prompt text instead. |
| final_prompt | STRING | Live preview of the combined slots. Turn use_manual_edit ON to hand-edit and encode this text instead. | |
| component_detail | COMBO | Full | Detail budget for the component images (image2-4). image1 (the source) always stays at full detail. Lower settings shrink only the component references, freeing model attention for the prompt while still transferring each component. 'Full' behaves exactly like the core node. |
| vaeopt | VAE | — | |
| image1opt | IMAGE | — | |
| image2opt | IMAGE | — | |
| image3opt | IMAGE | — | |
| image4opt | IMAGE | — | |
| text_1opt | STRING | — | |
| enable_1opt | BOOLEAN | true | — |
| text_2opt | STRING | — | |
| enable_2opt | BOOLEAN | false | — |
| text_3opt | STRING | — | |
| enable_3opt | BOOLEAN | false | — |
| text_4opt | STRING | — | |
| enable_4opt | BOOLEAN | false | — |
| text_5opt | STRING | — | |
| enable_5opt | BOOLEAN | false | — |
| text_6opt | STRING | — | |
| enable_6opt | BOOLEAN | false | — |
| text_7opt | STRING | — | |
| enable_7opt | BOOLEAN | false | — |
| text_8opt | STRING | — | |
| enable_8opt | BOOLEAN | false | — |
| text_9opt | STRING | — | |
| enable_9opt | BOOLEAN | false | — |
| text_10opt | STRING | — | |
| enable_10opt | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| conditioning | CONDITIONING | — |
| prompt | STRING | — |