Eric Qwen Latent Cut to Batch
The reshape that turns multi-layer latents into something the VAE can decode
- latent
- latent
Qwen-Image-Layered stores its layers as frames - five layers plus a composite means a latent shaped [batch, 6, channels, H, W], a 5D "video" latent. But ComfyUI's VAE decoders expect a plain 4D batch, [batch, channels, H, W]. Something has to bridge that gap, and EricQwenLatentCutToBatch is the bridge.
What it does
It takes the 5D latent that comes out of a KSampler and reshapes it into a flat batch: [B, F, C, H, W] → [B*F, C, H, W], so the VAE sees each layer as one item in a batch. If you somehow feed it an already-4D latent, it passes through untouched.
The skip_first toggle (default false) is where it gets interesting. In this pack's convention, frame zero is the composite - the flattened whole-image preview the model produces alongside the individual layers. If you're only interested in the actual layers, flip skip_first on and frame zero gets dropped before the reshape. The result feeds straight into a VAE decode.
Why it exists
This is the native-workflow sibling of the diffusers Decompose node. In the diffusers path, the pipeline hides all the frame bookkeeping from you. In the native path, the KSampler just gives you raw multi-frame latents and you have to do the plumbing - this node is that plumbing. It's the ComfyUI-native equivalent of the LatentCutToBatch node that showed up in the first community workflows for the model, packaged here so the whole stack stays in one pack.
The full chain, for context:
Multi-Layer Latent → KSampler → [Latent Cut to Batch] → VAE Decode → Layer Extract → Save
Set skip_first on if you plan to feed the output into the Layer Extract node (which treats each batch item as a layer) and don't want the composite counted as one. Leave it off if you want everything decoded, composite included.
Notes
It's purely a shape operation - no resampling, no quality loss, instant. And like the rest of the "Native" category it's experimental: if the sampled latent isn't actually 5D (say, you ran the KSampler on a normal latent by mistake), the node just passes it through rather than erroring, which can silently produce the wrong number of layers downstream. Worth a glance at the console when results look off. Install via ComfyUI Manager (search "Eric Qwen") or git clone https://github.com/EricRollei/Qwen_Layers_Diffuser_Pipeline_Comfyui into custom_nodes, then restart.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | — | |
| skip_firstopt | BOOLEAN | false | Skip the first frame (composite) and only output layer frames |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |