Free | No tracking | Every fact with a source|German and English

Error / Models and files

expected input … to have 4 channels, but got 16 channels instead (latent or VAE does not match the model)

A latent with 16 channels (Flux/SD3) ends up in an SD 1.5 or SDXL model, which can only process latents with 4 channels.

The message

RuntimeError: Given groups=1, weight of size [320, 4, 3, 3], expected input[1, 16, 128, 128] to have 4 channels, but got 16 channels instead

Affects: ComfyUI

Why is this happening?

SD 1.5 and SDXL work with latents with 4 channels, Flux and SD3 with 16 channels. weight of size [320, 4, 3, 3] is the first layer of an SD 1.5 or SDXL model, input[1, 16, …] is the latent that actually arrives. It usually comes from the “EmptySD3LatentImage” node (always creates 16 channels) or from “VAE Encode” with a Flux VAE. A ControlNet from a different model family than the checkpoint can also trigger the error.

How to fix it

  1. Read the channel numbers in the message: 4 stands for SD 1.5/SDXL, 16 for Flux/SD3. The first number belongs to the model, the second to what arrives.
  2. Check the latent node before the KSampler. For SD 1.5 and SDXL, you need “Empty Latent Image” (4 channels), not “EmptySD3LatentImage” (16 channels).
  3. For image-to-image or inpainting: the VAE in the “VAE Encode” node must match the checkpoint. For SD 1.5/SDXL, use the VAE from the checkpoint or an SD/SDXL VAE; for Flux, use ae.safetensors.
  4. If the error only appears at “VAE Decode”, the VAE does not match the model. Replace it with the VAE for the correct model family.
  5. ControlNet models must match the checkpoint family: SD 1.5 ControlNet only with SD 1.5 checkpoints, SDXL ControlNet only with SDXL.
  6. The safest way is to start with an official template from the workflow templates and load all files from the same model family.

Better not: Do not assume that because nodes can be connected, they will work together: ComfyUI also lets you combine building blocks from different model families that do not work together.

Set up from scratch again

If it still doesn’t work after that, a fresh setup step by step often helps:

Terms for this

Similar errors

Sources

Checked on Oct 27, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.