Prevent potential int overflow in SaveImage

This commit is contained in:
comfyanonymous 2023-03-11 12:48:28 -05:00
parent 44294a446e
commit 1f717903bc
1 changed files with 1 additions and 1 deletions

View File

@ -790,7 +790,7 @@ class SaveImage:
paths = list()
for image in images:
i = 255. * image.cpu().numpy()
img = Image.fromarray(i.astype(np.uint8))
img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8))
metadata = PngInfo()
if prompt is not None:
metadata.add_text("prompt", json.dumps(prompt))