1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-29 07:22:12 +03:00

Remove previous denoised prediction from callback.

This commit is contained in:
Pedro Cuenca
2022-11-21 17:00:03 +01:00
parent 530c1b8c4b
commit 0249d03a0a
2 changed files with 3 additions and 3 deletions

View File

@@ -511,11 +511,11 @@ class StableDiffusionPipeline(DiffusionPipeline):
noise_pred = noise_pred_uncond + guidance_scale * (noise_pred_text - noise_pred_uncond)
# compute the previous noisy sample x_t -> x_t-1
latents, t, pred_original_sample = self.scheduler.step(noise_pred, t, latents, return_dict=False, **extra_step_kwargs)
latents, t = self.scheduler.step(noise_pred, t, latents, return_dict=False, **extra_step_kwargs)
# call the callback, if provided
if callback is not None and i % callback_steps == 0:
callback(i, t, latents, pred_original_sample)
callback(i, t, latents)
i += 1

View File

@@ -194,7 +194,7 @@ class HeunDiscreteScheduler(SchedulerMixin, ConfigMixin):
print(f"step_index: {step_index}, state_in_first_order: {self.state_in_first_order}, sigma: {sigma}, sigma_next: {sigma_next}, sigma_hat: {sigma_hat}, dt: {dt}")
if not return_dict:
return (prev_sample, self.timesteps[step_index], pred_original_sample)
return (prev_sample, self.timesteps[step_index])
return SchedulerOutput(prev_sample=prev_sample, timestep=self.timesteps[step_index])