Nodes/Qwen Layers Diffuser Pipeline/Eric Qwen Multi-Layer Latent
ComfyUI Node

Eric Qwen Multi-Layer Latent

The empty latent that seeds a whole stack of Qwen layers at once

By EricRollei·Created 8 months ago·Updated 8 months ago· 6
Eric Qwen Multi-Layer Latent
    • latent
    width1024
    height1024
    num_layers4
    batch_size1

    Here's the secret of how Qwen-Image-Layered actually works: it doesn't generate one image with transparent regions. It generates multiple frames at once, where each frame is a layer - plus a composite frame. That's why the model is slow (with 4 layers it's rendering 6 images worth of work) and it's also why the native workflow needs a special latent. EricQwenMultiLatent is that latent: an empty tensor shaped to hold all the layers plus the composite in one shot.

    What it creates

    You set width and height (256–2048, stepped in 64s), num_layers (2–10), and batch_size (1–4). The node returns a LATENT with shape [batch, num_layers + 1, 16, H/8, W/8] - the +1 is the composite frame that comes first, the 16 is Qwen's latent channel count, and the /8 is the VAE's 8x spatial compression. Empty, on the GPU, ready for sampling.

    That framing is exactly what the KSampler needs to start. Sample it and the model fills in all the frames together, which is the whole trick of the approach: by generating the layers jointly, the model keeps them visually consistent with each other instead of producing layers that don't reassemble into the original image.

    The pipeline it belongs to

    The native layered workflow:

    Load Image → Add Alpha → Encode → [Multi-Layer Latent] → KSampler → Latent Cut to Batch → VAE Decode → Layer Extract → Save
    

    Multi-Layer Latent hands the KSampler its starting tensor; downstream, Latent Cut to Batch flattens the frame dimension so the VAE can decode each layer, and Layer Extract turns the decoded batch into proper RGBA layers. Keep num_layers here in sync with the layer count you asked for in your prompt (see the pack's Layer Prompts node) - if the latent and the prompt disagree about how many layers exist, you get odd results.

    Caveats

    This is part of the experimental "Native" category, so expect rough edges - the pack flags it explicitly. There's no noise injected here, just zeros; the sampler handles that. And remember the empty latent is sized in latent space, so width/height are image pixels; set them to what you want the final layers to be, keeping them multiples of 64. Install via ComfyUI Manager (search "Eric Qwen") or git clone https://github.com/EricRollei/Qwen_Layers_Diffuser_Pipeline_Comfyui into custom_nodes, then restart.

    CategoryEric Qwen Layer/Native

    Inputs (4)

    NameTypeDefaultDescription
    widthINT1024256–2048
    heightINT1024256–2048
    num_layersINT42–10Number of layers to generate
    batch_sizeINT11–4

    Outputs (1)

    NameTypeDescription
    latentLATENT