Skip to content

Commit ad3344e

Browse files
authored
Update pipeline_flux.py
1 parent b66e691 commit ad3344e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/diffusers/pipelines/flux/pipeline_flux.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,7 @@ def __call__(
555555
width: Optional[int] = None,
556556
num_inference_steps: int = 28,
557557
timesteps: List[int] = None,
558+
sigmas: List[float] = None,
558559
guidance_scale: float = 3.5,
559560
num_images_per_prompt: Optional[int] = 1,
560561
generator: Optional[Union[torch.Generator, List[torch.Generator]]] = None,
@@ -589,6 +590,10 @@ def __call__(
589590
Custom timesteps to use for the denoising process with schedulers which support a `timesteps` argument
590591
in their `set_timesteps` method. If not defined, the default behavior when `num_inference_steps` is
591592
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.
592597
guidance_scale (`float`, *optional*, defaults to 7.0):
593598
Guidance scale as defined in [Classifier-Free Diffusion Guidance](https://arxiv.org/abs/2207.12598).
594599
`guidance_scale` is defined as `w` of equation 2. of [Imagen
@@ -699,7 +704,7 @@ def __call__(
699704
)
700705

701706
# 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
703708
image_seq_len = latents.shape[1]
704709
mu = calculate_shift(
705710
image_seq_len,

0 commit comments

Comments
 (0)