You are also free to implement your own custom stopping logic inside the callback. In this example, the diffusion process is stopped after 10 steps even though num_inference_steps is set to 50.   Copied from diffusers import StableDiffusionPipeline

pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
pipe.enable_model_cpu_offload()
num_inference_steps = 50

def interrupt_callback(pipe, i, t, callback_kwargs):
    st