mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-13 00:47:03 +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) :
|
if total_ram < 6 * (1024 * 1024 * 1024) :
|
||||||
set_vram_to = VRAMState.LOW_VRAM
|
set_vram_to = VRAMState.LOW_VRAM
|
||||||
lowvram_available = True
|
lowvram_available = True
|
||||||
if total_ram > 12 * (1024 * 1024 * 1024) :
|
if total_ram > 48 * (1024 * 1024 * 1024) :
|
||||||
vram_state = VRAMState.HIGH_VRAM
|
vram_state = VRAMState.HIGH_VRAM
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -592,7 +592,7 @@ def dtype_size(dtype):
|
|||||||
return dtype_size
|
return dtype_size
|
||||||
|
|
||||||
def unet_offload_device():
|
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()
|
return get_torch_device()
|
||||||
else:
|
else:
|
||||||
return torch.device("cpu")
|
return torch.device("cpu")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user