rtx 5090 - Extreme slowdowns once the process reaches ksampler
Custom Node Testing
- [x] I have tried disabling custom nodes and the issue persists (see how to disable custom nodes if you need help)
Your question
Hi,
I recently rebuilt my computer and installed the portable version of ComfyUI and Iβm experiencing unusually slow generation times on a high-end setup. (originally I had the electron version installed by mistake, that had the exact same issues though)
I'm running a 5090 with 32GB VRAM, and even simple prompts using the WAN2.2 fp8_scaled models are taking nearly 2 minutes per image.
For now I'm just running the Wan2.2 text to video default workflow you can download from the templates section.
System Details: GPU: RTX 5090 (32GB VRAM) ComfyUI version: 0.3.48 (portable) Python: 3.12.10 (Comfy portable Python) PyTorch: 2.7.1+cu128
I tried modifying my commandline flags for run_nvidia_gpu.bat:
pause
Here's a screenshot of the default workflow:
I'm getting ~2 minutes per image (KSamplerAdvanced reports 112s per frame)
Logs show:
CLIP/text encoder model load device: cuda:0, offload device: cpu
Using scaled fp8: fp8 matrix mult: False, scale input: False
This happens with batch_size = 1 and resolution 1280x704
I have not installed Triton or Sage yet as I need to follow a tutorial on doing so, and I'd like to resolve my slow issues before I add more potential complications.
I also find that my regular image generation is abnormally slow for a 5090.
I tried using --gpu-only but that ended up giving me the error:
Allocation on device
This error means you ran out of memory on your GPU.```
My page file size for the drive where comfy is installed is:
Initial size 32768
Max size 65536
### Logs
```powershell
C:...\Documents\comfyui portable>.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --fp16-vae --use-pytorch-cross-attention
[START] Security scan
[DONE] Security scan
## ComfyUI-Manager: installing dependencies done.
** ComfyUI startup time: 2025-08-04 16:33:03.870
** Platform: Windows
** Python version: 3.12.10 (tags/v3.12.10:0cc8128, Apr 8 2025, 12:21:36) [MSC v.1943 64 bit (AMD64)]
** Python executable: C:...\Documents\comfyui portable\python_embeded\python.exe
** ComfyUI Path: C:...\Documents\comfyui portable\ComfyUI
** ComfyUI Base Folder Path: C:...\Documents\comfyui portable\ComfyUI
** User directory: C:...\Documents\comfyui portable\ComfyUI\user
** ComfyUI-Manager config path: C:...\Documents\comfyui portable\ComfyUI\user\default\ComfyUI-Manager\config.ini
** Log path: C:...\Documents\comfyui portable\ComfyUI\user\comfyui.log
Prestartup times for custom nodes:
0.0 seconds: C:...\Documents\comfyui portable\ComfyUI\custom_nodes\rgthree-comfy
1.5 seconds: C:...\Documents\comfyui portable\ComfyUI\custom_nodes\comfyui-manager
Checkpoint files will always be loaded safely.
Total VRAM 32607 MB, total RAM 63033 MB
pytorch version: 2.7.1+cu128
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 5090 : cudaMallocAsync
Using pytorch attention
Python version: 3.12.10 (tags/v3.12.10:0cc8128, Apr 8 2025, 12:21:36) [MSC v.1943 64 bit (AMD64)]
ComfyUI version: 0.3.48
ComfyUI frontend version: 1.23.4
[Prompt Server] web root: C:...\Documents\comfyui portable\python_embeded\Lib\site-packages\comfyui_frontend_package\static
### Loading: ComfyUI-Manager (V3.35)
[ComfyUI-Manager] network_mode: public
### ComfyUI Revision: 150 [bff60b5c] *DETACHED | Released on '2025-08-01'
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
[rgthree-comfy] Loaded 48 epic nodes. π
Import times for custom nodes:
0.0 seconds: C:...\Documents\comfyui portable\ComfyUI\custom_nodes\websocket_image_save.py
0.0 seconds: C:...\Documents\comfyui portable\ComfyUI\custom_nodes\comfyui-custom-scripts
0.0 seconds: C:...\Documents\comfyui portable\ComfyUI\custom_nodes\comfyui_essentials
0.0 seconds: C:...\Documents\comfyui portable\ComfyUI\custom_nodes\comfyui-kjnodes
0.0 seconds: C:...\Documents\comfyui portable\ComfyUI\custom_nodes\comfyui-videohelpersuite
0.1 seconds: C:...\Documents\comfyui portable\ComfyUI\custom_nodes\comfyui-manager
0.2 seconds: C:...\Documents\comfyui portable\ComfyUI\custom_nodes\rgthree-comfy
Context impl SQLiteImpl.
Will assume non-transactional DDL.
No target revision found.
Starting server
To see the GUI go to: http://127.0.0.1:8188
FETCH ComfyRegistry Data: 5/93
FETCH ComfyRegistry Data: 10/93
FETCH ComfyRegistry Data: 15/93
FETCH ComfyRegistry Data: 20/93
FETCH ComfyRegistry Data: 25/93
FETCH ComfyRegistry Data: 30/93
FETCH ComfyRegistry Data: 35/93
FETCH ComfyRegistry Data: 40/93
FETCH ComfyRegistry Data: 45/93
FETCH ComfyRegistry Data: 50/93
FETCH ComfyRegistry Data: 55/93
FETCH ComfyRegistry Data: 60/93
FETCH ComfyRegistry Data: 65/93
FETCH ComfyRegistry Data: 70/93
FETCH ComfyRegistry Data: 75/93
FETCH ComfyRegistry Data: 80/93
FETCH ComfyRegistry Data: 85/93
FETCH ComfyRegistry Data: 90/93
FETCH ComfyRegistry Data [DONE]
[ComfyUI-Manager] default cache updated: https://api.comfy.org/nodes
FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json [DONE]
[ComfyUI-Manager] All startup tasks have been completed.
got prompt
Using pytorch attention in VAE
Using pytorch attention in VAE
VAE load device: cuda:0, offload device: cpu, dtype: torch.float16
Using scaled fp8: fp8 matrix mult: False, scale input: False
Requested to load WanTEModel
loaded completely 9.5367431640625e+25 6419.477203369141 True
CLIP/text encoder model load device: cuda:0, offload device: cpu, current: cuda:0, dtype: torch.float16
Using scaled fp8: fp8 matrix mult: True, scale input: True
model weight dtype torch.float16, manual cast: None
model_type FLOW
Requested to load WAN21
loaded completely 14876.058919891357 13627.512924194336 True
80%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | 8/10 [16:15<04:06, 123.29s/it]
Other
No response
I'll do a speed test later today on my 5090 to see if I run into the same issue. Could you take a screenshot of your Task Manager's GPU Performance tab while it runs?
My 5080 is also very slow
I'll do a speed test later today on my 5090 to see if I run into the same issue. Could you take a screenshot of your Task Manager's GPU Performance tab while it runs?
I apologize for the late response. I hadn't had a chance to test it again until now. Here's all default settings and prompt with the text to video template downloaded directly from comfyui templates.
Screenshot is after it gets stuck at ksampler.
And here's where it's stuck at.
I have another workflow that works, but I have to shrink the image size significantly. The largest video I've been able to create is around 842x842, but it still takes a while and with a max length of around 120.
I'm sure there are some settings I'm missing, or maybe arguments I need to change or add to the run_nvidia_gpu.bat or something. I see people on reddit pumping out really good 60fps videos that are like 20 seconds long claiming they're on a 5090, but I can't get anywhere close to that.
This issue is being marked stale because it has not had any activity for 30 days. Reply below within 7 days if your issue still isn't solved, and it will be left open. Otherwise, the issue will be closed automatically.
This issue is being marked stale because it has not had any activity for 30 days. Reply below within 7 days if your issue still isn't solved, and it will be left open. Otherwise, the issue will be closed automatically.
It is unresolved.
any idea why is this? recently moved from 3080ti to 5090 and this is crazy
Since you're in Windows, can you take a look at your shared gpu memory usage in Task Manager while you run? If it exceeds 0.3MB while the VRAM usage usage is close to maxing out your vram, it is spilling into shared gpu men which is super slow.
If so, can you provide your workflow? Rn it's a super annoying issue I am driving to solve. Thanks!
Same issue here. I get an out of memory error and the process just dies. Arch Linux, RTX 5090.
Can someone remind me when we finally have a solution?
I have a 4090 RTX and I'm running into the same issue. ComfyUI is acting like its using my full VRAM potential but it's clearly not. My PC doesn't make the slightest sound while it's supposedly running on maximum VRAM.
I even set Comfy to HIGH_VRAM. Not a chance. Now it's just throwing terabytes at me while it's working with the same amount of VRAM as before.
I tried fixing the resolution, CFG, VAE, sampling steps, self-force LoRA...
Nothing worked yet. I'm just so mad because yesterday it worked just fine. One generation done in like 1-2 minutes depending on my settings. Now I'm either stuck at the KSampler for Low Noise or the VAE node which comes right after. And that takes ten times more time than 1-2 minutes.
I even tried adding a GPU cache clear node at the start⦠didn't help at all.
@Kosinkadink sorry I'm late I'm replying. I'm in the process of sending my 5090 in for an unrelated repair issue. So it'll be a bit before I can do so.
Adding the gpu cache clear looks to have helped but not resolved.
@JerryDaLerry sound aside, what does your resource or task manager say? I wouldn't go by just sound.
Hey @Squeezitgirdle ,
First of all, thanks for the quick reply! It actually ran at 99% GPU usage, but KSampler2 never progressed at all. However, I think Iβve finally figured out the issue - at least in my case.
I had recently enabled HIGH_VRAM mode to reduce waiting times. However, it seems that this mode actually disrupts ComfyUIβs VRAM management. Essentially, ComfyUI thinks thereβs more VRAM available than there really is. If the βpromisedβ amount isnβt available, the system just stops and waits for VRAM to free up.
The fix itself is really simple, and because of that, it might very well only apply to my setup. Still, I wanted to share it in case it helps someone else.
Just to clarify what I used: Wan2.2 14B Paramter Q4_K_M model with the SelfForce-4-Step Lora. I2V Workflow
Hey @Squeezitgirdle ,
First of all, thanks for the quick reply! It actually ran at 99% GPU usage, but KSampler2 never progressed at all. However, I think Iβve finally figured out the issue - at least in my case.
I had recently enabled HIGH_VRAM mode to reduce waiting times. However, it seems that this mode actually disrupts ComfyUIβs VRAM management. Essentially, ComfyUI thinks thereβs more VRAM available than there really is. If the βpromisedβ amount isnβt available, the system just stops and waits for VRAM to free up.
The fix itself is really simple, and because of that, it might very well only apply to my setup. Still, I wanted to share it in case it helps someone else.
Just to clarify what I used: Wan2.2 14B Paramter Q4_K_M model with the SelfForce-4-Step Lora. I2V Workflow
Look also at the temperature. My own experience in the past with my 5060 ti was that despite showing 100% GPU usage the temperature was in the range of 43-47 Β°C, meaning idle or about idle activity. But pinned_memory feature introduced recently improved a lot that situation. Read more about my experience here: https://github.com/comfyanonymous/ComfyUI/issues/10555 Since then latest ComfyUI code iterations made pinned memory enabled by default, it doesn't require using --fast pinned_memory any more, make sure you are running the latest git code.
@JerryDaLerry
Only thing that has made it more "stable" for me is using --cache-none even then it will crash at times with that flag