AUTOMATIC1111 / stable-diffusion-webui

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

[Bug]: AttributeError: 'NoneType' object has no attribute 'lowvram' #16184

Open TinyHaHa opened 2 months ago

TinyHaHa commented 2 months ago

Checklist

What happened?

Stable diffusion model failed to load Error completing request Arguments: ('task(1n1p6g2zqlg16g3)', <gradio.routes.Request object at 0x000001F98F696AA0>, 'trees', '', [], 1, 1, 7, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, 'Use same checkpoint', 'Use same sampler', 'Use same scheduler', '', '', [], 0, 20, 'DPM++ 2M', 'Automatic', False, '', 0.8, -1, False, -1, 0, 0, 0, False, False, 'positive', 'comma', 0, False, False, 'start', '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, False, False, False, 0, False) {} Traceback (most recent call last): File "D:\stable diffusion\webui\modules\call_queue.py", line 57, in f res = list(func(*args, *kwargs)) File "D:\stable diffusion\webui\modules\call_queue.py", line 36, in f res = func(args, **kwargs) File "D:\stable diffusion\webui\modules\txt2img.py", line 109, in txt2img processed = processing.process_images(p) File "D:\stable diffusion\webui\modules\processing.py", line 832, in process_images sd_models.reload_model_weights() File "D:\stable diffusion\webui\modules\sd_models.py", line 860, in reload_model_weights sd_model = reuse_model_from_already_loaded(sd_model, checkpoint_info, timer) File "D:\stable diffusion\webui\modules\sd_models.py", line 793, in reuse_model_from_already_loaded send_model_to_cpu(sd_model) File "D:\stable diffusion\webui\modules\sd_models.py", line 662, in send_model_to_cpu if m.lowvram: AttributeError: 'NoneType' object has no attribute 'lowvram'

Steps to reproduce the problem

I run the run.bat, the text showcased "Stable diffusion model failed to load" , "AttributeError: 'NoneType' object has no attribute 'lowvram'"

What should have happened?

i am a rookie, i think it will run but not this error.

What browsers do you use to access the UI ?

No response

Sysinfo

Stable diffusion model failed to load Error completing request Arguments: ('task(1n1p6g2zqlg16g3)', <gradio.routes.Request object at 0x000001F98F696AA0>, 'trees', '', [], 1, 1, 7, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, 'Use same checkpoint', 'Use same sampler', 'Use same scheduler', '', '', [], 0, 20, 'DPM++ 2M', 'Automatic', False, '', 0.8, -1, False, -1, 0, 0, 0, False, False, 'positive', 'comma', 0, False, False, 'start', '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, False, False, False, 0, False) {} Traceback (most recent call last): File "D:\stable diffusion\webui\modules\call_queue.py", line 57, in f res = list(func(*args, *kwargs)) File "D:\stable diffusion\webui\modules\call_queue.py", line 36, in f res = func(args, **kwargs) File "D:\stable diffusion\webui\modules\txt2img.py", line 109, in txt2img processed = processing.process_images(p) File "D:\stable diffusion\webui\modules\processing.py", line 832, in process_images sd_models.reload_model_weights() File "D:\stable diffusion\webui\modules\sd_models.py", line 860, in reload_model_weights sd_model = reuse_model_from_already_loaded(sd_model, checkpoint_info, timer) File "D:\stable diffusion\webui\modules\sd_models.py", line 793, in reuse_model_from_already_loaded send_model_to_cpu(sd_model) File "D:\stable diffusion\webui\modules\sd_models.py", line 662, in send_model_to_cpu if m.lowvram: AttributeError: 'NoneType' object has no attribute 'lowvram'

Console logs

Stable diffusion model failed to load
*** Error completing request
*** Arguments: ('task(1n1p6g2zqlg16g3)', <gradio.routes.Request object at 0x000001F98F696AA0>, 'trees', '', [], 1, 1, 7, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, 'Use same checkpoint', 'Use same sampler', 'Use same scheduler', '', '', [], 0, 20, 'DPM++ 2M', 'Automatic', False, '', 0.8, -1, False, -1, 0, 0, 0, False, False, 'positive', 'comma', 0, False, False, 'start', '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, False, False, False, 0, False) {}
    Traceback (most recent call last):
      File "D:\stable diffusion\webui\modules\call_queue.py", line 57, in f
        res = list(func(*args, **kwargs))
      File "D:\stable diffusion\webui\modules\call_queue.py", line 36, in f
        res = func(*args, **kwargs)
      File "D:\stable diffusion\webui\modules\txt2img.py", line 109, in txt2img
        processed = processing.process_images(p)
      File "D:\stable diffusion\webui\modules\processing.py", line 832, in process_images
        sd_models.reload_model_weights()
      File "D:\stable diffusion\webui\modules\sd_models.py", line 860, in reload_model_weights
        sd_model = reuse_model_from_already_loaded(sd_model, checkpoint_info, timer)
      File "D:\stable diffusion\webui\modules\sd_models.py", line 793, in reuse_model_from_already_loaded
        send_model_to_cpu(sd_model)
      File "D:\stable diffusion\webui\modules\sd_models.py", line 662, in send_model_to_cpu
        if m.lowvram:
    AttributeError: 'NoneType' object has no attribute 'lowvram'

Additional information

No response

w-e-w commented 2 months ago

assuming that you're not using Dev or RCbranch

based on this message Stable diffusion model failed to load

as you do not post the entire logs so I can't be sure but essentially what most likely happen is that your model is corrupted during download and so the model failed to load

they're existing issue that if the model that the WebUI tryies to load on startup is corrupted then the UI would fall into a loop of not able to load or switch any other models this issue has been fixed

also in the next release of web UI when it also downloads a model it will check for its integrity


what you have to do you should delete the corrupt model

after deletion you an relaunch the UI if theres is no model present webui automatically downloads the default sd1.5 model for you you could also download a model you actually want to use manually and place it in the directory, this way it dosen't waste time downloading a model that you probably won't use

downloading a model manually is especially recommended if you have bad internet

TinyHaHa commented 2 months ago
  1. i download the following assets: image

  2. as the guideline i tried again: (1)Download sd.webui.zip from v1.0.0-pre and extract its contents. (2)Run update.bat. (3)Run run.bat.

3.with all the steps above:

error: RPC failed; curl 56 Recv failure: Connection was reset fatal: early EOF fatal: fetch-pack: invalid index-pack output Traceback (most recent call last): File "D:\stable diffusion\sd.webui\webui\launch.py", line 48, in main() File "D:\stable diffusion\sd.webui\webui\launch.py", line 39, in main prepare_environment() File "D:\stable diffusion\sd.webui\webui\modules\launch_utils.py", line 411, in prepare_environment git_clone(stable_diffusion_repo, repo_dir('stable-diffusion-stability-ai'), "Stable Diffusion", stable_diffusion_commit_hash) File "D:\stable diffusion\sd.webui\webui\modules\launch_utils.py", line 191, in git_clone run(f'"{git}" clone --config core.filemode=false "{url}" "{dir}"', f"Cloning {name} into {dir}...", f"Couldn't clone {name}", live=True) File "D:\stable diffusion\sd.webui\webui\modules\launch_utils.py", line 115, in run raise RuntimeError("\n".join(error_bits)) RuntimeError: Couldn't clone Stable Diffusion. Command: "git" clone --config core.filemode=false "https://github.com/Stability-AI/stablediffusion.git" "D:\stable diffusion\sd.webui\webui\repositories\stable-diffusion-stability-ai" Error code: 128

TinyHaHa commented 2 months ago

finally, the last question i cannot solve:

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] Version: v1.9.4 Commit hash: feee37d75f1b168768014e4634dcb156ee649c05 Installing requirements Launching Web UI with arguments: no module 'xformers'. Processing without... no module 'xformers'. Processing without... No module 'xformers'. Proceeding without it. Downloading: "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors" to D:\stable diffusion\sd.webui\webui\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors

loading stable diffusion model: FileNotFoundError Traceback (most recent call last): File "threading.py", line 973, in _bootstrap File "threading.py", line 1016, in _bootstrap_inner File "threading.py", line 953, in run File "D:\stable diffusion\sd.webui\webui\modules\initialize.py", line 149, in load_model shared.sd_model # noqa: B018 File "D:\stable diffusion\sd.webui\webui\modules\shared_items.py", line 175, in sd_model return modules.sd_models.model_data.get_sd_model() File "D:\stable diffusion\sd.webui\webui\modules\sd_models.py", line 620, in get_sd_model load_model() File "D:\stable diffusion\sd.webui\webui\modules\sd_models.py", line 691, in load_model checkpoint_info = checkpoint_info or select_checkpoint() File "D:\stable diffusion\sd.webui\webui\modules\sd_models.py", line 224, in select_checkpoint raise FileNotFoundError(error_message) FileNotFoundError: No checkpoints found. When searching for checkpoints, looked at:

Stable diffusion model failed to load Applying attention optimization: Doggettx... done. Running on local URL: http://127.0.0.1:7860

To create a public link, set share=True in launch(). Startup time: 112.8s (prepare environment: 82.9s, import torch: 3.3s, import gradio: 1.5s, setup paths: 1.8s, initialize shared: 0.2s, other imports: 1.1s, list SD models: 21.1s, load scripts: 0.5s, create ui: 0.2s, gradio launch: 0.2s). loading stable diffusion model: FileNotFoundError Traceback (most recent call last): File "threading.py", line 973, in _bootstrap File "threading.py", line 1016, in _bootstrap_inner File "D:\stable diffusion\sd.webui\system\python\lib\site-packages\anyio_backends_asyncio.py", line 807, in run result = context.run(func, args) File "D:\stable diffusion\sd.webui\system\python\lib\site-packages\gradio\utils.py", line 707, in wrapper response = f(args, **kwargs) File "D:\stable diffusion\sd.webui\webui\modules\ui.py", line 1154, in update_image_cfg_scale_visibility = lambda: gr.update(visible=shared.sd_model and shared.sd_model.cond_stage_key == "edit") File "D:\stable diffusion\sd.webui\webui\modules\shared_items.py", line 175, in sd_model return modules.sd_models.model_data.get_sd_model() File "D:\stable diffusion\sd.webui\webui\modules\sd_models.py", line 620, in get_sd_model load_model() File "D:\stable diffusion\sd.webui\webui\modules\sd_models.py", line 691, in load_model checkpoint_info = checkpoint_info or select_checkpoint() File "D:\stable diffusion\sd.webui\webui\modules\sd_models.py", line 224, in select_checkpoint raise FileNotFoundError(error_message) FileNotFoundError: No checkpoints found. When searching for checkpoints, looked at:

w-e-w commented 2 months ago

I'm suspecting auto download always fails on your internet like I mentioned above

downloading a model manually is especially recommended if you have bad internet

you can download the default 1.5 modul using the link below webpage https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.safetensors direct download link https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors

or you could find a model (checkpoint) you like on sites like https://civitai.com

TinyHaHa commented 2 months ago

thanks, i have download the module from the direct donwload link, would you please tell me how to do the next? is that i should use the new file to cover or insert into any file? Or i should run the new download file directly?

Cupid-ljy commented 2 months ago

It is possible that the model is damaged. Extract the model and reload it. But I don’t know how to check which model has a problem.

TinyHaHa commented 2 months ago

I'm suspecting auto download always fails on your internet like I mentioned above

downloading a model manually is especially recommended if you have bad internet

you can download the default 1.5 modul using the link below webpage https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.safetensors direct download link https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors

or you could find a model (checkpoint) you like on sites like https://civitai.com

excuse me sir,would you please tell me how to do the next? i hve downloaded the module from your link