Skip to content

ModelPatcherDynamic: force load non leaf weights#12433

Merged
comfyanonymous merged 1 commit intoComfy-Org:masterfrom
rattus128:prs/dynamic-vram-fixes/load-non-leaf
Feb 13, 2026
Merged

ModelPatcherDynamic: force load non leaf weights#12433
comfyanonymous merged 1 commit intoComfy-Org:masterfrom
rattus128:prs/dynamic-vram-fixes/load-non-leaf

Conversation

@rattus128
Copy link
Contributor

The current behaviour of the default ModelPatcher is to .to a model only if its fully loaded, which is how random non-leaf weights get loaded in non-LowVRAM conditions.

The however means they never get loaded in dynamic_vram. In the dynamic_vram case, force load them to the GPU.

Example test conditions:

RTX5090, Linux, ryzen 9600 underclocked to 2GHZ, --fast dynamic_vram, LTX2 800x600x121f

image

Before:

Requested to load LTXAV
Model LTXAV prepared for dynamic VRAM loading. 20542MB Staged. 0 patches attached.
100%|██████████| 20/20 [00:13<00:00,  1.50it/s]                                  
Model VideoVAE prepared for dynamic VRAM loading. 2331MB Staged. 0 patches attached.
lora key not loaded: text_embedding_projection.aggregate_embed.lora_A.weight
lora key not loaded: text_embedding_projection.aggregate_embed.lora_B.weight
Requested to load LTXAV
0 models unloaded.
Model LTXAV prepared for dynamic VRAM loading. 20542MB Staged. 1370 patches attached.
100%|██████████| 3/3 [00:03<00:00,  1.13s/it]                                   
Requested to load AudioVAE
loaded completely; 484.30 MB usable, 415.20 MB loaded, full load: True
0 models unloaded.
Model VideoVAE prepared for dynamic VRAM loading. 2331MB Staged. 0 patches attached.
Prompt executed in 36.05 seconds

After:

Requested to load LTXAV
Model LTXAV prepared for dynamic VRAM loading. 20542MB Staged. 0 patches attached.
100%|██████████| 20/20 [00:09<00:00,  2.17it/s]                                  
Model VideoVAE prepared for dynamic VRAM loading. 2331MB Staged. 0 patches attached.
lora key not loaded: text_embedding_projection.aggregate_embed.lora_A.weight
lora key not loaded: text_embedding_projection.aggregate_embed.lora_B.weight
Requested to load LTXAV
0 models unloaded.
Model LTXAV prepared for dynamic VRAM loading. 20542MB Staged. 1370 patches attached.
100%|██████████| 3/3 [00:02<00:00,  1.01it/s]                                   
Requested to load AudioVAE
loaded completely; 461.44 MB usable, 415.20 MB loaded, full load: True
0 models unloaded.
Model VideoVAE prepared for dynamic VRAM loading. 2331MB Staged. 0 patches attached.
Prompt executed in 31.76 seconds

The current behaviour of the default ModelPatcher is to .to a model
only if its fully loaded, which is how random non-leaf weights get
loaded in non-LowVRAM conditions.

The however means they never get loaded in dynamic_vram. In the
dynamic_vram case, force load them to the GPU.
@comfyanonymous comfyanonymous merged commit 117e214 into Comfy-Org:master Feb 13, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants