ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

[Mac] flux generations random noise

Open Diabl0269 opened this issue 2 years ago • 3 comments

Your question

Hey, i've been trying to run ComfyUI with Flux for the past few weeks and it seems that no matter what I try and which Flux model I try (dev/schnell), I always get very blurred images as seen in the attached image, no matter the parameters I change like the sampler others. I have tried using the workflow examples from the images in the documentation. (https://comfyanonymous.github.io/ComfyUI_examples/flux/)

I've been trying to search online for solutions but wasn't able to find any.

I also tried recloning this repository and the models but nothing has changed.

My machine is a Macbook pro M3 Max with 128GB and it runs smoothly other models, the only issue is with Flux and ComfyUI.

Lastly, I was able to use Flux via the project diffusionbee which verifies for me the issue is with ComfyUI.

image

Logs

python main.py
Total VRAM 131072 MB, total RAM 131072 MB
pytorch version: 2.4.0
Set vram state to: SHARED
Device: mps
Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention
[Prompt Server] web root: /Users/username/Documents/projects/ComfyUI/web
/opt/homebrew/anaconda3/lib/python3.12/site-packages/kornia/feature/lightglue.py:44: FutureWarning: `torch.cuda.amp.custom_fwd(args...)` is deprecated. Please use `torch.amp.custom_fwd(args..., device_type='cuda')` instead.
  @torch.cuda.amp.custom_fwd(cast_inputs=torch.float32)

Import times for custom nodes:
   0.0 seconds: /Users/username/Documents/projects/ComfyUI/custom_nodes/websocket_image_save.py

Starting server

To see the GUI go to: http://127.0.0.1:8188
got prompt
Using split attention in VAE
Using split attention in VAE
model weight dtype torch.bfloat16, manual cast: None
model_type FLOW
Requested to load FluxClipModel_
Loading 1 new model
loaded completely 0.0 4777.53759765625 True
clip missing: ['text_projection.weight']
Requested to load Flux
Loading 1 new model
loaded completely 0.0 22680.586059570312 True
  0%|                                                                                                                                                                                                                   | 0/20 [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)
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:47<00:00,  2.40s/it]
Requested to load AutoencodingEngine
Loading 1 new model
loaded completely 0.0 319.7467155456543 True
Prompt executed in 62.16 seconds
got prompt
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [02:24<00:00,  7.22s/it]
Prompt executed in 145.37 seconds

Other

No response

Diabl0269 avatar Sep 13 '24 09:09 Diabl0269

Perhaps you can try this command to launch Comfy : python3 -m venv venv source ./venv/bin/activate PYTORCH_ENABLE_MPS_FALLBACK=1 python main.py

I hope it helps you.

emilune avatar Sep 13 '24 09:09 emilune

You should not use that sampler. FLUX can only use a very limited variety of samplers.

ltdrdata avatar Sep 14 '24 05:09 ltdrdata

Perhaps you can try this command to launch Comfy : python3 -m venv venv source ./venv/bin/activate PYTORCH_ENABLE_MPS_FALLBACK=1 python main.py

I hope it helps you.

Thanks a lot! It seems that the issue was really in the Python environment and not the suggested environment variable, since I have tried with the new virtual environment with and without the variable, as well as with the original environment with this variable which didn't work. Later I'll try to fix my global environment in hope but that is great for now, thanks again!

You should not use that sampler. FLUX can only use a very limited variety of samplers.

As mentioned, I have tried multiple samplers and none have worked originally.

Diabl0269 avatar Sep 15 '24 07:09 Diabl0269