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
- 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.
- Check the latent node before the KSampler. For SD 1.5 and SDXL, you need “Empty Latent Image” (4 channels), not “EmptySD3LatentImage” (16 channels).
- 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. - 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.
- ControlNet models must match the checkpoint family: SD 1.5 ControlNet only with SD 1.5 checkpoints, SDXL ControlNet only with SDXL.
- 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:
- Set up and maintain ComfyUI on Windows
Desktop or Portable, where the models belong, sharing models with other programs, safely installing custom nodes, updates, startup options … - Your First Image with ComfyUI
Install Comfy Desktop, learn the interface, and create your first AI image with FLUX.2 [small] 4B or Z-Image Turbo. - Your First AI Video with LTX in ComfyUI
Use LTX-2.3 in ComfyUI to create short videos with sound from text or an image. Template, files, settings, and license.
Terms for this
Similar errors
- ERROR: clip input is invalid: None (Checkpoint contains no text encoder)
- ERROR: Could not detect model type of: … (Model is in the wrong folder or the wrong loader)
- IPAdapter model not found / ClipVision model not found (IPAdapter files are missing or named incorrectly)
- lora key not loaded (LoRA does not match the model or the loader)
- mat1 and mat2 shapes cannot be multiplied (models don’t match)
Sources
- https://docs.comfy.org/troubleshooting/model-issues
- https://github.com/Comfy-Org/ComfyUI/issues/13833
- https://github.com/Comfy-Org/ComfyUI/blob/master/comfy_extras/nodes_sd3.py
- https://github.com/Comfy-Org/ComfyUI/blob/master/nodes.py
Checked on Oct 27, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.