Nodes/ComfyUI_PixQwenImageEditEnhanced/πŸ‹ Pix Qwen Image Edit (5 Images)
ComfyUI Node

πŸ‹ Pix Qwen Image Edit (5 Images)

Five reference images and a system prompt you can actually read

By PixWizardryΒ·Created 8 months agoΒ·Updated 8 months agoΒ· 4
πŸ‹ Pix Qwen Image Edit (5 Images)
  • clip
  • vae
  • image1
  • image2
  • image3
  • image4
  • image5
  • conditioning
  • token_log
  • final_prompt
β—„USER_PROMPTβ€”β–Ί
β—„SYSTEM_INSTRUCTIONDescribe the key features of the input image (color, shape, size, texture, objects, background), then explain how the user's text instruction should alter or modify the image. Generate a new image that meets the user's requirements while maintaining consistency with the original input where appropriate.β–Ί
β—„ASSISTANT_PRIMINGβ–Ί

Qwen-Image-Edit is the model that made image editing a sentence rather than a mask-and-adapters project, and this node is where you talk to it. Pix Qwen Image Edit (5 Images) is a conditioning node - the thing that turns your prompt, your reference images, and your edit instruction into the CONDITIONING your sampler actually denoises from. It's a drop-in upgrade for the native TextEncodeQwenImageEditPlus that ComfyUI ships: same job, more rope.

The name is honest about the headline feature. The native node gives you three image slots; this one gives you five. That's not a cosmetic bump - the model's whole trick is stuffing your references into its "context window," so more slots means composing a person, a product, a background and two reference angles in one pass. It's also the only reason this node exists: the author reverse-engineered the native node, added the slots, and exposed everything the original hides.

How it works

Under the hood it's still the standard Qwen path, just with the hood open. The node builds a llama-style chat template - a system block, a user block containing your images plus USER_PROMPT, and an assistant block that's pre-filled with whatever you put in ASSISTANT_PRIMING. Each reference image is split two ways, mirroring the model's own design: downscaled to ~384px for the vision encoder (semantics - what's in the picture), and, if you connect a VAE, re-encoded at ~1024px into reference_latents (appearance - what the pixels look like). The vision pass alone runs about 720–740 tokens per image, which is why there's a live counter on the node showing your 32k context budget.

The inputs that matter

  • clip (required) - the CLIP from your Qwen-Image-Edit model loader. Load the 20B model (GGUF quantized if you value your VRAM) and wire its CLIP in here.
  • USER_PROMPT - the edit instruction, plain language: "remove the watermark," "change her dress to blue."
  • SYSTEM_INSTRUCTION - the default text is the "maintain consistency" clause. Keep it for character work; strip it for creative mode where the references are mood, not mandate.
  • ASSISTANT_PRIMING - your chance to write the first words of the model's response. "A hyper-realistic 8k photo of…" forces the style before the prompt even loads.
  • vae + image1–image5 - all optional. Leave vae disconnected and you get "concept mode": vision-only, lower VRAM, worse output.

Three outputs come back: conditioning (into the sampler's positive input), token_log and final_prompt (both strings - pipe them into a text display node to see exactly what got sent, which is a lifesaver when output is weird).

Install

No Python dependencies, no API key, nothing to download beyond the repo itself - the heavy lifting is the 20B model, which is a you problem, not a node problem. Either search Pix Qwen in ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/PixWizardry/ComfyUI_PixQwenImageEditEnhanced

Then restart ComfyUI. It needs a recent-enough core - the author tested on ComfyUI v0.6.0, and the clip.tokenize call with a llama template is a Qwen-Image-era feature, so an old install will just error.

Where people get burned

The bypass logic is the part to learn, because it's also the VRAM strategy. Bypass an individual image node and the slot detects the empty tensor and drops that picture from the prompt entirely - no ghost data. Bypass the VAE and you're in low-res concept mode (fine for testing, weak output). And for a negative conditioning branch, bypass all images and the VAE so the negative is text-only: you save the VRAM of encoding five negatives and the steering gets cleaner. The README's example - "blurry, low quality" as a blind negative against five visual positives - is the right shape.

One honest caveat from the wider Qwen-Edit world: the model re-emits the whole frame, so pixels you never mentioned drift, and faces drift worst. This node doesn't fix that. For pixel-exact edits, keep a mask and Inpaint Crop & Stitch in the workflow anyway. For everything else, five references and a system prompt you can edit is a genuinely better way to steer an edit.

Categoryadvanced/conditioning

Inputs (10)

NameTypeDefaultDescription
clipCLIPβ€”
USER_PROMPTSTRINGβ€”
SYSTEM_INSTRUCTIONSTRINGDescribe the key features of the input image (color, shape, size, texture, objects, background), then explain how the user's text instruction should alter or modify the image. Generate a new image that meets the user's requirements while maintaining consistency with the original input where appropriate.β€”
ASSISTANT_PRIMINGSTRINGβ€”
vaeoptVAEβ€”
image1optIMAGEβ€”
image2optIMAGEβ€”
image3optIMAGEβ€”
image4optIMAGEβ€”
image5optIMAGEβ€”

Outputs (3)

NameTypeDescription
conditioningCONDITIONINGβ€”
token_logSTRINGβ€”
final_promptSTRINGβ€”