Skip to content

Commit fcb2ec8

Browse files
Fix typos and minor redundancies (huggingface#2029)
fix typos and minor redundancies Co-authored-by: Patrick von Platen <[email protected]>
1 parent 013955b commit fcb2ec8

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def check_inputs(self, prompt, strength, callback_steps):
397397
raise ValueError(f"`prompt` has to be of type `str` or `list` but is {type(prompt)}")
398398

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

402402
if (callback_steps is None) or (
403403
callback_steps is not None and (not isinstance(callback_steps, int) or callback_steps <= 0)

src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_upscale.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ def __call__(
499499
# perform guidance
500500
if do_classifier_free_guidance:
501501
noise_pred_uncond, noise_pred_text = noise_pred.chunk(2)
502-
noise_pred = noise_pred_uncond + guidance_scale * (noise_pred_text - noise_pred_uncond)
502+
noise_pred = noise_pred_uncond + guidance_scale * (noise_pred_text - noise_pred_uncond)
503503

504504
# compute the previous noisy sample x_t -> x_t-1
505505
latents = self.scheduler.step(noise_pred, t, latents, **extra_step_kwargs).prev_sample

src/diffusers/schedulers/scheduling_ddim.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def step(
327327
variance_noise = randn_tensor(
328328
model_output.shape, generator=generator, device=device, dtype=model_output.dtype
329329
)
330-
variance = self._get_variance(timestep, prev_timestep) ** (0.5) * eta * variance_noise
330+
variance = std_dev_t * variance_noise
331331

332332
prev_sample = prev_sample + variance
333333

0 commit comments

Comments
 (0)