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

FIX CRITICAL SD 2.1 ERROR #5506

Closed
wants to merge 2 commits into from

Conversation

miguelgargallo
Copy link

@miguelgargallo
Copy link
Author

Download Stable diffusion 2.0 files

After installation, you will need to download two files to use Stable Diffusion 2.0.

Download the model file ([768-v-ema.ckpt](https://huggingface.co/stabilityai/stable-diffusion-2/resolve/main/768-v-ema.ckpt))

Download the [config file](https://raw.githubusercontent.com/Stability-AI/stablediffusion/main/configs/stable-diffusion/v2-inference-v.yaml), rename it to 768-v-ema.yaml

Put both of them in the model directory:

stable-diffusion-webui/models/Stable-diffusion

Source: https://stable-diffusion-art.com/how-to-run-stable-diffusion-2-0/

image

It will began to download

My folder content

image

SOLUTION CONFIRMED

image

Now I need to deal with the black images...
image

You just need to add --no-half to the file
image

done!
image

Added the file for the crucial FIX
@AnonymousCervine
Copy link

AnonymousCervine commented Dec 7, 2022

Casually dropping a "--no-half" on everyone like that seems rather irresponsible. This may be fine for those who can soldier on at full-precision, but...

(And even if one were switching to that as the default, this would be the wrong way. It's a command-line switch for a reason; one does not simply hardcode user options in the launch BAT, unless one is the end-user I suppose. Also applying only to the BAT and not the .sh would only help users on Windows. Basically: The "solution" in that reddit fix is a quick convenience hack for users on Windows who want to use 2.1 ASAP; it's not an appropriate approach for everyone.)

@nousr
Copy link

nousr commented Dec 7, 2022

we can export the ATNN_PRECISION environment variable to enable half-precision for 2.1, check the commits in the stablediffusion repo for more info

@miguelgargallo
Copy link
Author

@nousr has a great constructive answer, so, @AnonymousCervine relax please,this is a temporal fix to let new enthusiast try 2.1 solves the problem and its well documented, lets see, I am in good faith to help the community, so, you just talk one day and got a contributor, let devs and engineers PR the project and see what happen, keep calm bro

@drax-xard
Copy link

drax-xard commented Dec 7, 2022

The user.bat/.sh is for the user to configure, AFAIU. Having a random commit add/change commands to a user defined config file feels off. A disclaimer on the readme or just a post on reddit/discord informing users of this quickfix seems enough imo.

@Orthestral
Copy link

This forces everyone on full precision, no matter if they do or don't wanna use the bleeding edge 2.1 before a more proper fix is put into place.

@rubenlg
Copy link

rubenlg commented Dec 8, 2022

@miguelgargallo I'm also excited about 2.1, but if the cost is VRAM, I'd rather stick to 2.0 until a different fix is found. My GPU doesn't have a ton of VRAM, and I'm sure many people are on the same boat.

If the PR is forcing --no-half on everyone (as opposed to just those running 2.1), I'd argue it's not fixing the problem, but rather trading a problem for another. And in my opinion, the problem you are creating (breaking existing users with low VRAM) is more severe than the problem you are solving (helping people trying the new model).

@ashgray0
Copy link

ashgray0 commented Dec 8, 2022

What would be the equivalent fix for webui-user.sh?

@drax-xard
Copy link

drax-xard commented Dec 8, 2022 via email

@clockworkwhale
Copy link

Also, just using xformers fixes it apparently

This is correct, the being-forced-to-full-precision thing can be avoided entirely simply by enabling xformers.

@DrakenZA
Copy link

DrakenZA commented Dec 8, 2022

Could we please get some basic testing going before pushing PRs that end up breaking everything for most users.

@DrakenZA
Copy link

DrakenZA commented Dec 8, 2022

tshi

@miguelgargallo I'm also excited about 2.1, but if the cost is VRAM, I'd rather stick to 2.0 until a different fix is found. My GPU doesn't have a ton of VRAM, and I'm sure many people are on the same boat.

If the PR is forcing --no-half on everyone (as opposed to just those running 2.1), I'd argue it's not fixing the problem, but rather trading a problem for another. And in my opinion, the problem you are creating (breaking existing users with low VRAM) is more severe than the problem you are solving (helping people trying the new model).

This isnt really SD2.0 . Someone changed something in the code, that break 2.0 support at half-perc in general.
You will get the same issues with SD2.0 sadly.

@ClashSAN
Copy link
Collaborator

ClashSAN commented Dec 8, 2022

added this as a note to wiki:

If 2.0 or 2.1 is generating black images, enable full precision with --no-half or try using the --xformers optimization.

we don't edit webui-user.bat, as it breaks user's current settings, we let user decide

@ClashSAN ClashSAN closed this Dec 8, 2022
@aliencaocao
Copy link
Contributor

@ClashSAN maybe in the wiki you should warn that SD 2.0 is more sensitive to FP16 numerical instability (as noted by themselves in Stability-AI/stablediffusion@c12d960)
So users will know that the potential cost might be larger than using SD1.5 and below.

@ClashSAN
Copy link
Collaborator

ClashSAN commented Dec 9, 2022

@aliencaocao Is it with both 2.0 and 2.1, or SD 2.1 specifically?

@aliencaocao
Copy link
Contributor

Both. It is due to their new cross attention module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet