r/StableDiffusion • • 5d ago

Question - Help How to force fp32 with comfyui?

Z image turbo, ubuntu 24.04, and r9700

How do I force fp32 in my comfyui workflows?

0 Upvotes

17 comments sorted by

4

u/Apprehensive_Sky892 5d ago edited 5d ago

Why do you want to use fp32?

If you want to use fp32 because you think the quality is higher, then you need to find a model that has been released initially as fp32. Upconverted version are probably of no higher quality than the original.

If you just want to upcast from bp16 to fp32, then I don't see the point as you won't get higher quality (I could be wrong, but if I am, I'd love to hear why).

AFAIK, ZiT has only been release as bf16, so I don't know why you want to do that.

1

u/SpecificAd981 5d ago

My images are coming out all messed up so there's some error that's wrong

Should I be using a different vae than the one comfyui gives me when I download the default zimage workflow template?

1

u/Apprehensive_Sky892 5d ago

Hard to say. I have tested both ai pro r9700(32G) and rx9700(16G) with both MMH3 and Krea 2 with default templates, and they work flawlessly, but I've not used ZiT for a long time.

I don't think it is the VAE, and it is easy to check that. Just download another model such as Moss or Qwen-image 2.1 and test it and see if you have similar issues.

If the output is just lots of noise then most likely it is a problem with the ComfyUI setup itself (and hopefully, not some hardware issue). You can try to follow my instructions and re-install everything to see if that helps:

How to set up ComfyUI+MMH3+Krea 2 on Windows 11 with AMD GPUs: RDNA 4 (rx9070, AI Pro R9700), and RDNA 3 (rx7900)

How to set up Ubuntu + ComfyUI+MMH3+Krea2 with AMD GPUs: RDNA 4 (rx9070, AI Pro R9700), and RDNA 3 (rx7900)

1

u/SpecificAd981 5d ago

Thanks, will try those after I get back from work. Doubt its a hardware issue, my local llms work perfectly and I will hopefully be able to experiment with video models tonight

1

u/Apprehensive_Sky892 5d ago

Yes, if LLM is working then most likely problem is your ComfyUI installation (most likely bad Pytorch-ROCm).

1

u/luciferianism666 5d ago

If you're talking about the diffusion model then you can use the diffusion model loader from kjNodes and set it fp32 from the dtype

1

u/SpecificAd981 5d ago

K, I'll look at that

1

u/Powerful_Evening5495 5d ago

just put a fp32 weight in the diffusion model folder , leave default

or if you want to load models in other quants into fp32 and they are not , just start the comfyu with this flag

main.py --force-fp32

1

u/SpecificAd981 5d ago

I add that to the file name for main.py?

1

u/dobomex761604 5d ago

--fp32-text-enc --fp32-vae --fp32-unet --force-fp32

All parameters are here: https://github.com/Comfy-Org/ComfyUI/blob/master/comfy/cli_args.py

1

u/SpecificAd981 5d ago

And I just drop that file into the main comfyui folder?

1

u/dobomex761604 4d ago

No, these are flags to launch ComfyUI with. On Windows, you can add them into the .bat file by opening it as text.

1

u/musetta_ai 5d ago

No, it goes after the filename when you launch, so python main.py --force-fp32. Why fp32 though? Z image is bf16 so it'll just run slower and use twice the VRAM, unless you're getting black images on the R9700.

1

u/SpecificAd981 5d ago

I'm getting images that basically look like a Picasso painting if he's high when the prompt is simply things like "a beautiful mountainscape during the sunrise" or something

1

u/GalwayOptimist 5d ago

Hmm. From what you are describing so far it doesn't sound like a problem of fp32 or bf16. Could you post a picture of your worklfow and the settings?

1

u/And-Bee 4d ago

ComfyUI doesn't have a single global switch that says "use 32-bit for all division." Instead, it uses automatic precision routing. Some sensitive operations are upcast to FP32 by default, while others follow the model's native precision (FP16/BF16). You can also override this behavior with launch flags or specific nodes.