Nodes/ComfyUI-gen2/Gen2 Load QwenImage VAE (outdated)
ComfyUI Node

Gen2 Load QwenImage VAE (outdated)

The VAE that speaks VideoX's dialect

By petmycat·Created 7 months ago·Updated 12 days ago· 23
Gen2 Load QwenImage VAE (outdated)
    • vae
    model_nameqwen_image_vae.safetensors
    precisionbf16

    Qwen-Image's VAE isn't a plain "load a checkpoint" affair if you're trying to reproduce VideoX-Fun's QwenImage ControlNet pipeline. That pipeline expects a specific VAE configuration - the latent normalization means and standard deviations, the 16-channel latent layout, the scale factors - and ComfyUI's stock VAE loader doesn't hand you those. This node loads the QwenImage VAE with exactly the VideoX-compatible config the rest of the (outdated) QwenImage section needs. Its output is a GEN2_VAE object, not a standard ComfyUI VAE, so it only wires into this pack's Apply and Sampler nodes.

    Inputs

    • model_name - an enum of VAEs from your ComfyUI vae folder, default qwen_image_vae.safetensors. The QwenImage VAE weights.
    • precision - bf16 (default) or fp16.

    Output: vae (GEN2_VAE).

    What it does under the hood

    It imports VideoX-Fun's AutoencoderKLQwenImage class, loads the state dict from your vae folder, and constructs it with the fixed QWEN_VAE_CONFIG used throughout the pipeline. Two details that matter in practice:

    • It detects the Wan-compiled VAE format (a conv1.weight key pattern) and handles both the compiled and standard layouts, falling back to the plain QwenImage VAE class if the compiled import isn't available.
    • The VAE is offloaded to the unet offload device and cast to your chosen precision, and it's used at encode time to build the 132-feature control context in the Apply node - the latents get normalized with the config's latents_mean/latents_std before being packed into the control sequence. Get this wrong (i.e. use a stock VAE) and the control context will be off, which is exactly the kind of silent quality loss that's hard to debug.

    Installation

    The whole QwenImage section has real dependencies, and this node is no exception. From the README you need:

    • VideoX-Fun as a custom node (custom_nodes/videox-fun) - the code imports videox_fun.models.qwenimage_vae and raises a clear error if it can't find it,
    • diffusers and transformers in your environment,
    • optionally ComfyUI-GGUF for GGUF models.

    Install the pack via ComfyUI Manager (search "ComfyUI-gen2") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/petmycat/ComfyUI-gen2
    cd ComfyUI-gen2
    pip install -r requirements.txt
    

    Missing VideoX-Fun → [Gen2] QwenImage nodes not available at startup; the rest of the pack still loads.

    Common issues

    • "Cannot import AutoencoderKLQwenImage from videox_fun." VideoX-Fun isn't where the pack expects it. It must be installed as custom_nodes/videox-fun (the import error message even tells you the exact path it checked).
    • No QwenImage VAE in the dropdown. Drop qwen_image_vae.safetensors (or your QwenImage VAE) into ComfyUI/models/vae and restart.
    • The node is on the list but the section won't load. This is the outdated pipeline; if you don't specifically need VideoX-compatible output, native ComfyUI Qwen-Image workflows don't need this VAE loader at all.

    Honest take: use this node only inside the Gen2 QwenImage pipeline it was built for. Its GEN2_VAE output is deliberately incompatible with the rest of ComfyUI, and that's the point - it's carrying VideoX configuration that a generic VAE wire wouldn't.

    CategoryGen2/QwenImage

    Inputs (2)

    NameTypeDefaultDescription
    model_nameCOMBOqwen_image_vae.safetensors0 options:
    precisionCOMBObf162 options: bf16, fp16

    Outputs (1)

    NameTypeDescription
    vaeGEN2_VAE