Denoising Diffusion Implicit Models (DDIM) by Jiaming Song, Chenlin Meng and Stefano Ermon.
The abstract of the paper is the following:
Denoising diffusion probabilistic models (DDPMs) have achieved high quality image generation without adversarial training, yet they require simulating a Markov chain for many steps to produce a sample. To accelerate sampling, we present denoising diffusion implicit models (DDIMs), a more efficient class of iterative implicit probabilistic models with the same training procedure as DDPMs. In DDPMs, the generative process is defined as the reverse of a Markovian diffusion process. We construct a class of non-Markovian diffusion processes that lead to the same training objective, but whose reverse process can be much faster to sample from. We empirically demonstrate that DDIMs can produce high quality samples 10× to 50× faster in terms of wall-clock time compared to DDPMs, allow us to trade off computation for sample quality, and can perform semantically meaningful image interpolation directly in the latent space.
The original codebase of this paper can be found here: ermongroup/ddim. For questions, feel free to contact the author on tsong.me.
|pipeline_ddim.py||Unconditional Image Generation||-|
class diffusers.DDIMPipeline< source >
( unet scheduler )
- unet (UNet2DModel) — U-Net architecture to denoise the encoded image.
scheduler (SchedulerMixin) —
A scheduler to be used in combination with
unetto denoise the encoded image. Can be one of DDPMScheduler, or DDIMScheduler.
This model inherits from DiffusionPipeline. Check the superclass documentation for the generic methods the library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)
__call__< source >
batch_size: int = 1
generator: typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None
eta: float = 0.0
num_inference_steps: int = 50
use_clipped_model_output: typing.Optional[bool] = None
output_type: typing.Optional[str] = 'pil'
return_dict: bool = True
int, optional, defaults to 1) — The number of images to generate.
torch.Generator, optional) — One or a list of torch generator(s) to make generation deterministic.
float, optional, defaults to 0.0) — The eta parameter which controls the scale of the variance (0 is DDIM and 1 is one type of DDPM).
int, optional, defaults to 50) — The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference.
bool, optional, defaults to
None) — if
False, see documentation for
None, nothing is passed downstream to the scheduler. So use
Nonefor schedulers which don’t support this argument.
str, optional, defaults to
"pil") — The output format of the generate image. Choose between PIL:
bool, optional, defaults to
True) — Whether or not to return a ImagePipelineOutput instead of a plain tuple.
True, otherwise a `tuple. When returning a tuple, the first element is a list with the generated images.