Fix offload detection with CPU only envs

This commit is contained in:
Disty0
2025-08-16 16:12:43 +03:00
parent 8af64b1e10
commit 6597a9111f
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -89,6 +89,8 @@ devices.device = devices.get_optimal_device()
mem_stat = memory_stats()
cpu_memory = round(mem_stat['ram']['total'] if "ram" in mem_stat else 0)
gpu_memory = round(mem_stat['gpu']['total'] if "gpu" in mem_stat else 0)
if gpu_memory == 0:
gpu_memory = cpu_memory
native = backend == Backend.DIFFUSERS
if not files_cache.do_cache_folders:
log.warning('File cache disabled: ')
+1 -1
View File
@@ -10,7 +10,7 @@ def get_default_modes(cmd_opts, mem_stat):
default_diffusers_offload_never = ''
gpu_memory = round(mem_stat['gpu']['total'] if "gpu" in mem_stat else 0)
if not (cmd_opts.lowvram or cmd_opts.medvram):
if "gpu" in mem_stat:
if "gpu" in mem_stat and gpu_memory != 0:
if gpu_memory <= 4:
cmd_opts.lowvram = True
default_offload_mode = "sequential"