VAE 图像批次修复 (VAE Image Batch Fix)
Stops Wan/Qwen-Image VAEs from treating your image batch as a video
- vae
- vae
This is one of the more specifically useful nodes in the whole pack, and it fixes a real, well-understood bug rather than adding a convenience feature. The node's own description is blunt about it: it patches Wan and Qwen-Image family VAEs so that when you upscale a batch of still images through them, the VAE doesn't mistake that batch for a video clip and collapse N images down into 1.
Why this bug exists at all
Wan's VAE is built for video, and video VAEs compress along the time axis as well as space - that's how Wan gets efficient long-clip generation. Qwen-Image's VAE isn't a coincidence here either: it's Wan 2.1's autoencoder with the encoder frozen and just the decoder retuned for sharper text and detail. Both VAEs, under the hood, expect their input's batch dimension to sometimes mean "frames of one video," not "N separate, unrelated images." A batch upscale workflow - encode a stack of stills, run them through a shared upscale pipeline, decode back out - hands the VAE exactly the tensor shape it'd see from a short video clip, and the VAE does what it was built to do with that shape: temporal compression, folding several frames into fewer latents. For an actual video that's correct behavior. For a batch of unrelated images, it's data loss - your batch of four images can decode back out as one.
How it works
Per the node's own description: connect it right after your VAELoader, and every downstream node in that upscale flow shares the patched VAE - you don't need to insert it more than once per pipeline. It only touches the encode/decode path; it explicitly does not affect generation itself, so sampling quality and your actual diffusion output are untouched. Think of it as a compatibility shim sitting between the loader and everything that uses the VAE afterward.
The inputs and outputs that matter
vae(required, VAE) - plug in straight from VAELoader.enable(optional, BOOLEAN, default on) - flip off to pass the VAE through unpatched, useful if you want to A/B whether the fix is actually the thing helping, or if you're feeding this VAE into a genuine video workflow downstream where the temporal behavior is correct and wanted.- Output:
vae- the patched (or, if disabled, pass-through) VAE, wired onward exactly like the original.
How to install it
ComfyUI Manager: search "ComfyUI-Danbooru-Gallery", install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/Aaalice233/ComfyUI-Danbooru-Gallery.git
cd ComfyUI-Danbooru-Gallery
pip install -r requirements.txt
Restart ComfyUI. No model downloads needed - this node wraps a VAE you're already loading, it doesn't fetch one of its own.
Common issues & troubleshooting
You're feeding it a non-Wan/non-Qwen-Image VAE. The node's fix is specific to that family's temporal-compression behavior; it's not a general-purpose VAE patch, so plugging in an SDXL or Flux VAE here isn't expected to do anything meaningful either way.
Your batch is still collapsing after adding this node. Confirm it sits between VAELoader and every consumer of that VAE in the graph - if any node downstream is pulling the VAE from a different, unpatched loader instance, the fix won't apply there. Also confirm enable is actually on.
You're running a real video workflow through this same VAE and outputs look wrong. That's the flip side of the fix - temporal compression is correct for genuine video frames. Toggle enable off, or use a separate unpatched VAE instance for your video path, and keep this one dedicated to batch-of-stills upscaling.
Node doesn't appear in the menu. Standard pack-load check: confirm the repo path, confirm dependencies installed, check the ComfyUI console at startup for an import error.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| vae | VAE | — | |
| enableopt | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| vae | VAE | — |