mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-12 11:46:37 +08:00
Increase threshold for automatic HIGH_VRAM & do not offload unet when RAM < VRAM
12 is too low a threshold for HIGH_VRAM. Offloading unet should only be done when RAM > VRAM.
This commit is contained in:
parent
8bdaffe3b8
commit
9d48f27134
@ -156,7 +156,7 @@ if cpu_state != CPUState.CPU:
|
||||
if total_ram < 6 * (1024 * 1024 * 1024) :
|
||||
set_vram_to = VRAMState.LOW_VRAM
|
||||
lowvram_available = True
|
||||
if total_ram > 12 * (1024 * 1024 * 1024) :
|
||||
if total_ram > 48 * (1024 * 1024 * 1024) :
|
||||
vram_state = VRAMState.HIGH_VRAM
|
||||
|
||||
try:
|
||||
@ -592,7 +592,7 @@ def dtype_size(dtype):
|
||||
return dtype_size
|
||||
|
||||
def unet_offload_device():
|
||||
if vram_state == VRAMState.HIGH_VRAM:
|
||||
if vram_state == VRAMState.HIGH_VRAM or total_ram < total_vram:
|
||||
return get_torch_device()
|
||||
else:
|
||||
return torch.device("cpu")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user