diff --git a/sdxl_gen_img.py b/sdxl_gen_img.py old mode 100644 new mode 100755 index 0152578b..35bd6c61 --- a/sdxl_gen_img.py +++ b/sdxl_gen_img.py @@ -761,6 +761,9 @@ class PipelineLike: # we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16 image = image.cpu().permute(0, 2, 3, 1).float().numpy() + if torch.cuda.is_available(): + torch.cuda.empty_cache() + if output_type == "pil": # image = self.numpy_to_pil(image) image = (image * 255).round().astype("uint8")