Skip to content

Ensure force_patch_weights is set when partially loading/unloading models - #469

Open
blepping wants to merge 1 commit into
city96:mainfrom
blepping:fix_partially_load_unload
Open

Ensure force_patch_weights is set when partially loading/unloading models#469
blepping wants to merge 1 commit into
city96:mainfrom
blepping:fix_partially_load_unload

Conversation

@blepping

Copy link
Copy Markdown
Contributor

The custom GGUFModelPatcher sets force_patch_weights to the load method so ComfyUI won't try to create low-VRAM patches for LoRAs, etc. However, it doesn't set that parameter for the partial load/unload methods (which default to force_patch_weights=False). This results in ComfyUI trying to create model weight functions to apply the LoRAs.

With the way the ops and patcher are set up in the official repo, those weight functions get ignored. However, we can skip the overhead of having ComfyUI create patches that are never going to get applied. You can confirm that ComfyUI is creating those weight functions that will never be applied since the log output dumps the low-VRAM patch count when the model gets loaded.

@blepping
blepping force-pushed the fix_partially_load_unload branch from e913a8a to 3b4b1ad Compare July 26, 2026 19:48
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.

1 participant