Qwen Image Batch
Feed multiple images into Qwen-Image-Edit without the headache
- image_1
- image_2
- image_3
- image_4
- image_5
- image_6
- image_7
- image_8
- image_9
- image_10
- images
- count
- info
Qwen-Image-Edit's 2509 line does multi-image editing - combine a person and a product, a person and a scene, or hold a character across a couple of references. But images from different sources come in different sizes, and just concatenating mismatched images into a batch is how you get a distorted, double-scaled mess. QwenImageBatch is the node that gathers up to ten images, sorts out their sizes for you, and hands the encoder a clean, aspect-ratio-preserving batch. Its own tagline is the selling point: "No inputcount needed!" - it auto-detects how many images you actually connected.
If you've fought with generic batch nodes where you have to declare the count up front and then wrestle with resolution mismatches, this is the quality-of-life version built specifically for the Qwen edit flow.
How it works
You plug in one to ten images. The node figures out how many are connected, picks a common size according to your alignment choice, and scales everything to match while keeping aspect ratios - so a tall portrait and a wide product shot end up in one coherent batch instead of squashed. It's aware of the double-scaling trap (where an image gets resized once here and again in the encoder), which is exactly the kind of thing that produces a subtly-zoomed-out, degraded edit if you let it happen twice.
The main decision you make is the batch_alignment: match the smallest image (safe, least VRAM), the first image (predictable, you control it by which you wire first), or the largest (best detail, most memory).
The inputs and outputs that matter
image_1(required) - your first image. Everything after is optional.image_2throughimage_10- connect as many as you need; the node counts them itself.batch_alignment(defaultmatch_smallest) - the reference size:match_smallest,match_first, ormatch_largest.vae_max_dimension(default 2048) - the ceiling for scaling, so nothing balloons past a sane size.
Outputs: images (the assembled batch - feed it to the edit_image input of QwenVLTextEncoder or the advanced encoder), count (how many it found - handy for downstream logic), and info (a string breaking down what it did to each image, including the aspect-ratio and scaling decisions).
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. No model of its own - it just wrangles images. The Qwen-Image-Edit checkpoint and Qwen2.5-VL encoder live elsewhere in the graph.
Common issues & troubleshooting
Your edit looks zoomed-out or softer than the inputs. That's the double-scaling problem - an image getting downscaled here and then again in the encoder. This node is built to prevent it, but if you've got another resize node in the chain, remove it and let the batch node own the sizing.
One image dominates the composition. Check batch_alignment. match_largest keeps detail but can let a big image steer things; match_smallest levels the field. Also mind wiring order if you use match_first.
Optimal is 1-3 images, not 10. The pack allows up to ten "because it had to pick something," but Qwen-Image-Edit itself is happiest at one to three inputs. Ten is possible; it's not where the model does its best work. Fewer, more deliberate inputs beat a crowded batch.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| image_1 | IMAGE | First image (required) | |
| image_2opt | IMAGE | Second image (optional, auto-detected) | |
| image_3opt | IMAGE | Third image (optional) | |
| image_4opt | IMAGE | Fourth image (optional - may cause VRAM issues) | |
| image_5opt | IMAGE | Fifth image (optional - may cause VRAM issues) | |
| image_6opt | IMAGE | Sixth image (optional) | |
| image_7opt | IMAGE | Seventh image (optional) | |
| image_8opt | IMAGE | Eighth image (optional) | |
| image_9opt | IMAGE | Ninth image (optional) | |
| image_10opt | IMAGE | Tenth image (optional) | |
| 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) Applied to EACH image before batching. Always preserves aspect ratio with 32px alignment. |
| batch_alignmentopt | COMBO | match_smallest | How to align multiple images with different sizes: match_smallest (VRAM Safe - Recommended): • All images scaled DOWN to smallest • Example: 2048×2048 + 1024×1024 → both 1024×1024 ✓ Lowest VRAM usage ✓ No quality loss on small images ⚠ May lose detail from large images match_first (Predictable): • All images match first image size • Example: First=1536×2048, others scaled to match ✓ Consistent output size ⚠ May upscale or downscale other images match_largest (Quality - High VRAM): • All images scaled UP to largest • Example: 1024×1024 + 2048×2048 → both 2048×2048 ⚠ WARNING: Can cause out-of-memory errors! ⚠ Upscaling small images reduces quality ✓ Preserves max detail from largest image |
| debug_modeopt | BOOLEAN | false | Show batching details in console |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| count | INT | — |
| info | STRING | — |