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

Error / Models and files

ControlNet: Error(s) in loading state_dict … size mismatch (ControlNet does not match the base model)

The ControlNet model was built for a different model family than your checkpoint, so the weights do not match.

The message

RuntimeError: Error(s) in loading state_dict for ControlNet: size mismatch for input_blocks.1.1.proj_in.weight: copying a param with shape torch.Size([320, 320]) from checkpoint, the shape in current model is torch.Size([320, 320, 1, 1]).  |  RuntimeError: mat1 and mat2 shapes cannot be multiplied (154x1024 and 768x320)

Affects: AUTOMATIC1111 Stable Diffusion WebUI, ComfyUI

Why is this happening?

A ControlNet is always trained for a specific model family, such as SD 1.5, SD 2.x, SDXL, or Flux. The layers in these families have different sizes. If you combine an SD-1.5 ControlNet with an SD-2.1 or SDXL checkpoint, loading fails with “size mismatch” or the computation fails with “mat1 and mat2 shapes cannot be multiplied”. This is not a program error, but a wrong combination.

How to fix it

  1. Check which base model your checkpoint was made for (download page, e.g. “SD 1.5”, “SDXL”, “Flux”).
  2. Check the same thing for the ControlNet. It is often in the file name, e.g. control_v11p_sd15_… for SD 1.5 or …sdxl… for SDXL.
  3. Replace either the ControlNet or the checkpoint until both belong to the same family: SD-1.5 checkpoint with SD-1.5 ControlNet, SDXL with SDXL. For SD 2.1, you need your own SD-2.1 ControlNets.
  4. AUTOMATIC1111 with the sd-webui-controlnet extension: Put ControlNet models in stable-diffusion-webui\models\ControlNet or extensions\sd-webui-controlnet\models. SDXL ControlNets require sd-webui-controlnet version 1.1.400 or later and WebUI version 1.6.0 or later.
  5. ComfyUI: ControlNet models belong in ComfyUI\models\controlnet. In the “Load ControlNet Model” node, choose a file that matches the checkpoint family.
  6. The safest approach is to start with a template for your exact model family and load all files from the same source.

Better not: A different YAML configuration or a reinstall will not help here: only a matching ControlNet model fixes the error.

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.