patrickvonplaten commited on
Commit
97f4a6d
β€’
1 Parent(s): a01639c

fix to numpy

Browse files

Former-commit-id: b9851783e5400900a5de8ad43cb6f407f2cd1e4d

Files changed (1) hide show
  1. scripts/txt2img.py +1 -1
scripts/txt2img.py CHANGED
@@ -266,7 +266,7 @@ def main():
266
 
267
  x_samples_ddim = model.decode_first_stage(samples_ddim)
268
  x_samples_ddim = torch.clamp((x_samples_ddim + 1.0) / 2.0, min=0.0, max=1.0)
269
- x_samples_ddim = x_samples_ddim.cpu().permute(0, 2, 3, 1)
270
 
271
  x_image = x_samples_ddim
272
  safety_checker_input = safety_feature_extractor(numpy_to_pil(x_image), return_tensors="pt")
 
266
 
267
  x_samples_ddim = model.decode_first_stage(samples_ddim)
268
  x_samples_ddim = torch.clamp((x_samples_ddim + 1.0) / 2.0, min=0.0, max=1.0)
269
+ x_samples_ddim = x_samples_ddim.cpu().permute(0, 2, 3, 1).numpy()
270
 
271
  x_image = x_samples_ddim
272
  safety_checker_input = safety_feature_extractor(numpy_to_pil(x_image), return_tensors="pt")