aboutsummaryrefslogtreecommitdiff
path: root/modules/images.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-01-25 11:56:26 +0300
committerGitHub <noreply@github.com>2023-01-25 11:56:26 +0300
commitd5ce044bcdd9593751d7e0ba28087247ff0b7926 (patch)
treeecb14124c6a2323181a2963f7296ceba3e5d9459 /modules/images.py
parent1bfec873fa13d803f3d4ac2a12bf6983838233fe (diff)
parentec8774729e17f87a8ffa5a3c5328d12834cbb02a (diff)
Merge pull request #7146 from EllangoK/master
Adds X/Y/Z Grid Script
Diffstat (limited to 'modules/images.py')
-rw-r--r--modules/images.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/images.py b/modules/images.py
index 3b1c5f34..0bc3d524 100644
--- a/modules/images.py
+++ b/modules/images.py
@@ -195,7 +195,7 @@ def draw_grid_annotations(im, width, height, hor_texts, ver_texts):
ver_text_heights = [sum([line.size[1] + line_spacing for line in lines]) - line_spacing * len(lines) for lines in
ver_texts]
- pad_top = max(hor_text_heights) + line_spacing * 2
+ pad_top = 0 if sum(hor_text_heights) == 0 else max(hor_text_heights) + line_spacing * 2
result = Image.new("RGB", (im.width + pad_left, im.height + pad_top), "white")
result.paste(im, (pad_left, pad_top))