Qwen2.5-VL Text Encoder (Advanced)
Per-image resolution control for Qwen-Image-Edit
- clip
- text
- template_output
- edit_image
- vae
- inpaint_mask
- conditioning
- debug_output
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 fromQwenVLCLIPLoader.text,mode,edit_image,template_output- same as the standard encoder.resolution_mode(defaultbalanced) - the weighting strategy across images:balanced,hero_first,hero_last,progressive,custom,memory_optimized.hero_weight(default 1.0) andreference_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 incustommode.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.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| textopt | * | Your prompt. Also accepts QWEN_TEMPLATE for backward compatibility. | |
| modeopt | COMBO | image_edit | text_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_outputopt | QWEN_TEMPLATE | Template from Template Builder - overrides text/system_prompt/mode when connected | |
| edit_imageopt | IMAGE | Single image or batch. For multiple images, use Image Batch node first. | |
| vaeopt | VAE | Required for image editing - encodes reference latents | |
| inpaint_maskopt | MASK | Inpainting mask for selective editing (use with inpainting mode) | |
| system_promptopt | STRING | System prompt (overridden by template_output if connected) | |
| vae_max_dimensionopt | INT | 2048512–3584 | VAE 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_modeopt | BOOLEAN | false | Show processing details in console |
| auto_labelopt | BOOLEAN | true | Automatically add labels for multiple images (e.g., 'Picture 1:') |
| verbose_logopt | BOOLEAN | false | Enable verbose console logging of model forward passes |
| resolution_modeopt | COMBO | balanced | Resolution 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_weightopt | FLOAT | 1.00.5–2 | Resolution multiplier for hero image (hero modes only) |
| reference_weightopt | FLOAT | 0.50.1–1 | Resolution multiplier for reference images |
| max_memory_mbopt | INT | 00–16384 | Max memory for images in MB (0=unlimited) |
| image_weightsopt | STRING | Comma-separated weights per image (e.g., '1.0,0.5,0.3') | |
| label_formatopt | COMBO | Picture | Label format for multi-image: 'Picture X:' (DiffSynth) or 'Image X:' (Docs) |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| conditioning | CONDITIONING | — |
| debug_output | STRING | — |