AUTOMATIC1111 / stable-diffusion-webui

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

[Bug]: Loading the stable diffusion model failed #16326

Open Crestina2001 opened 1 month ago

Crestina2001 commented 1 month ago

Checklist

What happened?

I ran into an issue when loading the stable diffusion model. It gets stuck at: CLIPTextModel_from_pretrained Seems that it returns a None.

Steps to reproduce the problem

My system is Windows + AMD CPU + Nvidia GPU

What should have happened?

In theory, it shall kick off the interface

What browsers do you use to access the UI ?

Google Chrome

Sysinfo

I cannot even load the model, so I can't open the webui.

Console logs

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\Forrest\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1030, in _bootstrap
    self._bootstrap_inner()
  File "C:\Users\Forrest\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "C:\Users\Forrest\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "D:\cache\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\initialize.py", line 149, in load_model
    shared.sd_model  # noqa: B018
  File "D:\cache\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\shared_items.py", line 175, in sd_model
    return modules.sd_models.model_data.get_sd_model()
  File "D:\cache\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 692, in get_sd_model
    load_model()
  File "D:\cache\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 819, in load_model
    sd_model = instantiate_from_config(sd_config.model, state_dict)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\cache\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 774, in instantiate_from_config
    return constructor(**params)
           ^^^^^^^^^^^^^^^^^^^^^
  File "D:\cache\stable-diffusion-webui-master\stable-diffusion-webui-master\repositories\stable-diffusion-stability-ai\ldm\models\diffusion\ddpm.py", line 563, in __init__
    self.instantiate_cond_stage(cond_stage_config)
  File "D:\cache\stable-diffusion-webui-master\stable-diffusion-webui-master\repositories\stable-diffusion-stability-ai\ldm\models\diffusion\ddpm.py", line 630, in instantiate_cond_stage
    model = instantiate_from_config(config)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\cache\stable-diffusion-webui-master\stable-diffusion-webui-master\repositories\stable-diffusion-stability-ai\ldm\util.py", line 89, in instantiate_from_config
    return get_obj_from_str(config["target"])(**config.get("params", dict()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\cache\stable-diffusion-webui-master\stable-diffusion-webui-master\repositories\stable-diffusion-stability-ai\ldm\modules\encoders\modules.py", line 104, in __init__
    self.transformer = CLIPTextModel.from_pretrained(version)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\cache\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 68, in CLIPTextModel_from_pretrained
    res = self.CLIPTextModel_from_pretrained(None, *model_args, config=pretrained_model_name_or_path, state_dict={}, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Forrest\AppData\Local\Programs\Python\Python312\Lib\site-packages\transformers\modeling_utils.py", line 3051, in from_pretrained
    resolved_config_file = cached_file(
                           ^^^^^^^^^^^^
  File "C:\Users\Forrest\AppData\Local\Programs\Python\Python312\Lib\site-packages\transformers\utils\hub.py", line 422, in cached_file
    raise EnvironmentError(
OSError: None is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'
If this is a private repository, make sure to pass a token having permission to this repo either by logging in with `huggingface-cli login` or by passing `token=<your_token>`

Failed to create model quickly; will retry using slow method.

Additional information

No response

Dennis-NT commented 1 month ago

The last message says "Failed to create model quickly; will retry using slow method." I think you can wait for 1-2 minutes to let the slow method implement. The quick method failed for me as well, but the slow method works.

Crestina2001 commented 1 month ago

The last message says "Failed to create model quickly; will retry using slow method." I think you can wait for 1-2 minutes to let the slow method implement. The quick method failed for me as well, but the slow method works.

It is not the slow implementation. The vae model successfully loaded itself, but the sd model cannot. It got stuck somewhere, but I can't figure out the problems.