Skip to content

Commit a388003

Browse files
committed
Make --always-offload-from-vram actually work properly, fixes lllyasviel#3257
1 parent 5a71495 commit a388003

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ldm_patched/modules/model_management.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -369,12 +369,12 @@ def free_memory(memory_required, device, keep_loaded=[]):
369369
unloaded_model = True
370370

371371
if unloaded_model:
372-
soft_empty_cache()
372+
soft_empty_cache(force=ALWAYS_VRAM_OFFLOAD)
373373
else:
374374
if vram_state != VRAMState.HIGH_VRAM:
375375
mem_free_total, mem_free_torch = get_free_memory(device, torch_free_too=True)
376376
if mem_free_torch > mem_free_total * 0.25:
377-
soft_empty_cache()
377+
soft_empty_cache(force=ALWAYS_VRAM_OFFLOAD)
378378

379379
def load_models_gpu(models, memory_required=0):
380380
global vram_state

0 commit comments

Comments
 (0)