GRID-6X : Layout for Seamless Image Assembly
•
6
transformers
once [#30530](https://github.com/huggingface/transformers/pull/30530) is merged. Huge shoutout to
@nielsr
and
@danelcsb
for bringing this to HF!infer
function:grid_img = Image.new('RGB', (width * grid_size_x, height * grid_size_y))
for i, img in enumerate(result.images[:num_images]):
grid_img.paste(img, (i % grid_size_x * width, i // grid_size_x * height))
grid_img
is a blank canvas that will hold the images in a grid format.(i % grid_size_x) * width
calculates the x-coordinate.(i // grid_size_x) * height
calculates the y-coordinate.infer
function:grid_img = Image.new('RGB', (width * grid_size_x, height * grid_size_y))
for i, img in enumerate(result.images[:num_images]):
grid_img.paste(img, (i % grid_size_x * width, i // grid_size_x * height))
grid_img
is a blank canvas that will hold the images in a grid format.(i % grid_size_x) * width
calculates the x-coordinate.(i // grid_size_x) * height
calculates the y-coordinate.BFL_API_KEY=your_actual_api_key_here
requests
python-dotenv
pip install -r requirements.txt
python generate_image.py