Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xy grid panel background color #175

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions nodes/functions_graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,15 +455,15 @@ def random_rgb():
return rgb_string


def make_grid_panel(images, max_columns):
def make_grid_panel(images, max_columns, color=0):

# Calculate dimensions for the grid
num_images = len(images)
num_rows = (num_images - 1) // max_columns + 1
combined_width = max(image.width for image in images) * min(max_columns, num_images)
combined_height = max(image.height for image in images) * num_rows

combined_image = Image.new('RGB', (combined_width, combined_height))
combined_image = Image.new('RGB', (combined_width, combined_height), color=color)

x_offset, y_offset = 0, 0 # Initialize offsets
for image in images:
Expand Down
2 changes: 1 addition & 1 deletion nodes/nodes_graphics_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def make_panel(self, images,
# Apply borders and outlines to each image
images = apply_outline_and_border(images, outline_thickness, outline_color, border_thickness, border_color)

combined_image = make_grid_panel(images, max_columns)
combined_image = make_grid_panel(images, max_columns, border_color)

image_out = pil2tensor(combined_image)

Expand Down