Dynamic VRAM pins the text encoder to GPU, leaving nothing for the diffusion model (MiniMax H3, 24 GB)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- backend, machine-learning
Research direction
Start by tracing the text encoder placement logic shown in the issue, especially the aimdo_enabled branch, and compare it with the behavior when dynamic VRAM is disabled. Check the history of #16374 and the related #16150 for intended memory management behavior. Done means the encoder can be released when the diffusion model needs VRAM, while preserving the intended dynamic VRAM behavior; reproduce with the supplied 24 GB MiniMax H3 workflow.
Written by the indexing model from the issue text.
Description
Expected Behavior
A MiniMax H3 fl2va workflow that fits in 24 GB loads the diffusion model to GPU and samples normally.
Actual Behavior
The text encoder is loaded to GPU and never released, so the diffusion model is offloaded in full and sampling runs from system RAM. No step completed in 9m43s.
Requested to load MiniMaxH3TEModel_
loaded completely; 21520.80 MB usable, 14960.20 MB loaded, full load: True
Requested to load MiniMaxH3VideoVAE
loaded completely; 21424.67 MB usable, 2665.86 MB loaded, full load: True
Requested to load MiniMaxH3
0 models unloaded.
loaded partially; 0.00 MB usable, 0.00 MB loaded, 15241.48 MB offloaded, 703.17 MB buffer reserved, lowvram patches: 0
0%| | 0/24 [09:43<?, ?it/s]
Encoder 14,960 MB + VAE 2,666 MB = 17,626 MB of 21,424 MB usable, leaving about 3.8 GB for a 15,241 MB model. 0 models unloaded — the encoder is not freed to make room, and --disable-smart-memory does not change this.
This appears to come from d39cdfdb0 ("Always put text encoder on GPU when dynamic vram on", #16374), which made encoder placement unconditional under aimdo_enabled:
if comfy.memory_management.aimdo_enabled:
return get_torch_device()
elif vram_state in (VRAMState.HIGH_VRAM, VRAMState.NORMAL_VRAM):
...
Steps to Reproduce
- On a 24 GB card, load a MiniMax H3 fl2va workflow:
minimax_h3_fl2va_pruned_w6a8+qwen3vl_32b_minimax_h3_nvfp4_awq+minimax_h3_video_vae_int8_convrot. - Queue it with dynamic VRAM at its default (enabled).
- Watch the load lines: the encoder loads completely, then the diffusion model reports
0.00 MB usableand is offloaded in full.
Workaround
--disable-dynamic-vram restores the previous behaviour and the model loads normally. Since the startup warning asks for detailed reports because the argument will be removed soon, this is that report.
Possibly relevant: the encoder here is the nvfp4 AWQ build, and nvfp4 is emulated rather than native on Ada, so keeping it resident buys no speed on this card. device: cpu on CLIPLoader is not an alternative either, since CPU has no nvfp4 support (d4056d50c).
Likely the same underlying problem as #16150.
Other
- Windows 11, RTX 4090 24 GB (24,564 MB total), 128 GB RAM
- ComfyUI 0.46.0 (18a5c7661), comfy-aimdo 0.6.0
- PyTorch 2.7.0+cu128
- Dominant language
- Python
- Stars
- 150k
- Forks
- 17.9k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 181
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Comfy-Org/ComfyUI
-
UnboundLocalError on a dangling symlink in custom_nodesPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Feature
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
ModelMergeSimple and all merge nodes are O(N²)Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Comfy-Org/ComfyUI#17823 · 1 reaction ·
Maintainers usually reply within 1 day
-
[Ascend NPU] Trellis2 shape stage aborts: aten::max.dim has no INT32 kernel (EZ1001)Possibly taken @harmehak0173 claimed this 13 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
All issues in Comfy-Org/ComfyUI
Similar issues
-
Test: to_hijri() accepts datetime.datetime and uses only the date partPossibly taken A pull request linked to this issue is open or already merged. Opengood first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 · 3 comments ·
Maintainers usually reply within 1 day
-
polish
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scoresPossibly taken @AshutoshSingh840 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
UKGovernmentBEIS/control-arena#992 ·
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
mvalentsev/awesome-free-ai-coding#70 ·
Maintainers usually reply within 1 day