Skip to content

Commit c1fad36

Browse files
uP
1 parent 05f7b88 commit c1fad36

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

docs/source/api/diffusion_pipeline.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ Any pipeline object can be saved locally with [`~DiffusionPipeline.save_pretrain
3232
[[autodoc]] DiffusionPipeline
3333
- from_pretrained
3434
- save_pretrained
35+
- to
36+
- device
37+
- components
3538

3639
## ImagePipelineOutput
3740
By default diffusion pipelines return an object of class

docs/source/api/pipelines/stable_diffusion.mdx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,26 @@ For more details about how Stable Diffusion works and how it differs from the ba
1717
| [pipeline_stable_diffusion_img2img.py](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py) | *Image-to-Image Text-Guided Generation* | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/image_2_image_using_diffusers.ipynb) | [🤗 Diffuse the Rest](https://huggingface.co/spaces/huggingface/diffuse-the-rest)
1818
| [pipeline_stable_diffusion_inpaint.py](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py) | **Experimental***Text-Guided Image Inpainting* | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/in_painting_with_stable_diffusion_using_diffusers.ipynb) | Coming soon
1919

20+
## Tips
21+
22+
If you want to use all possible use cases in a single `DiffusionPipeline` you can either:
23+
- Make use of the [Stable Diffusion Mega Pipeline](https://github.com/huggingface/diffusers/tree/main/examples/community#stable-diffusion-mega) or
24+
- Make use of the `components` functionality to instantiate all components in the most memory-efficient way:
25+
26+
```python
27+
>>> from diffusers import (
28+
... StableDiffusionPipeline,
29+
... StableDiffusionImg2ImgPipeline,
30+
... StableDiffusionInpaintPipeline,
31+
... )
32+
33+
>>> img2text = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4")
34+
>>> img2img = StableDiffusionImg2ImgPipeline(**img2text.components)
35+
>>> inpaint = StableDiffusionInpaintPipeline(**img2text.components)
36+
37+
>>> # now you can use img2text(...), img2img(...), inpaint(...) just like the call methods of each respective pipeline
38+
```
39+
2040
## StableDiffusionPipelineOutput
2141
[[autodoc]] pipelines.stable_diffusion.StableDiffusionPipelineOutput
2242

0 commit comments

Comments
 (0)