comrender commited on
Commit
5720168
·
verified ·
1 Parent(s): e2e38fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -167,6 +167,7 @@ def enhance_image(
167
  pipe.enable_vae_tiling()
168
  pipe.enable_vae_slicing()
169
  if device == "cuda":
 
170
  pipe.enable_model_cpu_offload()
171
 
172
  if USE_ESRGAN:
@@ -191,7 +192,7 @@ def enhance_image(
191
  "black-forest-labs/FLUX.1-dev",
192
  torch_dtype=dtype,
193
  low_cpu_mem_usage=True,
194
- device_map="balanced"
195
  )
196
  pipe.enable_vae_tiling()
197
  pipe.enable_vae_slicing()
 
167
  pipe.enable_vae_tiling()
168
  pipe.enable_vae_slicing()
169
  if device == "cuda":
170
+ pipe.reset_device_map()
171
  pipe.enable_model_cpu_offload()
172
 
173
  if USE_ESRGAN:
 
192
  "black-forest-labs/FLUX.1-dev",
193
  torch_dtype=dtype,
194
  low_cpu_mem_usage=True,
195
+ device_map=None
196
  )
197
  pipe.enable_vae_tiling()
198
  pipe.enable_vae_slicing()