Skip to content

Commit

Permalink
Fix typos and minor redundancies (open-mmlab#2029)
Browse files Browse the repository at this point in the history
fix typos and minor redundancies

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
  • Loading branch information
Joqsan and patrickvonplaten committed Jan 19, 2023
1 parent 013955b commit fcb2ec8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def check_inputs(self, prompt, strength, callback_steps):
raise ValueError(f"`prompt` has to be of type `str` or `list` but is {type(prompt)}")

if strength < 0 or strength > 1:
raise ValueError(f"The value of strength should in [1.0, 1.0] but is {strength}")
raise ValueError(f"The value of strength should in [0.0, 1.0] but is {strength}")

if (callback_steps is None) or (
callback_steps is not None and (not isinstance(callback_steps, int) or callback_steps <= 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ def __call__(
# perform guidance
if do_classifier_free_guidance:
noise_pred_uncond, noise_pred_text = noise_pred.chunk(2)
noise_pred = noise_pred_uncond + guidance_scale * (noise_pred_text - noise_pred_uncond)
noise_pred = noise_pred_uncond + guidance_scale * (noise_pred_text - noise_pred_uncond)

# compute the previous noisy sample x_t -> x_t-1
latents = self.scheduler.step(noise_pred, t, latents, **extra_step_kwargs).prev_sample
Expand Down
2 changes: 1 addition & 1 deletion src/diffusers/schedulers/scheduling_ddim.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def step(
variance_noise = randn_tensor(
model_output.shape, generator=generator, device=device, dtype=model_output.dtype
)
variance = self._get_variance(timestep, prev_timestep) ** (0.5) * eta * variance_noise
variance = std_dev_t * variance_noise

prev_sample = prev_sample + variance

Expand Down

0 comments on commit fcb2ec8

Please sign in to comment.