Skip to content

Commit 7f2b21b

Browse files
committed
add to doc
1 parent 3097441 commit 7f2b21b

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docs/source/en/api/pipelines/sana_sprint.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,41 @@ image.save("sana.png")
8888

8989
Users can tweak the `max_timesteps` value for experimenting with the visual quality of the generated outputs. The default `max_timesteps` value was obtained with an inference-time search process. For more details about it, check out the paper.
9090

91+
## Image to Image
92+
The [`SanaSprintImg2ImgPipeline`] is a pipeline for image-to-image generation. It takes an input image and a prompt, and generates a new image based on the input image and the prompt.
93+
94+
```py
95+
import torch
96+
from diffusers import SanaSprintImg2ImgPipeline
97+
from diffusers.utils.loading_utils import load_image
98+
99+
image = load_image(
100+
"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/penguin.png"
101+
)
102+
103+
pipe = SanaSprintImg2ImgPipeline.from_pretrained(
104+
"Efficient-Large-Model/Sana_Sprint_1.6B_1024px_diffusers",
105+
torch_dtype=torch.bfloat16)
106+
pipe.to("cuda")
107+
108+
image = pipe(prompt="a cute pink bear",
109+
image=image,
110+
strength=0.5, height=832, width=480).images[0]
111+
image[0].save("output.png")
112+
```
113+
91114
## SanaSprintPipeline
92115

93116
[[autodoc]] SanaSprintPipeline
94117
- all
95118
- __call__
96119

120+
## SanaSprintImg2ImgPipeline
121+
122+
[[autodoc]] SanaSprintImg2ImgPipeline
123+
- all
124+
- __call__
125+
97126

98127
## SanaPipelineOutput
99128

0 commit comments

Comments
 (0)