stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

changing setting sd_model_checkpoint to SD3\sd3_medium.safetensors [cc236278d2]: RuntimeError

Open kkget opened this issue 6 months ago • 10 comments

Checklist

  • [ ] The issue exists after disabling all extensions
  • [ ] The issue exists on a clean installation of webui
  • [ ] The issue is caused by an extension, but I believe it is caused by a bug in the webui
  • [ ] The issue exists in the current version of the webui
  • [ ] The issue has not been reported before recently
  • [ ] The issue has been reported before but has not been fixed yet

What happened?

E:\sd-webui-aki\sd-webui-aki-v4\configs\sd3-inference.yaml Loading VAE weights specified in settings: E:\sd-webui-aki\sd-webui-aki-v4\models\VAE\sdxl_vae.safetensors changing setting sd_model_checkpoint to SD3\sd3_medium.safetensors [cc236278d2]: RuntimeError Traceback (most recent call last): File "E:\sd-webui-aki\sd-webui-aki-v4\modules\options.py", line 165, in set option.onchange() File "E:\sd-webui-aki\sd-webui-aki-v4\modules\call_queue.py", line 14, in f res = func(*args, **kwargs) File "E:\sd-webui-aki\sd-webui-aki-v4\modules\initialize_util.py", line 181, in shared.opts.onchange("sd_model_checkpoint", wrap_queued_call(lambda: sd_models.reload_model_weights()), call=False) File "E:\sd-webui-aki\sd-webui-aki-v4\modules\sd_models.py", line 977, in reload_model_weights load_model(checkpoint_info, already_loaded_state_dict=state_dict) File "E:\sd-webui-aki\sd-webui-aki-v4\modules\sd_models.py", line 845, in load_model load_model_weights(sd_model, checkpoint_info, state_dict, timer) File "E:\sd-webui-aki\sd-webui-aki-v4\modules\sd_models.py", line 538, in load_model_weights sd_vae.load_vae(model, vae_file, vae_source) File "E:\sd-webui-aki\sd-webui-aki-v4\modules\sd_vae.py", line 212, in load_vae _load_vae_dict(model, vae_dict_1) File "E:\sd-webui-aki\sd-webui-aki-v4\modules\sd_vae.py", line 239, in _load_vae_dict model.first_stage_model.load_state_dict(vae_dict_1) File "E:\sd-webui-aki\sd-webui-aki-v4\modules\sd_disable_initialization.py", line 223, in module_load_state_dict = self.replace(torch.nn.Module, 'load_state_dict', lambda *args, **kwargs: load_state_dict(module_load_state_dict, *args, **kwargs)) File "E:\sd-webui-aki\sd-webui-aki-v4\modules\sd_disable_initialization.py", line 221, in load_state_dict original(module, state_dict, strict=strict) File "E:\sd-webui-aki\sd-webui-aki-v4\py310\lib\site-packages\torch\nn\modules\module.py", line 2152, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for SDVAE: Unexpected key(s) in state_dict: "post_quant_conv.bias", "post_quant_conv.weight", "quant_conv.bias", "quant_conv.weight". size mismatch for encoder.conv_out.weight: copying a param with shape torch.Size([8, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([32, 512, 3, 3]). size mismatch for encoder.conv_out.bias: copying a param with shape torch.Size([8]) from checkpoint, the shape in current model is torch.Size([32]). size mismatch for decoder.conv_in.weight: copying a param with shape torch.Size([512, 4, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 16, 3, 3]).

Steps to reproduce the problem

start webui -->Switching Models to SD3

What should have happened?

start webui

What browsers do you use to access the UI ?

No response

Sysinfo

win11 py3.10

Console logs

E:\sd-webui-aki\sd-webui-aki-v4\configs\sd3-inference.yaml
Loading VAE weights specified in settings: E:\sd-webui-aki\sd-webui-aki-v4\models\VAE\sdxl_vae.safetensors
changing setting sd_model_checkpoint to SD3\sd3_medium.safetensors [cc236278d2]: RuntimeError
Traceback (most recent call last):
  File "E:\sd-webui-aki\sd-webui-aki-v4\modules\options.py", line 165, in set
    option.onchange()
  File "E:\sd-webui-aki\sd-webui-aki-v4\modules\call_queue.py", line 14, in f
    res = func(*args, **kwargs)
  File "E:\sd-webui-aki\sd-webui-aki-v4\modules\initialize_util.py", line 181, in <lambda>
    shared.opts.onchange("sd_model_checkpoint", wrap_queued_call(lambda: sd_models.reload_model_weights()), call=False)
  File "E:\sd-webui-aki\sd-webui-aki-v4\modules\sd_models.py", line 977, in reload_model_weights
    load_model(checkpoint_info, already_loaded_state_dict=state_dict)
  File "E:\sd-webui-aki\sd-webui-aki-v4\modules\sd_models.py", line 845, in load_model
    load_model_weights(sd_model, checkpoint_info, state_dict, timer)
  File "E:\sd-webui-aki\sd-webui-aki-v4\modules\sd_models.py", line 538, in load_model_weights
    sd_vae.load_vae(model, vae_file, vae_source)
  File "E:\sd-webui-aki\sd-webui-aki-v4\modules\sd_vae.py", line 212, in load_vae
    _load_vae_dict(model, vae_dict_1)
  File "E:\sd-webui-aki\sd-webui-aki-v4\modules\sd_vae.py", line 239, in _load_vae_dict
    model.first_stage_model.load_state_dict(vae_dict_1)
  File "E:\sd-webui-aki\sd-webui-aki-v4\modules\sd_disable_initialization.py", line 223, in <lambda>
    module_load_state_dict = self.replace(torch.nn.Module, 'load_state_dict', lambda *args, **kwargs: load_state_dict(module_load_state_dict, *args, **kwargs))
  File "E:\sd-webui-aki\sd-webui-aki-v4\modules\sd_disable_initialization.py", line 221, in load_state_dict
    original(module, state_dict, strict=strict)
  File "E:\sd-webui-aki\sd-webui-aki-v4\py310\lib\site-packages\torch\nn\modules\module.py", line 2152, in load_state_dict
    raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for SDVAE:
        Unexpected key(s) in state_dict: "post_quant_conv.bias", "post_quant_conv.weight", "quant_conv.bias", "quant_conv.weight".
        size mismatch for encoder.conv_out.weight: copying a param with shape torch.Size([8, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([32, 512, 3, 3]).
        size mismatch for encoder.conv_out.bias: copying a param with shape torch.Size([8]) from checkpoint, the shape in current model is torch.Size([32]).
        size mismatch for decoder.conv_in.weight: copying a param with shape torch.Size([512, 4, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 16, 3, 3]).

Additional information

No response

kkget avatar Jul 28 '24 08:07 kkget