Skip to content

[Naming] correct config naming of DDIM pipeline #187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/diffusers/schedulers/scheduling_ddim.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(
trained_betas=None,
timestep_values=None,
clip_sample=True,
clip_alpha_at_one=True,
set_alpha_to_one=True,
tensor_format="pt",
):

Expand All @@ -79,9 +79,9 @@ def __init__(

# At every step in ddim, we are looking into the previous alphas_cumprod
# For the final step, there is no previous alphas_cumprod because we are already at 0
# `clip_alpha_at_one` decides whether we set this paratemer simply to one or
# `set_alpha_to_one` decides whether we set this paratemer simply to one or
# whether we use the final alpha of the "non-previous" one.
self.final_alpha_cumprod = np.array(1.0) if clip_alpha_at_one else self.alphas_cumprod[0]
self.final_alpha_cumprod = np.array(1.0) if set_alpha_to_one else self.alphas_cumprod[0]

# setable values
self.num_inference_steps = None
Expand Down
2 changes: 1 addition & 1 deletion tests/test_modeling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ def test_stable_diffusion_fast_ddim(self):
beta_end=0.012,
beta_schedule="scaled_linear",
clip_sample=False,
clip_alpha_at_one=False,
set_alpha_to_one=False,
)
sd_pipe.scheduler = scheduler

Expand Down