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

[Bug]: black screen on output #3070

Closed
5 tasks done
lgwjames opened this issue Jun 1, 2024 · 15 comments
Closed
5 tasks done

[Bug]: black screen on output #3070

lgwjames opened this issue Jun 1, 2024 · 15 comments
Labels
bug (Apple) Something isn't working (MacOS / Apple specific) can't reproduce This can not be reproduced duplicate This issue or pull request already exists help wanted Extra attention is needed

Comments

@lgwjames
Copy link

lgwjames commented Jun 1, 2024

Checklist

  • The issue has not been resolved by following the troubleshooting guide
  • The issue exists on a clean installation of Fooocus
  • The issue exists in the current version of Fooocus
  • The issue has not been reported before recently
  • The issue has been reported before but has not been fixed yet

What happened?

when trying to cartoon or cute photos with image prompt getting errors

Steps to reproduce the problem

man meets woman, Cutest cartoon illustration, empty background, cute, colorful, beautiful, art station, deviant art, pinterest in prompt

add photo prompt
Screenshot 2024-06-01 at 11-14-33 Siân Lamper ✌🏻 (@siannypoos) • Instagram photos and videos

What should have happened?

a good photo and not a blank black one

What browsers do you use to access Fooocus?

Mozilla Firefox

Where are you running Fooocus?

Locally

What operating system are you using?

mac os 14.5

Console logs

[Fooocus] Downloading control models ...
[Fooocus] Loading control models ...
extra clip vision: ['vision_model.embeddings.position_ids']
[Parameters] Sampler = dpmpp_2m_sde_gpu - karras
[Parameters] Steps = 60 - 30
[Fooocus] Initializing ...
[Fooocus] Loading models ...
Refiner unloaded.
[Fooocus] Processing prompts ...
[Wildcards] processing: __neg__
[Wildcards] Image compression
[Wildcards] processing: __neg__
[Wildcards] Out of Focus
[Wildcards] processing: __neg__
[Wildcards] Banding
[Wildcards] processing: __neg__
[Wildcards] tasteless
[Fooocus] Preparing Fooocus text #1 ...
[Prompt Expansion] man meets woman, Cutest cartoon illustration, empty background, cute, colorful, beautiful, art station, deviant art, pinterest, amazing, gorgeous, intricate, vibrant, highly detailed, very sharp focus, clear, artistic, fabulous, elegant, epic, stunning, full bright, brilliant, optimistic colors, glowing, shining atmosphere, radiant light, vivid, magic
[Fooocus] Preparing Fooocus text #2 ...
[Prompt Expansion] man meets woman, Cutest cartoon illustration, empty background, cute, colorful, beautiful, art station, deviant art, pinterest, highly detailed, coherent, sharp focus, rich bright colors, optimistic, futuristic, color, intricate, saturated, vivid, dramatic, romantic, determined, generous, cinematic, loving, pretty, inspiring, epic, stunning, creative, passionate
[Fooocus] Preparing Fooocus text #3 ...
[Prompt Expansion] man meets woman, Cutest cartoon illustration, empty background, cute, colorful, beautiful, art station, deviant art, pinterest, highly detailed, very sharp, focus, inspired, rich bright colors, optimistic, glowing, elegant, intricate, innocent, light, magical, pretty, illuminated, vivid, color, coherent, strong, complex, iconic, amazing composition
[Fooocus] Preparing Fooocus text #4 ...
[Prompt Expansion] man meets woman, Cutest cartoon illustration, empty background, cute, colorful, beautiful, art station, deviant art, pinterest, highly detailed, sharp focus, intricate, elegant, innocent, generous, lovely, magical, incredible, epic light, cinematic, stunning, coherent, amazing composition, creative, positive, joyful, unique, attractive, very inspirational, artistic
[Fooocus] Encoding positive #1 ...
[Fooocus] Encoding positive #2 ...
[Fooocus] Encoding positive #3 ...
[Fooocus] Encoding positive #4 ...
[Fooocus] Encoding negative #1 ...
[Fooocus] Encoding negative #2 ...
[Fooocus] Encoding negative #3 ...
[Fooocus] Encoding negative #4 ...
[Fooocus] Image processing ...
Requested to load CLIPVisionModelWithProjection
Loading 1 new model
Requested to load Resampler
Loading 1 new model
Requested to load To_KV
Loading 1 new model
[Fooocus Model Management] Moving model(s) has taken 0.14 seconds
[Parameters] Denoising Strength = 1.0
[Parameters] Initial Latent shape: Image Space (896, 1152)
Preparation time: 30.85 seconds
[Fooocus] Preparing task 1/4 ...
[Sampler] refiner_swap_method = joint
[Sampler] sigma_min = 0.0291671771556139, sigma_max = 14.614643096923828
Requested to load SDXL
Loading 1 new model
unload clone 5
[Fooocus Model Management] Moving model(s) has taken 4.02 seconds
  0%|                                                                                                                                                                 | 0/60 [00:00<?, ?it/s]/Users/Quad-Core/Fooocus/modules/core.py:257: RuntimeWarning: invalid value encountered in cast
  x_sample = x_sample.cpu().numpy().clip(0, 255).astype(np.uint8)
 23%|███████████████████████████████████▍                                                                                                                    | 14/60 [03:28<11:22, 14.85s/it]

Additional information

also another error from today

/Users/Quad-Core/Fooocus/modules/core.py:331: RuntimeWarning: invalid value encountered in cast
return [np.clip(255. * y.cpu().numpy(), 0, 255).astype(np.uint8) for y in x]

this is in my start up

[System ARGV] ['entry_with_update.py', '--theme', 'dark', '--all-in-fp16', '--attention-pytorch', '--disable-offload-from-vram', '--always-high-vram', '--gpu-device-id', '0', '--async-cuda-allocation', '--unet-in-fp16', '--vae-in-fp16', '--clip-in-fp16']
Python 3.11.5 (main, Sep 11 2023, 08:19:27) [Clang 14.0.6 ]
Fooocus version: 2.4.1
Set device to: 0
[Cleanup] Attempting to delete content of temp dir /var/folders/6l/xrkxgs657g7_vq50479x7lc40000gp/T/fooocus
[Cleanup] Cleanup successful
Total VRAM 65536 MB, total RAM 65536 MB
Forcing FP16.
Set vram state to: SHARED
Device: mps
VAE dtype: torch.float16
Using pytorch cross attention
Refiner unloaded.
IMPORTANT: You are using gradio version 3.41.2, however version 4.29.0 is available, please upgrade.

@lgwjames lgwjames added bug Something isn't working triage This needs an (initial) review labels Jun 1, 2024
@mashb1t
Copy link
Collaborator

mashb1t commented Jun 2, 2024

SDXL is prone to generating black images after VAE if there are issues in its internal calculations when using FP16 on some devices. As you're using the MPS backend there might be some issues with this combination. Please check if this can be solved by using --vae-in-fp32 as i can't reproduce the issues. You can also download and use a separate VAE with FP16 support, which might work more consistently.

EDIT: as of #2171 upgrading the OS did help.

See also:

@mashb1t mashb1t added can't reproduce This can not be reproduced feedback pending Waiting for further information duplicate This issue or pull request already exists and removed triage This needs an (initial) review labels Jun 2, 2024
@lgwjames
Copy link
Author

lgwjames commented Jun 2, 2024

have updated as requested. python entry_with_update.py --theme dark --all-in-fp16 --attention-pytorch --disable-offload-from-vram --always-high-vram --gpu-device-id 0 --async-cuda-allocation --unet-in-fp16 --vae-in-fp32 --clip-in-fp16

just need to re download some files

@lgwjames
Copy link
Author

lgwjames commented Jun 2, 2024

so my time has gone from about 11/12 s/it to 14/15 so a small increase.

first image test

screenshot-127 0 0 1_7865-2024 06 02-14_45_50

and now adding the image prompt

Uploading screenshot-127.0.0.1_7865-2024.06.02-14_46_45.png…

@lgwjames
Copy link
Author

lgwjames commented Jun 2, 2024

blank screen
no preview

[Fooocus Model Management] Moving model(s) has taken 2.90 seconds
0%| | 0/60 [00:00<?, ?it/s]/Users/Quad-Core/Fooocus/modules/core.py:257: RuntimeWarning: invalid value encountered in cast
x_sample = x_sample.cpu().numpy().clip(0, 255).astype(np.uint8)
17%|██████████████████████████ | 10/60 [02:27<12:15, 14.71s/it]

@lgwjames
Copy link
Author

lgwjames commented Jun 2, 2024

also on term cmd window different bars

Screenshot 2024-06-02 at 15 02 44

ended as nothing

100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 60/60 [14:30<00:00, 14.50s/it]
/Users/Quad-Core/Fooocus/modules/core.py:331: RuntimeWarning: invalid value encountered in cast
return [np.clip(255. * y.cpu().numpy(), 0, 255).astype(np.uint8) for y in x]
[Fooocus] Saving image 1/1 to system ...
Image generated with private log at: /Volumes/1TB Caddy bay 5/2024-06-02/log.html
Generating and saving time: 877.44 seconds

@lgwjames
Copy link
Author

lgwjames commented Jun 2, 2024

remove base model to a new one
and straight away error

/Users/Quad-Core/Fooocus/modules/core.py:257: RuntimeWarning: invalid value encountered in cast
x_sample = x_sample.cpu().numpy().clip(0, 255).astype(np.uint8)

seems to be when i add a photo prompt so far

@lgwjames
Copy link
Author

lgwjames commented Jun 2, 2024

downgraded to 2.4.0

same error /Users/Quad-Core/Fooocus/modules/core.py:257: RuntimeWarning: invalid value encountered in cast
x_sample = x_sample.cpu().numpy().clip(0, 255).astype(np.uint8)

@lgwjames
Copy link
Author

lgwjames commented Jun 2, 2024

removing extra code and will report back

@lgwjames
Copy link
Author

lgwjames commented Jun 2, 2024

ok removed all code and still getting black screens.

/Users/Quad-Core/Fooocus/modules/core.py:257: RuntimeWarning: invalid value encountered in cast
x_sample = x_sample.cpu().numpy().clip(0, 255).astype(np.uint8)

tried all 7 preset and as soon as i put a image in prompt error

@mashb1t mashb1t added help wanted Extra attention is needed bug (Apple) Something isn't working (MacOS / Apple specific) and removed bug Something isn't working feedback pending Waiting for further information labels Jun 2, 2024
@mashb1t
Copy link
Collaborator

mashb1t commented Jun 2, 2024

Please check out the MacOS support issue here and ask for help: #129

@mashb1t
Copy link
Collaborator

mashb1t commented Jun 6, 2024

Please link to this issue in #129 to clarify with tother MacOS users.

@mashb1t mashb1t closed this as not planned Won't fix, can't repro, duplicate, stale Jun 6, 2024
@lgwjames
Copy link
Author

lgwjames commented Jun 8, 2024

today tested and was ok as soon with image prompt as i add my sister and bf, errors
Fooocus Model Management] Moving model(s) has taken 4.45 seconds
0%| | 0/60 [00:00<?, ?it/s]/Users/Quad-Core/Fooocus/modules/core.py:257: RuntimeWarning: invalid value encountered in cast
x_sample = x_sample.cpu().numpy().clip(0, 255).astype(np.uint8)

@lgwjames
Copy link
Author

still errors, new install using 2.3.1
simple add 2 photos, left one me, right one generated one for face swop

prompt

Create a cool picture of a business man, age 40, in front of a London skyline with futuristic lighting, relaxed, serious, determined, color, dramatic light, detailed, sharp focus, intricate, very inspirational, innocent, attractive, sublime, pretty, fine detail, epic composition, elegant, perfect formal atmosphere, extremely stylish, creative, appealing, cheerful, beautiful, stunning

screenshot-127 0 0 1_7865-2024 07 27-12_03_36

Loading 1 new model
[Fooocus Model Management] Moving model(s) has taken 4.57 seconds
0%| | 0/60 [00:00<?, ?it/s]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)
/Users/Quad-Core/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/_temp/anaconda/conda-bld/pytorch_1711403210267/work/aten/src/ATen/mps/MPSFallback.mm:13.)
s, m = torch.std_mean(g, dim=(1, 2, 3), keepdim=True)
/Users/Quad-Core/Fooocus/modules/core.py:255: RuntimeWarning: invalid value encountered in cast
x_sample = x_sample.cpu().numpy().clip(0, 255).astype(np.uint8)
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 60/60 [17:01<00:00, 17.02s/it]
Requested to load AutoencoderKL
Loading 1 new model
[Fooocus Model Management] Moving model(s) has taken 0.18 seconds
/Users/Quad-Core/Fooocus/modules/core.py:329: RuntimeWarning: invalid value encountered in cast
return [np.clip(255. * y.cpu().numpy(), 0, 255).astype(np.uint8) for y in x]

Image generated with private log at: /Volumes/1TB Caddy bay 5/2024-07-27/log.html
Generating and saving time: 1031.29 seconds
Total time: 1104.49 seconds

@mashb1t
Copy link
Collaborator

mashb1t commented Jul 27, 2024

Did you check out #129 / #1184?

@lgwjames
Copy link
Author

lgwjames commented Jul 27, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug (Apple) Something isn't working (MacOS / Apple specific) can't reproduce This can not be reproduced duplicate This issue or pull request already exists help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants