Unverified Commit fcb2ec8c authored by Joqsan's avatar Joqsan Committed by GitHub
Browse files

Fix typos and minor redundancies (#2029)



fix typos and minor redundancies
Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
parent 013955b5
......@@ -397,7 +397,7 @@ class StableDiffusionImg2ImgPipeline(DiffusionPipeline):
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)
......
......@@ -499,7 +499,7 @@ class StableDiffusionUpscalePipeline(DiffusionPipeline):
# 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
......
......@@ -327,7 +327,7 @@ class DDIMScheduler(SchedulerMixin, ConfigMixin):
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment