Nodes/Qwen Layers Diffuser Pipeline/Eric Qwen RGBA VAE Loader
ComfyUI Node

Eric Qwen RGBA VAE Loader

ComfyUI's normal VAE loader chokes on 4 channels — this one doesn't

By EricRollei·Created 8 months ago·Updated 8 months ago· 6
Eric Qwen RGBA VAE Loader
    • vae
    vae_name

    Standard ComfyUI VAEs encode and decode 3-channel RGB - that's baked into their assumptions. Qwen-Image-Layered's VAE is different: it moves 4 channels (RGBA), because it needs to carry transparency through the latent space so layers stay layered. Plug that into a stock VAE loader and you get a shape mismatch headache. EricQwenRGBAVAELoader is the pack's answer: a loader built specifically for the Qwen layered VAE's 4-channel architecture.

    How it works

    The vae_name dropdown lists every .safetensors, .pt, .pth, or .ckpt file it finds in your ComfyUI/models/vae folder (it shows "none" if the folder's empty). Pick the Qwen RGBA VAE file and the node loads its state dict, inspects the weights to detect the actual input/output channel counts (defaulting to 4/4), and wraps the model in a VAE-compatible class.

    That wrapper is the real substance of the node. It's built on ComfyUI's own Wan VAE encoder/decoder architecture (comfy.ldm.wan.vae) modified for configurable channels, and it handles the RGBA specifics: the 16-channel latent, the 8x spatial compression, and the frame/batch dimension juggling that a 4-channel video-style VAE demands. Encode and decode both go through it, and it returns a proper VAE that the pack's Encode node and standard VAE Decode nodes can consume.

    Why you need it

    The native layered workflow lives and dies by this VAE. To sample layers you need to encode a 4-channel reference image (via the pack's Add Alpha node) and later decode the multi-frame latent back into RGBA layers (via the pack's Layer Extract). The stock VAELoader can't represent a 4-channel VAE correctly, so the whole native branch depends on this node being in the graph. In the diffusers Decompose workflow you never touch it - the pipeline loads its own VAE internally.

    Setup notes

    You have to supply the VAE file yourself. Grab it from the Qwen-Image-Layered release assets (the Comfy-Org conversion of the model includes the RGBA VAE), drop it into ComfyUI/models/vae/, restart, and it appears in the dropdown. The 4-channel detection is automatic from the weights, so you shouldn't need to tell it anything. If you're building the native workflow and the decode comes back with garbage channels or a rank mismatch, the usual culprit is a VAE that isn't the Qwen RGBA one - check what's actually in models/vae.

    Install the pack via ComfyUI Manager (search "Eric Qwen") or git clone https://github.com/EricRollei/Qwen_Layers_Diffuser_Pipeline_Comfyui into custom_nodes, then restart. Note this whole native branch is experimental - solid enough to build on, but the diffusers path is the pack's stable workflow.

    CategoryEric Qwen Layer/Loaders

    Inputs (1)

    NameTypeDefaultDescription
    vae_nameCOMBO1 options: none

    Outputs (1)

    NameTypeDescription
    vaeVAE