Z-Image Wan VAE Decode (Experimental)
The experimental Z-Image-through-Wan-VAE hack
- samples
- vae
- image
- debug_info
Let's set expectations first: the pack itself files this under "experimental, available but likely not working or deprecated." So if you landed here hoping it's a normal VAE decode you should slot into a production graph - it isn't, and the author would tell you the same. This is a tinkerer's node for one specific curiosity: what happens if you try to decode Z-Image latents with a Wan VAE instead of Z-Image's own?
Why would you even? Because Z-Image and Wan are two of the models this whole "QwenImageWanBridge" repo was born to poke at, and the author suspected they'd eventually collide. Different models use different VAEs with different scaling conventions, and just piping one's latents into the other's decoder gives you garbage without correction. This node is the correction attempt - a science experiment with knobs, not a tool with a job.
How it works
A VAE decode turns the latent the sampler produced back into pixels. The problem is that a Z-Image latent and a Wan VAE don't agree on scale and shift - the numbers live in different ranges. This node bolts a scaling-factor correction in front of the decode to bridge that mismatch (the defaults, flux_scaling_factor 0.3611 and flux_shift_factor 0.1159, are the Flux/Z-Image-side constants it's trying to map away from). Then it gives you manual scale, shift, brightness, and contrast trims to hand-tune the result, because an automated correction across two models that were never meant to share a VAE is never going to land perfectly.
Realistically: this is you turning dials until the image stops looking like TV static. Sometimes instructive, rarely production-ready.
The inputs and outputs that matter
samples(required,LATENT) - the Z-Image latents you're trying to decode.vae(required,VAE) - a Wan VAE, loaded through a standard VAE loader. That cross-VAE feed is the entire point of the node.apply_scaling_correction(default on) - the automatic bridge. Turn it off to see the raw mismatch, which is a good way to understand what the correction is doing.scale_correction,shift_correction,brightness,contrast- your manual trims when the automatic pass is close but off.
Outputs: image (the decoded pixels, such as they are) and debug_info (a string describing the scaling math it applied - the most useful output here, honestly, because it tells you what the correction actually did).
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. You'll need a Wan VAE on disk to feed the vae input, plus whatever produced your Z-Image latents.
Common issues & troubleshooting
The output looks wrong / washed out / wildly off-color. Expected. Start with apply_scaling_correction on, then nudge scale_correction and shift_correction first, brightness/contrast last. Read debug_info to see where you are.
It just doesn't work. Also expected - the pack labels this experimental and possibly deprecated. If you need to actually see your Z-Image output, use Z-Image's own VAE with the standard decode. This node is for understanding the VAE mismatch, not for shipping images.
You wanted a real Z-Image → Wan pipeline. As of this pack, that bridge is aspirational. Z-Image is an image model and Wan is video; they don't share a latent space, and this node is the author's honest "here's how far I got poking at it." Treat it as a lab bench, not a product.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| samples | LATENT | — | |
| vae | VAE | — | |
| apply_scaling_correctionopt | BOOLEAN | true | — |
| flux_scaling_factoropt | FLOAT | 0.36110.01–2 | Flux VAE scaling factor (default: 0.3611) |
| flux_shift_factoropt | FLOAT | 0.1159-1–1 | Flux VAE shift factor (default: 0.1159) |
| scale_correctionopt | FLOAT | 1.000.1–5 | Additional scale multiplier for manual tuning |
| shift_correctionopt | FLOAT | 0.00-2–2 | Additional shift offset for manual tuning |
| brightnessopt | FLOAT | 1.000–3 | Post-decode brightness adjustment |
| contrastopt | FLOAT | 1.000–3 | Post-decode contrast adjustment |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| debug_info | STRING | — |