Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
6 tasks
TinyHaHa opened this issue Jul 10, 2024 · 8 comments
Open
6 tasks

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

TinyHaHa opened this issue Jul 10, 2024 · 8 comments
Labels
bug-report Report of a bug, yet to be confirmed

Comments

@TinyHaHa
Copy link

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?

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

@TinyHaHa TinyHaHa added the bug-report Report of a bug, yet to be confirmed label Jul 10, 2024
@w-e-w
Copy link
Collaborator

w-e-w commented Jul 10, 2024

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
Copy link
Author

  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
Copy link
Author

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: feee37d
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:

  • file D:\stable diffusion\sd.webui\webui\model.ckpt
  • directory D:\stable diffusion\sd.webui\webui\models\Stable-diffusionCan't run without a checkpoint. Find and place a .ckpt or .safetensors file into any of those locations.

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:

  • file D:\stable diffusion\sd.webui\webui\model.ckpt
  • directory D:\stable diffusion\sd.webui\webui\models\Stable-diffusionCan't run without a checkpoint. Find and place a .ckpt or .safetensors file into any of those locations.

@w-e-w
Copy link
Collaborator

w-e-w commented Jul 11, 2024

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
Copy link
Author

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
Copy link

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Report of a bug, yet to be confirmed
Projects
None yet
Development

No branches or pull requests

4 participants
@TinyHaHa @w-e-w @Cupid-ljy and others