patrickvonplaten commited on
Commit
2499f23
β€’
1 Parent(s): 7302472

Apply suggestions from code review

Browse files

Former-commit-id: 536eb1a8ba9e7e3806727cc25331d43b1f076f07

Files changed (1) hide show
  1. scripts/txt2img.py +1 -2
scripts/txt2img.py CHANGED
@@ -237,9 +237,7 @@ def main():
237
  if opt.fixed_code:
238
  start_code = torch.randn([opt.n_samples, opt.C, opt.H // opt.f, opt.W // opt.f], device=device)
239
 
240
- print("start code", start_code.abs().sum())
241
  precision_scope = autocast if opt.precision=="autocast" else nullcontext
242
- precision_scope = nullcontext
243
  with torch.no_grad():
244
  with precision_scope("cuda"):
245
  with model.ema_scope():
@@ -288,6 +286,7 @@ def main():
288
  Image.fromarray(grid.astype(np.uint8)).save(os.path.join(outpath, f'grid-{grid_count:04}.png'))
289
  grid_count += 1
290
 
 
291
  image = x_samples_ddim.cpu().permute(0, 2, 3, 1).numpy()
292
 
293
  # run safety checker
 
237
  if opt.fixed_code:
238
  start_code = torch.randn([opt.n_samples, opt.C, opt.H // opt.f, opt.W // opt.f], device=device)
239
 
 
240
  precision_scope = autocast if opt.precision=="autocast" else nullcontext
 
241
  with torch.no_grad():
242
  with precision_scope("cuda"):
243
  with model.ema_scope():
 
286
  Image.fromarray(grid.astype(np.uint8)).save(os.path.join(outpath, f'grid-{grid_count:04}.png'))
287
  grid_count += 1
288
 
289
+ toc = time.time()
290
  image = x_samples_ddim.cpu().permute(0, 2, 3, 1).numpy()
291
 
292
  # run safety checker