compute the directional similarity. Let’s first load the StableDiffusionInstructPix2PixPipeline:   Copied from diffusers import StableDiffusionInstructPix2PixPipeline

instruct_pix2pix_pipeline = StableDiffusionInstructPix2PixPipeline.from_pretrained(
    "timbrooks/instruct-pix2pix", torch_dtype=torch.float16
).to(device) Now, we perform the edits:   Copied import numpy as np


def edit_image(input_image, instruction):
    image = instruct_pix