Repository navigation
Apple silicon:black output randomly happens #2446
Description
Activity
try --precision full --no-half, worth a shot
https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Troubleshooting
I run the command --precision full --no-half --opt-split-attention-v1 --disable-safe-unpickle and I still get the black ones on my Mac as well, @ClashSAN . Generally it's like a third of the batch that turns out black.
was this always an issue? can you revert to an older commit?
try --precision full --no-half, worth a shot https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Troubleshooting
The default line in the script is
python webui.py --precision full --no-half --opt-split-attention-v1
Haven't tried --disable-safe-unpickle yet.
try removing the --opt-split-attention-v1, the newer opt-split-attention implementation will be on by default.
try removing the --opt-split-attention-v1, the newer opt-split-attention implementation will be on by default.
Looks promising in the new batch, still running.
dylancl@01b071c
Looks like they updated the script, default parameters are changed. so make sure both the script and repo are updated.
the invoke commit - #2234
if the issue is solved, say so. you can close it, @A2Sumie
Not solved.
I'm not sure but I was using AC power when the outputs became stable.
Now I'm on battery and black outputs returned. Not sure if this is the cause.
I also have this issue since October 11 evening (around 7 PM UTC+2)
I used to be able to generate a batch of 4 images in one go, now if I do that I guess black output every time.
Everything seems slower too.
I also have this issue since October 11 evening (around 7 PM UTC+2) I used to be able to generate a batch of 4 images in one go, now if I do that I guess black output every time. Everything seems slower too.
I run the command
--precision full --no-half --opt-split-attention-v1 --disable-safe-unpickleand I still get the black ones on my Mac as well, @ClashSAN . Generally it's like a third of the batch that turns out black.
I've found something weird.
Toggling fans to full speed would significantly increase the rate of success.
Using battery power or throwing my Mac on to my bed gives bunches of black outputs.
Can you check this out?
If you have modelname.vae.pt in the models directory, adding --no-half-vae could fix the issue
1 remaining item
I've found something weird. Toggling fans to full speed would significantly increase the rate of success. Using battery power or throwing my Mac on to my bed gives bunches of black outputs. Can you check this out?
You actually might be onto something here, I put my Mac standing up on its short side so the fans had plenty of room to breathe and it put out a bunch of images correctly in a row. Weird.
Not sure if there is an issue for consistent black image outputs on M1 or if it is the same problem, but for me only a few samplers work correctly. Important note, they all work with 1 sampling step (or is it because no sampling is applied on step 1?), but some of them output black images for 2+ steps. I marked with ✅ ones that do work for me
[text-to-image]
Euler A ❌
Euler ✅
LMS ❌
Heun ❌
DPM2 ✅
DPM2 a ❌
DPM fast ✅
DPM adaptive ✅
LMS Karras ❌
DPM2 Karras ✅
DPM2 a Karras ❌
DDIM ✅
PLMS ✅
[image-to-image]
All the samplers work correctly ✅
UPDATE: the method bellow fixes my issue with samplers, but does NOT fix random black image outputs
in file repositories/k-diffusion/k_diffusion/sampling.py after def to_d(x, sigma, denoised): add sigma = sigma.to('cpu').to('mps') <- for some reason when the sigma value is close to 0 and is located not on the CPU, it shows it as 0, moving it to cpu fixes it for me, may be it is only a problem for specific nightly torch release / mac os version.
Also, the issue discussed in this topic only appears for a single sampling step, if you plot every step, it recovers in the next step.
Not sure if there is an issue for consistent black image outputs on M1 or if it is the same problem, but for me only a few samplers work correctly. Important note, they all work with 1 sampling step (or is it because no sampling is applied on step 1?), but some of them output black images for 2+ steps. I marked with ✅ ones that do work for me
[text-to-image] Euler A ❌ Euler ✅ LMS ❌ Heun ❌ DPM2 ✅ DPM2 a ❌ DPM fast ✅ DPM adaptive ✅ LMS Karras ❌ DPM2 Karras ✅ DPM2 a Karras ❌ DDIM ✅ PLMS ✅
[image-to-image] All the samplers work correctly ✅
UPDATE: the method bellow fixes my issue with samplers, but does NOT fix random black image outputs in file
repositories/k-diffusion/k_diffusion/sampling.pyafterdef to_d(x, sigma, denoised):addsigma = sigma.to('cpu').to('mps')<- for some reason when the sigma value is close to 0 and is located not on the CPU, it shows it as 0, moving it to cpu fixes it for me, may be it is only a problem for specific nightly torch release / mac os version.Also, the issue discussed in this topic only appears for a single sampling step, if you plot every step, it recovers in the next step.
Thanks a lot, the fix works with the lastest version on a MAC STUDIO 2022 so I can use "Euler A"
Describe the bug
I'm using a Apple silicon device(mbp16) and black outputs happens from time to time.
Tried Euler a and DPM fast samplers, the failure happens randomly.
No error outputs in console.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
All outputs are properly processed.
Screenshots

If applicable, add screenshots to help explain your problem.
Running another batch, will attach when occurs.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.