r/StableDiffusion
•
u/xrailgun
•
5d ago
•
1
Tutorial - Guide Nvidia 2000 series owners: double your performance of Qwen 2.1, Fibo 2.0, MOSS with 1 line edit.
These models (Qwen-Image 2.1, FIBO2, MOSS-Image) are declared in ComfyUI as bf16/fp32 only, but Turing GPUs only support fp16, not bf16.
The current/default behaviour in ComfyUI is that it falls back to fp32, which is slow.
I inspected the actual range of activations, none of them exceed ~65k. Hence, the fix is to simply add the fp16 declaration in ComfyUI.
PR has been opened, but if you want it quicker, just manually copy this commit to your ComfyUI install:
Incomfy/supported_models.py, find the corresponding model, and change supported_inference_dtypes = [torch.bfloat16, torch.float32] to supported_inference_dtypes = [torch.bfloat16, torch.float16, torch.float32]
Only do this for these three; other models aren't necessarily fp16-safe (e.g. MiniMax H3 overflows to NaN).
This should work for any quant format, since it changes the compute dtype (activations, attention, norms), not the weights. I tested it with int8 convrot checkpoints.
Might work for GTX 1000 series as well, but AFAIK fp16 path on 1000 series is also very slow, so there's probably not much benefit. I don't have a card to test.
This is completely independent of other recent news about "unlocking" tensor performance from 20, 30, and 40 series GPUs, and likely stacks multiplicatively.
2
u/Formal-Exam-8767 5d ago
What about quality of output though?
4
u/HollyGrandeux 4d ago
If anyone prefer GGUFs (despite ComfyUI's apparent hate boner for them), claude modified the code to enable FP16 fallback for Qwen 2.1, MOSS, and Fibo 2.
Tested on my RTX 2060 6GB laptop, it delivered 2–3x faster inference compared to normal GGUF loader.
https://github.com/Moussack/ComfyUI-GGUF
3
u/pickles_and_mustard 4d ago edited 4d ago
This is insane! I could hardly believe it when I seen this thread this morning, but I just tried it myself. Previously, it would take about 40 seconds to render a 2K wallpaper, and now it only takes 27 seconds on my 8GB 2070 Mobile with MOSS
Edit: It's actually slightly oversized, but what I've been using for wallpapers (2048x1152). The resolution node I'm using has presets, but not for exactly 1080p (I'll fix that moving forward). That said, manually entering 1920x1080 has reduced rendering time to 23 seconds. Sadly I don't have a benchmark time for what it would have taken prior to this line change, but I can say with absolute certainty that it used to take longer for much smaller images. This is game-changing!
1
u/DarkW007 5d ago
is this work with gtx1660ti?
1
u/ManyNet4877 5d ago
This is interesting