AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
135.55k stars 25.88k forks source link

[Bug]: sd_xl_base_1.0.safetensors load errored #12161

Open luoweb opened 11 months ago

luoweb commented 11 months ago

Is there an existing issue for this?

What happened?

[Bug]: sd_xl_base_1.0.safetensors load errored

Steps to reproduce the problem

  1. input prompt
  2. generate button

What should have happened?

error

Version or Commit where the problem happens

1.5.1

What Python version are you running on ?

None

What platforms do you use to access the UI ?

No response

What device are you running WebUI on?

No response

Cross attention optimization

Automatic

What browsers do you use to access the UI ?

No response

Command Line Arguments

--api

List of extensions

none

Console logs

Traceback (most recent call last): File "/stable-diffusion-webui/modules/shared.py";, line 593, in set self.data_labels[key].onchange() File "/stable-diffusion-webui/modules/call_queue.py";, line 15, in f res = func(*args, **kwargs) File "/stable-diffusion-webui/webui.py";, line 225, in <lambda> shared.opts.onchange("sd_model_checkpoint", wrap_queued_call(lambda: modules.sd_models.reload_model_weights()), call=False) File "/stable-diffusion-webui/modules/sd_models.py"">sd_models.py"">sd_models.py";, line 547, in reload_model_weights load_model(checkpoint_info, already_loaded_state_dict=state_dict) File "/stable-diffusion-webui/modules/sd_models.py", line 486, in load_model load_model_weights(sd_model, checkpoint_info, state_dict, timer) File "/stable-diffusion-webui/modules/sd_models.py", line 286, in load_model_weights model.load_state_dict(state_dict, strict=False) File "/usr/local/lib/python3.10/site-packages/torch/nn/modules/module.py";, line 2041, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for LatentDiffusion: size mismatch for model.diffusion_model.input_blocks.4.1.proj_in.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([640, 640, 1, 1]). size mismatch for model.diffusion_model.input_blocks.4.1.transformer_blocks.0.attn2.to_k.weight: copying a param with shape torch.Size([640, 2048]) from checkpoint, the shape in current model is torch.Size([640, 768]). size mismatch for model.diffusion_model.input_blocks.4.1.transformer_blocks.0.attn2.to_v.weight: copying a param with shape torch.Size([640, 2048]) from checkpoint, the shape in current model is torch.Size([640, 768]).

Additional information

No response

mashb1t commented 11 months ago

@luoweb i had the same error, see https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/559#issue-1824711264

The solution was to update A1111 to the latest version. Please double check if you're really using 1.5.1 and your webui also shows this version in the footer. Keep in mind that for Docker setups you'll have to rebuild the image. Hope that helps!

finalcolor commented 10 months ago

sd_xl_base_1.0.safetensors load errored ,me too, SD 1.5.1