r function to display images in a grid.


	Copied
def image_grid(imgs, rows, cols):
    w, h = imgs[0].size
    grid = Image.new("RGB", size=(cols * w, rows * h))
    for i, img in enumerate(imgs):
        grid.paste(img, box=(i % cols * w, i // cols * h))
    return grid


	Copied
image_grid(images, 2, 4)


Using different prompts
	
We don’t have to replicate the same prompt in all the devices. We can do whatever we want: generate 2 prompts 4 