From 59be6c815d39c46ad5a1bb50b26f454d5f34337d Mon Sep 17 00:00:00 2001 From: Muhammad Usama Date: Sun, 28 Aug 2022 15:39:09 +0100 Subject: [PATCH] bug fix in grid In case of 6 images 3rd image was also copied to 4th box missing the last image in the grid. --- ldm/dream/pngwriter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ldm/dream/pngwriter.py b/ldm/dream/pngwriter.py index 3a3f205512..9fd97c9053 100644 --- a/ldm/dream/pngwriter.py +++ b/ldm/dream/pngwriter.py @@ -88,10 +88,11 @@ class PngWriter: height = image_list[0].height grid_img = Image.new('RGB', (width * cols, height * rows)) + i = 0 for r in range(0, rows): for c in range(0, cols): - i = r * rows + c grid_img.paste(image_list[i], (c * width, r * height)) + i = i + 1 return grid_img