Fooocus icon indicating copy to clipboard operation
Fooocus copied to clipboard

Entirely black image generated on a Intel Mac book pro

Open pantuza opened this issue 1 year ago • 6 comments

Describe the problem Fooocus is generating two black images after doing 15 minutes of computation. I am running it in a Intel Mac Book Pro. I simply followed the steps on this project Readme file in order to install Fooocus.

Full Console Log Preview takes a minute to become like the picture below and then never gets updated anymore during the entire 15 minutes process. At the end, both images generated are black. Screenshot 2023-12-04 at 11 10 59

[~/d/Fooocus] : PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0 python entry_with_update.py                                                                                                                                                                                                                         (main) 10:31:37
Already up-to-date
Update succeeded.
[System ARGV] ['entry_with_update.py']
Python 3.11.5 (main, Aug 24 2023, 15:18:16) [Clang 14.0.3 (clang-1403.0.22.14.1)]
Fooocus version: 2.1.824
Running on local URL:  http://127.0.0.1:7865

To create a public link, set `share=True` in `launch()`.
Total VRAM 32768 MB, total RAM 32768 MB
Set vram state to: SHARED
Disabling smart memory management
Device: mps
VAE dtype: torch.float32
Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention
Refiner unloaded.
model_type EPS
adm 2816
Using split attention in VAE
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
Using split attention in VAE
extra keys {'cond_stage_model.clip_l.logit_scale', 'cond_stage_model.clip_l.text_projection', 'cond_stage_model.clip_g.transformer.text_model.embeddings.position_ids'}
Base model loaded: /Users/pantuza/dev/Fooocus/models/checkpoints/juggernautXL_version6Rundiffusion.safetensors
Request to load LoRAs [['sd_xl_offset_example-lora_1.0.safetensors', 0.1], ['None', 1.0], ['None', 1.0], ['None', 1.0], ['None', 1.0]] for model [/Users/pantuza/dev/Fooocus/models/checkpoints/juggernautXL_version6Rundiffusion.safetensors].
Loaded LoRA [/Users/pantuza/dev/Fooocus/models/loras/sd_xl_offset_example-lora_1.0.safetensors] for UNet [/Users/pantuza/dev/Fooocus/models/checkpoints/juggernautXL_version6Rundiffusion.safetensors] with 788 keys at weight 0.1.
Fooocus V2 Expansion: Vocab with 642 words.
Fooocus Expansion engine loaded for cpu, use_fp16 = False.
Requested to load SDXLClipModel
Requested to load GPT2LMHeadModel
Loading 2 new models
App started successful. Use the app with http://127.0.0.1:7865/ or 127.0.0.1:7865
[Parameters] Adaptive CFG = 7
[Parameters] Sharpness = 2
[Parameters] ADM Scale = 1.5 : 0.8 : 0.3
[Parameters] CFG = 4.0
[Parameters] Seed = 5056542759738089299
[Parameters] Sampler = dpmpp_2m_sde_gpu - karras
[Parameters] Steps = 30 - 15
[Fooocus] Initializing ...
[Fooocus] Loading models ...
Refiner unloaded.
[Fooocus] Processing prompts ...
[Fooocus] Preparing Fooocus text #1 ...
[Prompt Expansion] create an indigenous teenager from Amazon forest as a game character for a 2D game that appeals like super nintendo game such as Mortal kombat. The forest is full of magic around her. Make sure she does not has a sexual connotation. Her eyes are big, black and shines a blue power, cinematic, dynamic, dramatic ambient light, epic, stunning, brave
[Fooocus] Preparing Fooocus text #2 ...
[Prompt Expansion] create an indigenous teenager from Amazon forest as a game character for a 2D game that appeals like super nintendo game such as Mortal kombat. The forest is full of magic around her. Make sure she does not has a sexual connotation. Her eyes are big, black and shines a blue power, cinematic, dramatic atmosphere, colors, epic light, beautiful, strong background
[Fooocus] Encoding positive #1 ...
[Fooocus] Encoding positive #2 ...
[Fooocus] Encoding negative #1 ...
[Fooocus] Encoding negative #2 ...
[Parameters] Denoising Strength = 1.0
[Parameters] Initial Latent shape: Image Space (896, 1152)
Preparation time: 30.22 seconds
[Sampler] refiner_swap_method = joint
[Sampler] sigma_min = 0.0291671771556139, sigma_max = 14.614643096923828
Requested to load SDXL
Loading 1 new model
[Fooocus Model Management] Moving model(s) has taken 14.96 seconds
huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks...
To disable this warning, you can either:
        - Avoid using `tokenizers` before the fork if possible
        - Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)
  0%|                                                                                                             | 0/30 [00:00<?, ?it/s]/Users/pantuza/dev/Fooocus/modules/anisotropic.py:132: UserWarning: The operator 'aten::std_mean.correction' is not currently supported on the MPS backend and will fall back to run on the CPU. This may have performance implications. (Triggered internally at /Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/mps/MPSFallback.mm:11.)
  s, m = torch.std_mean(g, dim=(1, 2, 3), keepdim=True)
100%|████████████████████████████████████████████████████████████████████████████████████████████████████| 30/30 [05:57<00:00, 11.92s/it]
Image generated with private log at: /Users/pantuza/dev/Fooocus/outputs/2023-12-04/log.html
Generating and saving time: 383.35 seconds
[Sampler] refiner_swap_method = joint
[Sampler] sigma_min = 0.0291671771556139, sigma_max = 14.614643096923828
Requested to load SDXL
Loading 1 new model
[Fooocus Model Management] Moving model(s) has taken 14.49 seconds
100%|████████████████████████████████████████████████████████████████████████████████████████████████████| 30/30 [08:42<00:00, 17.41s/it]
Image generated with private log at: /Users/pantuza/dev/Fooocus/outputs/2023-12-04/log.html
Generating and saving time: 550.70 seconds
Total time: 965.32 seconds

pantuza avatar Dec 04 '23 14:12 pantuza

Hey pantuza, did you find a solution? Running the same problems with an M1 Max

vottart avatar Dec 07 '23 16:12 vottart

same issue, also on mac

mlison avatar Dec 08 '23 10:12 mlison

Unfortunately no, @vottart. Although, I can share I have tried precisely the same steps on a M2 machine and it worked. Throughout my investigations so far, the issue seems to be related to Cuda on M1 (just a hypothesis). But I have not invest further time trying to solve it. Maybe this information can be insightful to anyone digging deeper on the issue.

pantuza avatar Dec 08 '23 19:12 pantuza

[~/d/Fooocus] : PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0 python entry_with_update.py
/Users/pantuza/dev/Fooocus/modules/anisotropic.py:132: UserWarning: The operator 'aten::std_mean.correction' is not currently supported on the MPS backend and will fall back to run on the CPU. This may have performance implications. (Triggered internally at /Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/mps/MPSFallback.mm:11.)

It appears like the steps on the project guideline is only just only optimize towards apple silicone macs, as the MPS backend in PyTorch is a framework devised by Apple to maximize GPU resource utilization. However, I wonder if there's a way to extend its functionality to Intel CPUs as well. 😕

AlanTuring42 avatar Dec 14 '23 15:12 AlanTuring42

[~/d/Fooocus] : PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0 python entry_with_update.py
/Users/pantuza/dev/Fooocus/modules/anisotropic.py:132: UserWarning: The operator 'aten::std_mean.correction' is not currently supported on the MPS backend and will fall back to run on the CPU. This may have performance implications. (Triggered internally at /Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/mps/MPSFallback.mm:11.)

It appears like the steps on the project guideline is only just only optimize towards apple silicone macs, as the MPS backend in PyTorch is a framework devised by Apple to maximize GPU resource utilization. However, I wonder if there's a way to extend its functionality to Intel CPUs as well. 😕

As this – diffusionbee-stable-diffusion-ui, stable_diffusion.openvino works on both Intel and M1/M2 mac.

AlanTuring42 avatar Dec 14 '23 16:12 AlanTuring42

I am getting this 3kb black images on mac pro m1. I will switch to stable diffusion UIs mentioned above

so-joinplank avatar Dec 24 '23 13:12 so-joinplank

See https://github.com/lllyasviel/Fooocus/issues/1184

mashb1t avatar Dec 30 '23 14:12 mashb1t

I have the same problem All-black image created on an Intel Mac book pro I still don't understand how to fix this

dejavy avatar Jan 04 '24 00:01 dejavy