Nodes/ComfyUI-WanVideoWrapper/WanVideo Latent ReScale
ComfyUI Node Runs on cloud

WanVideo Latent ReScale

The fix when mixing native and wrapper VAE breaks your output

By kijai·Created about a year ago·Updated 2 months ago· 6,651
WanVideo Latent ReScale
  • samples
  • samples
direction

This is a small node solving a real, specific interop problem: WanVideoWrapper's VAE and native ComfyUI's Wan VAE don't scale latents to the same numeric range. If you ever mix the two - decode with native ComfyUI's VAE Decode after sampling in WanVideoWrapper, or the reverse - the output comes out visibly wrong: washed out, blown out, or just noise-adjacent garbage, even though every individual node ran without an error. This node exists purely to convert between the two ranges so that kind of mixing actually works.

Why this matters

WanVideoWrapper is largely its own self-contained system by design - its own model loader, its own samplers, its own conditioning types - which is exactly what gives it the finer control (quantization, block-level LoRA editing, offloading) that native ComfyUI's Wan support doesn't expose. But nobody stays entirely inside one system all the time. Maybe you want to use a native ComfyUI upscale or postprocessing node on your latents before final decode. Maybe you're debugging and want to sanity-check output through the native path. The moment latents cross that boundary, the scale mismatch bites, and it bites silently - there's no error message, just output that looks broken for no obvious reason. If you've hit that exact "everything ran, but the image is wrong" wall while mixing WanVideoWrapper with native ComfyUI Wan nodes, this is very likely the fix.

The inputs and output that matter

samples (LATENT, required) - the latent you're converting. direction - an enum with exactly two options: comfy_to_wrapper and wrapper_to_comfy. Pick the one matching which way you're actually crossing the boundary - converting a latent that came out of native ComfyUI's VAE Encode so it's usable inside a WanVideoWrapper sampler, or converting a WanVideoWrapper-produced latent so native ComfyUI's VAE Decode reads it correctly.

Output is a single samples (LATENT) - the same latent, rescaled.

How to install it

Via ComfyUI Manager, search WanVideoWrapper and install, or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-WanVideoWrapper

then restart. No model download needed for this node - it's a pure math transform, nothing to load.

Common issues & troubleshooting

Picked the wrong direction. Since there are only two options and they're inverses of each other, getting it backwards produces the same kind of broken output you were trying to fix in the first place - just scaled the wrong way instead of unscaled. If output still looks wrong after adding this node, try flipping direction before assuming the node isn't working.

You don't need this node if you stay entirely inside one system. If your whole graph uses WanVideoWrapper's own VAE encode/decode nodes throughout, or entirely native ComfyUI ones, the scales never mismatch and this node has nothing to do. It's specifically for the seam between the two.

Washed-out or blown-out video after mixing pipelines is the textbook symptom this node fixes. If you're combining a WanVideoWrapper sampler with a native ComfyUI VAE Decode (or the reverse combination) and the color and brightness look wrong in a way that doesn't resemble a normal sampling artifact, that mismatch - not your sampler settings - is almost always the actual cause. Add this node at the crossing point before you start second-guessing your steps, CFG, or scheduler.

CategoryWanVideoWrapper

Inputs (2)

NameTypeDefaultDescription
samplesLATENT
directionCOMBODirection to rescale latents, from comfy to wrapper or vice versa

Outputs (1)

NameTypeDescription
samplesLATENT