n42 commited on
Commit
31a81b3
·
1 Parent(s): 937a5c6

fix cpu offload not working

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -197,7 +197,7 @@ def run_inference(config, config_history, progress=gr.Progress(track_tqdm=True))
197
  num_inference_steps = int(config["inference_steps"]),
198
  guidance_scale = float(config["guidance_scale"])).images
199
 
200
- if str(config["use_safetensors"]).lower() != 'false':
201
  pipeline.enable_model_cpu_offload()
202
 
203
  if config['refiner'].lower() != 'none':
@@ -207,7 +207,7 @@ def run_inference(config, config_history, progress=gr.Progress(track_tqdm=True))
207
  image=image,
208
  ).images
209
 
210
- if str(config["use_safetensors"]).lower() != 'false':
211
  refiner.enable_model_cpu_offload()
212
 
213
  config_history.append(config.copy())
 
197
  num_inference_steps = int(config["inference_steps"]),
198
  guidance_scale = float(config["guidance_scale"])).images
199
 
200
+ if str(config["cpu_offload"]).lower() != 'false':
201
  pipeline.enable_model_cpu_offload()
202
 
203
  if config['refiner'].lower() != 'none':
 
207
  image=image,
208
  ).images
209
 
210
+ if str(config["cpu_offload"]).lower() != 'false':
211
  refiner.enable_model_cpu_offload()
212
 
213
  config_history.append(config.copy())