parsee-mizuhashi commited on
Commit
6cf3c37
1 Parent(s): d16e3f6

Update comfy/model_management.py

Browse files
Files changed (1) hide show
  1. comfy/model_management.py +3 -4
comfy/model_management.py CHANGED
@@ -21,7 +21,7 @@ class CPUState(Enum):
21
  # Determine VRAM State
22
  vram_state = VRAMState.NORMAL_VRAM
23
  set_vram_to = VRAMState.NORMAL_VRAM
24
- cpu_state = CPUState.GPU
25
 
26
  total_vram = 0
27
 
@@ -115,7 +115,7 @@ def get_total_memory(dev=None, torch_total_too=False):
115
  else:
116
  return mem_total
117
 
118
- total_vram = get_total_memory(get_torch_device()) / (1024 * 1024)
119
  total_ram = psutil.virtual_memory().total / (1024 * 1024)
120
  print("Total VRAM {:0.0f} MB, total RAM {:0.0f} MB".format(total_vram, total_ram))
121
  if not args.normalvram and not args.cpu:
@@ -209,8 +209,7 @@ elif args.novram:
209
  set_vram_to = VRAMState.NO_VRAM
210
  elif args.highvram or args.gpu_only:
211
  vram_state = VRAMState.HIGH_VRAM
212
-
213
- FORCE_FP32 = False
214
  FORCE_FP16 = False
215
  if args.force_fp32:
216
  print("Forcing FP32, if this improves things please report it.")
 
21
  # Determine VRAM State
22
  vram_state = VRAMState.NORMAL_VRAM
23
  set_vram_to = VRAMState.NORMAL_VRAM
24
+ cpu_state = CPUState.CPU
25
 
26
  total_vram = 0
27
 
 
115
  else:
116
  return mem_total
117
 
118
+ total_vram = 0
119
  total_ram = psutil.virtual_memory().total / (1024 * 1024)
120
  print("Total VRAM {:0.0f} MB, total RAM {:0.0f} MB".format(total_vram, total_ram))
121
  if not args.normalvram and not args.cpu:
 
209
  set_vram_to = VRAMState.NO_VRAM
210
  elif args.highvram or args.gpu_only:
211
  vram_state = VRAMState.HIGH_VRAM
212
+ FORCE_FP32 = True
 
213
  FORCE_FP16 = False
214
  if args.force_fp32:
215
  print("Forcing FP32, if this improves things please report it.")