MCPcopy Create free account
hub / github.com/Francis-Rings/StableAnimator / create_image_grid

Function create_image_grid

train.py:80–94  ·  view source on GitHub ↗
(images, rows, cols, target_size=(256, 256))

Source from the content-addressed store, hash-verified

78 return image
79
80def create_image_grid(images, rows, cols, target_size=(256, 256)):
81 valid_images = [validate_and_convert_image(img, target_size) for img in images]
82 valid_images = [img for img in valid_images if img is not None]
83
84 if not valid_images:
85 print("No valid images to create a grid")
86 return None
87
88 w, h = target_size
89 grid = Image.new('RGB', size=(cols * w, rows * h))
90
91 for i, image in enumerate(valid_images):
92 grid.paste(image, box=((i % cols) * w, (i // cols) * h))
93
94 return grid
95
96def save_combined_frames(batch_output, validation_images, validation_control_images,output_folder):
97 # Flatten batch_output, which is a list of lists of PIL Images

Callers 1

save_combined_framesFunction · 0.70

Calls 1

Tested by

no test coverage detected