Skip to content

Commit 1d57892

Browse files
authored
[docs] Callbacks (#6471)
edits
1 parent 3e8b632 commit 1d57892

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

docs/source/en/using-diffusers/callback.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,15 @@ With callbacks, you can implement features such as dynamic CFG without having to
6464

6565
</Tip>
6666

67+
## Interrupt the diffusion process
6768

68-
## Using Callbacks to interrupt the Diffusion Process
69+
Interrupting the diffusion process is particularly useful when building UIs that work with Diffusers because it allows users to stop the generation process if they're unhappy with the intermediate results. You can incorporate this into your pipeline with a callback.
6970

70-
The following Pipelines support interrupting the diffusion process via callback
71+
<Tip>
7172

72-
- [StableDiffusionPipeline](../api/pipelines/stable_diffusion/overview.md)
73-
- [StableDiffusionImg2ImgPipeline](..api/pipelines/stable_diffusion/img2img.md)
74-
- [StableDiffusionInpaintPipeline](..api/pipelines/stable_diffusion/inpaint.md)
75-
- [StableDiffusionXLPipeline](../api/pipelines/stable_diffusion/stable_diffusion_xl.md)
76-
- [StableDiffusionXLImg2ImgPipeline](../api/pipelines/stable_diffusion/stable_diffusion_xl.md)
77-
- [StableDiffusionXLInpaintPipeline](../api/pipelines/stable_diffusion/stable_diffusion_xl.md)
73+
The interruption callback is supported for text-to-image, image-to-image, and inpainting for the [StableDiffusionPipeline](../api/pipelines/stable_diffusion/overview) and [StableDiffusionXLPipeline](../api/pipelines/stable_diffusion/stable_diffusion_xl).
7874

79-
Interrupting the diffusion process is particularly useful when building UIs that work with Diffusers because it allows users to stop the generation process if they're unhappy with the intermediate results. You can incorporate this into your pipeline with a callback.
75+
</Tip>
8076

8177
This callback function should take the following arguments: `pipe`, `i`, `t`, and `callback_kwargs` (this must be returned). Set the pipeline's `_interrupt` attribute to `True` to stop the diffusion process after a certain number of steps. You are also free to implement your own custom stopping logic inside the callback.
8278

0 commit comments

Comments
 (0)