Skip to content

Commit 91e01b7

Browse files
authored
added pndm docs (huggingface#391)
for issue huggingface#293
1 parent 3c7667d commit 91e01b7

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

pipelines/pndm/pipeline_pndm.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@
2525

2626

2727
class PNDMPipeline(DiffusionPipeline):
28+
r"""
29+
This model inherits from [`DiffusionPipeline`]. Check the superclass documentation for the generic methods the
30+
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)
31+
32+
Parameters:
33+
unet (:obj:`UNet2DModel`): U-Net architecture to denoise the encoded image latents.
34+
scheduler ([`SchedulerMixin`]):
35+
The `PNDMScheduler` to be used in combination with `unet` to denoise the encoded image.
36+
"""
37+
2838
unet: UNet2DModel
2939
scheduler: PNDMScheduler
3040

@@ -43,6 +53,23 @@ def __call__(
4353
return_dict: bool = True,
4454
**kwargs,
4555
) -> Union[ImagePipelineOutput, Tuple]:
56+
r"""
57+
Args:
58+
batch_size (:obj:`int`, `optional`, defaults to 1): The number of images to generate.
59+
num_inference_steps (:
60+
obj:`int`, `optional`, defaults to 50): The number of denoising steps. More denoising steps usually
61+
lead to a higher quality image at the expense of slower inference.
62+
generator (:
63+
obj:`torch.Generator`, `optional`): A [torch
64+
generator](https://pytorch.org/docs/stable/generated/torch.Generator.html) to make generation
65+
deterministic.
66+
output_type (:
67+
obj:`str`, `optional`, defaults to :obj:`"pil"`): The output format of the generate image. Choose
68+
between [PIL](https://pillow.readthedocs.io/en/stable/): `PIL.Image.Image` or `nd.array`.
69+
return_dict (:
70+
obj:`bool`, `optional`, defaults to :obj:`True`): Whether or not to return a
71+
[`~pipeline_utils.ImagePipelineOutput`] instead of a plain tuple.
72+
"""
4673
# For more information on the sampling method you can take a look at Algorithm 2 of
4774
# the official paper: https://arxiv.org/pdf/2202.09778.pdf
4875

0 commit comments

Comments
 (0)