 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
Start with batch_size=4 and see how much memory you’ve consumed:


	Copied
images = pipeline(**get_inputs(batch_size=4)).images
image_grid(images)
Unless you have a GPU with more RAM, the code above probably returned an OOM error! Most of the memory is taken up by the