Nodes/mc_qwen/McTextEncodeQwenImEditPlus
ComfyUI Node

McTextEncodeQwenImEditPlus

The Qwen-Edit text encoder that stops your edits coming back blurry and shifted

By tester4488·Created 10 months ago·Updated 10 months ago· 4
McTextEncodeQwenImEditPlus
  • clip
  • vae
  • image1
  • image2
  • image3
  • image4
  • CONDITIONING
prompt
target_size896

It's probably not your checkpoint. If Qwen-Image-Edit keeps coming back slightly zoomed, nudged off-center, or just softer than the official chat version, the usual suspect is the text-encode step - the part that reads your image and your instruction and turns them into conditioning. McTextEncodeQwenImEditPlus from the mc_qwen pack is a drop-in replacement for that step, and its whole reason to exist is a two-word difference: it resizes your reference image with lanczos instead of area.

The README is honest about where this comes from. It's a repackaged version of Phr00t's "fixed-textencode-node" from the Qwen-Image-Edit-Rapid-AIO pack, written after the author read the +200 r/comfyui post "How to get the highest quality QWEN Edit 2509 outputs" - which noticed nearly every ComfyUI workflow of the time produced blurrier results than Qwen's own chat, and that part of the blame sat in the encode node.

What the stock path gets wrong

Qwen-Image-Edit is a dual-encoding model. Your input image goes in twice: once through the Qwen2.5-VL vision encoder for semantic understanding ("there's a woman in a red dress"), and once through the VAE as a reference latent for appearance control (the actual pixels). The stock encoder node took your single image, area-rescaled the whole thing to a hardcoded 1024×1024, and fed that same resized copy to both paths. Two problems with that: area rescale averages pixels, so a 2K photo downscaled to 1MP comes back mushy, and forcing a fixed 1MP is what caused the "unzooming"/offset complaint that dogged 2509.

This node splits the two channels. Each input image still gets area-rescaled to fit a 384×384 box for the vision branch - that's what the VL encoder expects, so it stays. But the reference-latent path now uses lanczos upscaling to a controlled target_size, rounded to a multiple of 32, before VAE encoding. Lanczos preserves the high-frequency detail that area scaling throws away, which is the entire difference between "conditioning that remembers my subject" and "conditioning that remembers a smear of my subject." It's not a miracle cure for Qwen's whole-frame drift, but the input-resolution control here is the same trick the offset-fix threads converged on.

The inputs that matter

  • image1image4 - up to four reference images, matching 2509's multi-image editing (person+person, person+product, person+scene). Leave the extras empty; each gets a "Picture N:" label plus vision tokens so the model knows which is which.
  • vae - the trap. This port is faithful to the original, and in the original the VAE input is the switch: connect it or the reference-latent branch never runs at all and you're left with semantic-only conditioning. Wire in the same VAE the workflow uses for decoding.
  • target_size - default 896, 128–2048 in steps of 32. This is both your detail dial and your VRAM dial. Higher costs you real memory on the VAE encode, and on a 20B model you're already spending a lot of VRAM before you get here.
  • clip, prompt - your Qwen2.5-VL text encoder and your plain-language instruction ("change her dress to blue", not a tag wall).

The single output is CONDITIONING, straight into the KSampler's positive input, same as any other encode node.

Installing it

The pack is one node and three example workflow JSONs - no pip dependencies, just ComfyUI core calls.

# via ComfyUI Manager: search "mc_qwen" and install
# or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/tester4488/mc_qwen.git

Restart ComfyUI and you'll find it under MC nodi/Qwen in the node menu. One gotcha: this pack uses ComfyUI's newer extension API (from comfy_api.latest import ...), so if the node won't load on an old build, update ComfyUI first.

What it still needs from you

The node ships no models. You still need the Qwen-Image-Edit checkpoint (fp8 from Comfy-Org's split files runs ~22.5GB VRAM; GGUF via ComfyUI-GGUF if you're under that), the Qwen2.5-VL text encoder (qwen_2.5_vl_7b_fp8_scaled is the usual pick), and the Qwen VAE. This node is the conditioner, not the loader.

Where people get burned

  • Vae left unplugged. The number one mistake, because the node doesn't error - it just silently skips the appearance channel. If your edits look "vague" or wander, check that wire first.
  • Chasing blur past 896. Crank target_size and you can OOM on the VAE encode; drop it to 640–896 on a tight card. Bigger isn't automatically better.
  • Expecting it to fix drift. It fixes resize-induced offset, not Qwen's re-emits-the-whole-frame drift. Faces still drift on a chain of edits; if you need untouched pixels, mask and crop-and-stitch around it.
  • Wrong stack. This only works with the Qwen2.5-VL text encoder plus a Qwen-Image-Edit checkpoint. Dropping it into an SDXL or Flux graph does nothing useful.

It's free, tiny, and the reasoning is sound. If your Qwen-Edit outputs keep that nagging softness and shift, this is the two-minute fix.

CategoryMC nodi/Qwen

Inputs (8)

NameTypeDefaultDescription
clipCLIP
promptSTRING
vaeoptVAE
image1optIMAGE
image2optIMAGE
image3optIMAGE
image4optIMAGE
target_sizeoptINT896128–2048

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING