, instruction):
    image = instruct_pix2pix_pipeline(
        instruction,
        image=input_image,
        output_type="numpy",
        generator=generator,
    ).images[0]
    return image


input_images = []
original_captions = []
modified_captions = []
edited_images = []

for idx in range(len(dataset)):
    input_image = dataset[idx]["image"]
    edit_instruction = dataset[idx]["edit"]
    edited_image = edit_image(input_image, edit_inst