f get_inputs(batch_size=1):
    generator = [torch.Generator("cuda").manual_seed(i) for i in range(batch_size)]
    prompts = batch_size * [prompt]
    num_inference_steps = 20

    return {"prompt": prompts, "generator": generator, "num_inference_steps": num_inference_steps} Start with batch_size=4 and see how much memory you’ve consumed:   Copied from diffusers.utils import make_image_grid

images = pipeline(**get_inputs(batch_size=4)).images