device)

with distributed_state.split_between_processes(["a dog", "a cat"]) as prompt:
    result = pipeline(prompt).images[0]
    result.save(f"result_{distributed_state.process_index}.png") Use the --num_processes argument to specify the number of GPUs to use, and call accelerate launch to run the script:   Copied accelerate launch run_distributed.py --num_processes=2 To learn more, take a look at the Distributed Inference with 🤗 Accelerate g