cocktailpeanut commited on
Commit
7122033
1 Parent(s): 4692982
Files changed (1) hide show
  1. gradio_demo/app.py +4 -1
gradio_demo/app.py CHANGED
@@ -164,7 +164,10 @@ def instantir_restore(
164
  else:
165
  lq = [resize_img(lq.convert("RGB"), size=None)]
166
 
167
- generator = torch.Generator(device=device).manual_seed(seed)
 
 
 
168
  timesteps = [
169
  i * (1000//steps) + pipe.scheduler.config.steps_offset for i in range(0, steps)
170
  ]
 
164
  else:
165
  lq = [resize_img(lq.convert("RGB"), size=None)]
166
 
167
+ if cpu_offload:
168
+ generator = torch.Generator(device=device).manual_seed(seed)
169
+ else:
170
+ generator = torch.Generator().manual_seed(seed)
171
  timesteps = [
172
  i * (1000//steps) + pipe.scheduler.config.steps_offset for i in range(0, steps)
173
  ]