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

Qwen2.5-VL Text Encoder (Advanced)

Per-image resolution control for Qwen-Image-Edit

By fblissjr·Created 12 months ago·Updated 4 months ago· 188
Qwen2.5-VL Text Encoder (Advanced)
  • 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
resolution_modebalanced
hero_weight1.0
reference_weight0.5
max_memory_mb0
image_weights
label_formatPicture

This is the power-user version of QwenVLTextEncoder, and it exists for one situation in particular: multi-image edits where you want to say "this image matters more than that one." Qwen-Image-Edit's 2509 line takes multiple input images - person plus product, person plus scene, character across references - and the moment you're juggling three inputs, "how much should each one weigh, and at what resolution?" becomes a real question. This node gives you those dials. It's the most-searched node in the whole pack, which tracks: multi-image editing is where people run into limits and go looking.

Everything the standard encoder does, this does too. The additions are all about importance and memory: hero/reference weighting, per-image resolution, and a memory budget so a stack of high-res inputs doesn't blow up your VRAM.

How it works

Same core as the standard node - Qwen2.5-VL semantic encoding plus VAE appearance encoding, chat-template instruction, 32px alignment. On top, it lets you designate some inputs as "hero" (the subject you care about, encoded at full weight) and others as "reference" (context, encoded lighter). The resolution_mode applies a weighting pattern across your images - balanced treats them evenly, hero_first/hero_last emphasize an end of the batch, progressive ramps across them. That's layered on the base scaling behavior, so you're steering both how big each image is encoded and how much attention it gets.

The honest read: this is a lot of knobs for a model that already re-emits the whole frame and drifts on faces. The weighting genuinely helps prioritize a subject in a busy multi-image edit, but it won't fix identity drift or make unedited pixels hold still. Reach for it when you have a real multi-input composition, not for a single-image tweak - that's what the standard encoder is for.

The inputs and outputs that matter

  • clip (required) - Qwen2.5-VL from QwenVLCLIPLoader.
  • text, mode, edit_image, template_output - same as the standard encoder.
  • resolution_mode (default balanced) - the weighting strategy across images: balanced, hero_first, hero_last, progressive, custom, memory_optimized.
  • hero_weight (default 1.0) and reference_weight (default 0.5) - how much the important vs. supporting images count.
  • max_memory_mb - a VRAM budget for the encode; leave at 0 for no cap, set it when large inputs OOM you.
  • image_weights - a string for hand-specifying per-image weights in custom mode.
  • label_format - whether inputs are labeled "Picture" or "Image" in the prompt the model sees.

Outputs: conditioning to the sampler, debug_output for tracing.

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. Same models as the standard encoder: Qwen2.5-VL-7B and a Qwen-Image-Edit checkpoint (community GGUF + a Lightning LoRA on consumer hardware). Multi-image edits stack VRAM fast - the max_memory_mb cap is here for a reason.

Common issues & troubleshooting

You're using it for a single image. Overkill. The weighting modes only matter with multiple inputs; for one image the standard QwenVLTextEncoder is simpler and does the same encode.

OOM on a multi-image batch. Set max_memory_mb to a real budget, or switch resolution_mode to memory_optimized. Three full-res inputs through a 7B VLM encoder is a lot of memory before the diffusion model even runs.

Weighting isn't "fixing" a drifting face. It can't - that's the model re-emitting the whole frame, not a weighting problem. Prioritize the hero image to keep the subject dominant, but for a specific face you need an inpaint pass or a character LoRA, not encoder weights.

CategoryQwenImage/Encoding

Inputs (18)

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–3584VAE encoder max dimension (pixel-level detail). Recommended values: • 1024 - Safe for 8GB VRAM • 2048 - Recommended (12GB+ VRAM) • 3584 - Model maximum (24GB+ VRAM) ⚠️ SINGLE-IMAGE MODE ONLY Ignored when using ImageBatch node. Note: resolution_mode weights apply on top of this base.
debug_modeoptBOOLEANfalseShow processing details in console
auto_labeloptBOOLEANtrueAutomatically add labels for multiple images (e.g., 'Picture 1:')
verbose_logoptBOOLEANfalseEnable verbose console logging of model forward passes
resolution_modeoptCOMBObalancedResolution weighting strategy for multi-image processing. Applies weight multipliers to base max_dimension limits: • balanced: All images at 1.0x base (equal quality) • hero_first: First image at hero_weight, others at reference_weight • hero_last: Last image at hero_weight, others at reference_weight • progressive: Gradual weight decrease • custom: Use image_weights string • memory_optimized: Aggressive downscaling for VRAM Example: vae_max_dimension=2048, hero_weight=1.5, reference_weight=0.5 → Hero: 3072px, References: 1024px
hero_weightoptFLOAT1.00.5–2Resolution multiplier for hero image (hero modes only)
reference_weightoptFLOAT0.50.1–1Resolution multiplier for reference images
max_memory_mboptINT00–16384Max memory for images in MB (0=unlimited)
image_weightsoptSTRINGComma-separated weights per image (e.g., '1.0,0.5,0.3')
label_formatoptCOMBOPictureLabel format for multi-image: 'Picture X:' (DiffSynth) or 'Image X:' (Docs)

Outputs (2)

NameTypeDescription
conditioningCONDITIONING
debug_outputSTRING