From 0ca1a64cfccbb966b1167c978ee863a3a13f39c1 Mon Sep 17 00:00:00 2001 From: EllangoK Date: Sun, 5 Feb 2023 03:44:56 -0500 Subject: adds grid margins to xyz plot and prompt matrix --- modules/images.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/images.py b/modules/images.py index f4b20b28..c2ca8849 100644 --- a/modules/images.py +++ b/modules/images.py @@ -199,7 +199,7 @@ def draw_grid_annotations(im, width, height, hor_texts, ver_texts, margin=0): 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 + margin * (rows-1), im.height + pad_top + margin * (cols-1)), "white") + result = Image.new("RGB", (im.width + pad_left + margin * (cols-1), im.height + pad_top + margin * (rows-1)), "white") for row in range(rows): for col in range(cols): @@ -223,7 +223,7 @@ def draw_grid_annotations(im, width, height, hor_texts, ver_texts, margin=0): return result -def draw_prompt_matrix(im, width, height, all_prompts): +def draw_prompt_matrix(im, width, height, all_prompts, margin=0): prompts = all_prompts[1:] boundary = math.ceil(len(prompts) / 2) @@ -233,7 +233,7 @@ def draw_prompt_matrix(im, width, height, all_prompts): hor_texts = [[GridAnnotation(x, is_active=pos & (1 << i) != 0) for i, x in enumerate(prompts_horiz)] for pos in range(1 << len(prompts_horiz))] ver_texts = [[GridAnnotation(x, is_active=pos & (1 << i) != 0) for i, x in enumerate(prompts_vert)] for pos in range(1 << len(prompts_vert))] - return draw_grid_annotations(im, width, height, hor_texts, ver_texts) + return draw_grid_annotations(im, width, height, hor_texts, ver_texts, margin) def resize_image(resize_mode, im, width, height, upscaler_name=None): -- cgit v1.2.1