Nodes/ComfyUI-QwenImageWanBridge/Qwen2.5-VL Text Encoder
ComfyUI Node

Qwen2.5-VL Text Encoder

The standard encoder for Qwen-Image-Edit

By fblissjr·Created 12 months ago·Updated 4 months ago· 188
Qwen2.5-VL Text Encoder
  • clip
  • text
  • template_output
  • edit_image
  • vae
  • inpaint_mask
  • conditioning
  • debug_output
modeimage_edit
system_prompt
vae_max_dimension2048
debug_modefalse
auto_labeltrue
verbose_logfalse

This is the workhorse encoder for the Qwen-Image-Edit side of the pack. You give it your Qwen2.5-VL encoder, your instruction text, and - for editing - the image you want to change, and it produces the conditioning that drives the sampler. It's the node that turns "change her dress to blue" plus a photo into something Qwen-Image-Edit can act on.

Qwen-Image-Edit is the model that quietly took a huge chunk of work away from masks and adapters: describe an edit in a sentence and it happens, no ControlNet, no IP-Adapter for a lot of jobs. This node is a more configurable front-end to it than the native ComfyUI encoder - it exposes the system prompt, handles multi-image batching, and does the pixel-alignment the model is fussy about.

How it works

The model dual-encodes your edit: the image goes into Qwen2.5-VL for semantic meaning and through the VAE for appearance, while your text rides the chat template as an instruction. This node manages that handoff and, importantly, aligns your image to a 32-pixel grid - Qwen-Image-Edit is sensitive to input resolution, and getting it wrong is the well-known cause of the "offset" problem where edited images come back geometrically shifted and proportions distort. Control the input size and the output matches; that's what the alignment is protecting you from.

The mode selector is the thing that decides what kind of operation you're doing, and it changes how tokens get dropped internally (the pack uses 34 for text, 64 for image_edit) - you mostly just pick the mode that matches your intent.

The inputs and outputs that matter

  • clip (required) - the Qwen2.5-VL encoder from QwenVLCLIPLoader.
  • text - your instruction. Plain language: "remove the watermark," "make him lie down on his back." Sentences beat comma-tag soup on this encoder.
  • mode (default image_edit) - text_to_image, image_edit, multi_image_edit, or inpainting. Pick the one that matches what you're doing.
  • edit_image - the picture you're editing (for the edit/inpaint modes).
  • template_output - connect a QwenTemplateBuilder here to feed a system prompt; system_prompt lets you set one inline instead.
  • vae and inpaint_mask - needed for the inpainting mode.

Outputs: conditioning into your KSampler, and debug_output with full prompt and character-count tracing (flip on debug_mode to populate it richly).

How to install it

ComfyUI Manager: search ComfyUI-QwenImageWanBridge, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/fblissjr/ComfyUI-QwenImageWanBridge

then restart. You need the Qwen2.5-VL-7B encoder (via QwenVLCLIPLoader) and a Qwen-Image-Edit checkpoint - the 20B model is out of reach at bf16 on consumer cards, so most people run a community GGUF plus a Lightning step-reduction LoRA to make it affordable.

Common issues & troubleshooting

Edits come back shifted / proportions look wrong. This is the Qwen-Image-Edit complaint, and it's an input-resolution issue. Let this node's 32px alignment do its job and keep your input at a sane size; don't feed it a weirdly-cropped or oddly-sized image and expect pixel-perfect registration.

Pixels you didn't ask to change moved anyway. Structural to the model - it re-emits the whole frame rather than patching. For pixel-exact preservation, mask the region and use a crop-and-stitch inpaint pattern instead of a full-frame edit.

Prompt weighting / negative embeddings do nothing. Right, they're CLIP-era and the Qwen2.5-VL path never implemented them. Write instruction-shaped sentences; that's what this encoder responds to.

CategoryQwenImage/Encoding

Inputs (12)

NameTypeDefaultDescription
clipCLIP
textopt*Your prompt. Also accepts QWEN_TEMPLATE for backward compatibility.
modeoptCOMBOimage_edittext_to_image: Generate from scratch | image_edit: Single image modify | multi_image_edit: Multiple reference images (DiffSynth pattern) | inpainting: Mask-based editing. Overridden by template_output if connected.
template_outputoptQWEN_TEMPLATETemplate from Template Builder - overrides text/system_prompt/mode when connected
edit_imageoptIMAGESingle image or batch. For multiple images, use Image Batch node first.
vaeoptVAERequired for image editing - encodes reference latents
inpaint_maskoptMASKInpainting mask for selective editing (use with inpainting mode)
system_promptoptSTRINGSystem prompt (overridden by template_output if connected)
vae_max_dimensionoptINT2048512–3584⚠️ SINGLE-IMAGE MODE ONLY Ignored when using ImageBatch node. VAE encoder max dimension. Use ImageBatch node for multi-image workflows.
debug_modeoptBOOLEANfalseShow processing details in console
auto_labeloptBOOLEANtrueAutomatically add 'Picture X:' labels for multiple images (DiffSynth standard)
verbose_logoptBOOLEANfalseEnable verbose console logging of model forward passes

Outputs (2)

NameTypeDescription
conditioningCONDITIONING
debug_outputSTRING