mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-08 22:35:09 +00:00
fix: VRAM memory leak in sdxl_gen_img.py
This commit is contained in:
3
sdxl_gen_img.py
Normal file → Executable file
3
sdxl_gen_img.py
Normal file → Executable file
@@ -754,6 +754,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")
|
||||
|
||||
Reference in New Issue
Block a user