@@ -555,6 +555,7 @@ def __call__(
555
555
width : Optional [int ] = None ,
556
556
num_inference_steps : int = 28 ,
557
557
timesteps : List [int ] = None ,
558
+ sigmas : List [float ] = None ,
558
559
guidance_scale : float = 3.5 ,
559
560
num_images_per_prompt : Optional [int ] = 1 ,
560
561
generator : Optional [Union [torch .Generator , List [torch .Generator ]]] = None ,
@@ -589,6 +590,10 @@ def __call__(
589
590
Custom timesteps to use for the denoising process with schedulers which support a `timesteps` argument
590
591
in their `set_timesteps` method. If not defined, the default behavior when `num_inference_steps` is
591
592
passed will be used. Must be in descending order.
593
+ sigmas (`List[float]`, *optional*):
594
+ Custom sigmas to use for the denoising process with schedulers which support a `sigmas` argument in
595
+ their `set_timesteps` method. If not defined, the default behavior when `num_inference_steps` is passed
596
+ will be used.
592
597
guidance_scale (`float`, *optional*, defaults to 7.0):
593
598
Guidance scale as defined in [Classifier-Free Diffusion Guidance](https://arxiv.org/abs/2207.12598).
594
599
`guidance_scale` is defined as `w` of equation 2. of [Imagen
@@ -699,7 +704,7 @@ def __call__(
699
704
)
700
705
701
706
# 5. Prepare timesteps
702
- sigmas = np .linspace (1.0 , 1 / num_inference_steps , num_inference_steps )
707
+ sigmas = np .linspace (1.0 , 1 / num_inference_steps , num_inference_steps ) if sigmas is None and timesteps is None else sigmas
703
708
image_seq_len = latents .shape [1 ]
704
709
mu = calculate_shift (
705
710
image_seq_len ,
0 commit comments