Skip to content

Apple silicon:black output randomly happens  #2446

Description

@A2Sumie

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:

  1. Start a conversion batch.
  2. Wait for completion.
  3. See error

Expected behavior
All outputs are properly processed.

Screenshots
If applicable, add screenshots to help explain your problem.
Running another batch, will attach when occurs.
00036-724949706-

Desktop (please complete the following information):

  • OS: Macos 12
  • Browser Edge Mac(image in output folder is also black)
  • Commit revision 698d303

Additional context
Add any other context about the problem here.

Activity

changed the title [-]Apple silicon:black output randomly happens at end of batch[/-] [+]Apple silicon:black output randomly happens [/+] on Oct 13, 2022

ClashSAN commented on Oct 13, 2022

@ClashSAN
Collaborator

Karsten385 commented on Oct 13, 2022

@Karsten385

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.

ClashSAN commented on Oct 13, 2022

@ClashSAN
Collaborator

was this always an issue? can you revert to an older commit?

A2Sumie commented on Oct 13, 2022

@A2Sumie
Author

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.

ClashSAN commented on Oct 13, 2022

@ClashSAN
Collaborator

try removing the --opt-split-attention-v1, the newer opt-split-attention implementation will be on by default.

A2Sumie commented on Oct 13, 2022

@A2Sumie
Author

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.

ClashSAN commented on Oct 13, 2022

@ClashSAN
Collaborator

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

A2Sumie commented on Oct 13, 2022

@A2Sumie
Author

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.

TaciteOFF commented on Oct 13, 2022

@TaciteOFF

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.

A2Sumie commented on Oct 13, 2022

@A2Sumie
Author

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-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.

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?

Kalekki commented on Oct 13, 2022

@Kalekki
Contributor

If you have modelname.vae.pt in the models directory, adding --no-half-vae could fix the issue

1 remaining item

Karsten385 commented on Oct 13, 2022

@Karsten385

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.

remixer-dec commented on Oct 15, 2022

@remixer-dec
Contributor

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.

MrPalais commented on Dec 7, 2022

@MrPalais

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.

Thanks a lot, the fix works with the lastest version on a MAC STUDIO 2022 so I can use "Euler A"

added a commit that references this issue on Nov 11, 2023
added a commit that references this issue on Apr 13, 2025
added a commit that references this issue on Apr 14, 2025
added a commit that references this issue on Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug-reportReport of a bug, yet to be confirmed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions