Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix corrupt model initial load loop#15600

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
AUTOMATIC1111 merged 2 commits intodevfromfix-corrupt-model-loop
Jun 8, 2024
Merged

Conversation

@w-e-w
Copy link
Collaborator

@w-e-ww-e-w commentedApr 22, 2024
edited
Loading

Description

Fix corrupt model initial load loop

if for some reason the initial loading model at loading phase of webui is corrupted
after entering this state the user will not be able to load even a good model is selected, due the the unload_model_weights > send_model_to_cpu > m.lowvram attribute check will fail becaules m is None
webui will be stuck in the loop unable to recover without manual intervention

  • show LoRA on extra networks tab if sd_model failed to load

this issue can for the most part be simulated by setting the valueconfig.json > sd_model_checkpoint path of a know corrupted model

a corrupted model can be simulated by creating a new file and name it towhatever.safetensors


Testing with theis PR
I was able to change the model even the initial settings at load is pointing to a corrupted model,
and after switching to a good model, image generation seem to work properly.


other possibly related issue

Checklist:

light-and-ray, SLAPaper, Kamilake, ArtemKiyashko, and Kewth reacted with thumbs up emoji
if for some reason the initial loading model at loading phase of webui  is corruptedafter entering this state the user will not be able to load even a good model is selected, due the the unload_model_weights  > send_model_to_cpu > m.lowvram attribute check will fail becaules m is Nonewebui will be stuck in the loop unable to recover without manual intervention
@FurkanGozukara
Copy link

Yes I had this error thanks for fixing

@1637561204

This comment was marked as off-topic.

@w-e-w

This comment was marked as off-topic.

@1637561204

This comment was marked as off-topic.

@1637561204

This comment was marked as off-topic.

@w-e-w

This comment was marked as off-topic.

@1637561204

This comment was marked as off-topic.

@Zespina
Copy link

Hi, I have this error
AttributeError: 'NoneType' object has no attribute 'lowvram'
How can I fix it? where I must writing the code?
I know we change the code in cmd and webui-user.bat.
Could you please explain what can i do?

@FurkanGozukara
Copy link

Hi, I have this error AttributeError: 'NoneType' object has no attribute 'lowvram' How can I fix it? where I must writing the code? I know we change the code in cmd and webui-user.bat. Could you please explain what can i do?

I tried several times to reload and it fixed

@w-e-w
Copy link
CollaboratorAuthor

@Zespina delete the corrupted model that's causing issue

@FurkanGozukara
Copy link

@Zespina delete the corrupted model that's causing issue

No it is not corrupted model error

Happened to me as well and after trying several times fixed

There is certainly a bug

ArtemKiyashko reacted with thumbs up emoji

@xyhk0
Copy link

I also experienced the same issue. After deleting and re-downloading the new model several times, the error still persists upon startup. I noticed that in my configuration information, "sd_model_checkpoint" is set to null, which is likely the cause of the problem. However, I have not been able to find where to modify this configuration item.

@Zespina delete the corrupted model that's causing issue

No it is not corrupted model error

Happened to me as well and after trying several times fixed

There is certainly a bug

@w-e-w
Copy link
CollaboratorAuthor

I noticed that in my configuration information, "sd_model_checkpoint" is set to null, which is likely the cause of the problem

I did some test just now by manually setsd_model_checkpoint tonull and I wasn't able to replicate the issue

when the value is to null, webui will look for the first available model and loaded it
if no model can be found webui will download the defaultv1-5-pruned-emaonly.safetensors

from my testing as long as the model that webui tries to load can be loaded correctly (not corrupted) then it will able to function normally


After deleting and re-downloading the new model several times

even though attempting multiple times makes the likelihood of file corruption less likely, but it is still possible
the only practical method to make sure if the model isn't corrupted is by compare the hash

Click to see how

you can calculate the hash of your downloaded file by using tools such as Powershell

you can do so by using various tools such as powershell

open powershell and then type

Get-FileHash"C:\Path\to\the\modle.safetensors"

and press enter

>Get-FileHash"v1-5-pruned-emaonly.safetensors"Algorithm       Hash-------------SHA256          6CE0161689B3853ACAA03779EC93EAFE75A02F4CED659BEE03F50797806FA2FA

after obtaining the hash of your file compare it to what is described by the source of the model

for example the above hash is forv1-5-pruned-emaonly.safetensors you can see the hash will match the hash on hugging face
https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.safetensors
image

hash can also be found on civitai

AUTOV2 is just the fixst 10 characters of SHA256
image

note there is also the possibility of that one downloaded a file that you think is a is a valid model but not
for example you mistaken a LoRA as a SD model and put it in the dir for SD modes, webui will try and fail regardless if the model is corrupted or not

@xyhk0
Copy link

I noticed that in my configuration information, "sd_model_checkpoint" is set to null, which is likely the cause of the problem

I did some test just now by manually setsd_model_checkpoint tonull and I wasn't able to replicate the issue

when the value is to null, webui will look for the first available model and loaded it if no model can be found webui will download the defaultv1-5-pruned-emaonly.safetensors

from my testing as long as the model that webui tries to load can be loaded correctly (not corrupted) then it will able to function normally

After deleting and re-downloading the new model several times

even though attempting multiple times makes the likelihood of file corruption less likely, but it is still possible the only practical method to make sure if the model isn't corrupted is by compare the hash

Thank you very much for your advice. Yesterday, I updated the new code you submitted, and today I turned on my computer and tried to run it again. I found that there were no errors reported. Although I restarted several times yesterday, it didn't work, which was quite strange. Nevertheless, thanks to your help, your method has solved my problem. I am very grateful.

@Kouignaman13
Copy link

Description

Fix corrupt model initial load loop

if for some reason the initial loading model at loading phase of webui is corrupted after entering this state the user will not be able to load even a good model is selected, due the the unload_model_weights > send_model_to_cpu > m.lowvram attribute check will fail becaules m is None webui will be stuck in the loop unable to recover without manual intervention

  • show LoRA on extra networks tab if sd_model failed to load

this issue can for the most part be simulated by setting the valueconfig.json > sd_model_checkpoint path of a know corrupted model

a corrupted model can be simulated by creating a new file and name it towhatever.safetensors

Testing with theis PR I was able to change the model even the initial settings at load is pointing to a corrupted model, and after switching to a good model, image generation seem to work properly.

other possibly related issue

Checklist:

Dude, you're very kind to offer your help, but for some of us we're just normal people, I don't do any coding, I'm bad with computers and I don't understand well English, but for my work I need this ia to work absolutely, I've been tearing my hair out for hours trying to find solutions.

You seem to have one but you don't explain how to do it, it's extremely frustrating, where do you put your line of code? in the bat, user sh? please tell us.

@AUTOMATIC1111AUTOMATIC1111 merged commit15245d9 intodevJun 8, 2024
@AUTOMATIC1111AUTOMATIC1111 deleted the fix-corrupt-model-loop branchJune 8, 2024 07:14
@AUTOMATIC1111
Copy link
Owner

I wasn't able to reproduce the problem with being unable to switch with lowvram, but I guess if it helps people it can be added.

@FurkanGozukara
Copy link

I wasn't able to reproduce the problem with being unable to switch with lowvram, but I guess if it helps people it can be added.

this error occurs high vram machines as well. i encountered on runpod multiple times with 24 gb vram

@wdloyeu
Copy link

wdloyeu commentedJul 7, 2024
edited
Loading

oh ,no.the same my problem,how solve

@ZonghongWu
Copy link

你好,我遇到了这个错误 AttributeError: 'NoneType' 对象没有属性 'lowvram' 我该如何修复它?我必须在哪里写代码?我知道我们在 cmd 和 webui-user.bat 中更改了代码。你能解释一下我该怎么做吗?

我尝试了几次重新加载,它修复了

How can I fix it...omg...

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@AUTOMATIC1111AUTOMATIC1111AUTOMATIC1111 approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

10 participants

@w-e-w@FurkanGozukara@1637561204@Zespina@xyhk0@Kouignaman13@AUTOMATIC1111@wdloyeu@ZonghongWu

[8]ページ先頭

©2009-2025 Movatter.jp