ou’re running inference in parallel over 2 GPUs, then the world_size is 2. Move the DiffusionPipeline to rank and use get_rank to assign a GPU to each process, where each process handles a different prompt:   Copied def run_inference(rank, world_size):
    dist.init_process_group("nccl", rank=rank, world_size=world_size)

    sd.to(rank)

    if torch.distributed.get_rank() == 0:
        prompt = "a dog"
    elif torch.distributed.get_rank() ==