"vscode:/vscode.git/clone" did not exist on "a9a5b14f3560596e34ce960e74ff29cc6b6a22e1"
Unverified Commit 3228eb16 authored by Suraj Patil's avatar Suraj Patil Committed by GitHub
Browse files

allow pndm scheduler to be used with ldm pipeline (#165)

parent c1488ff3
......@@ -79,7 +79,7 @@ class LDMTextToImagePipeline(DiffusionPipeline):
noise_pred = noise_pred_uncond + guidance_scale * (noise_prediction_text - noise_pred_uncond)
# compute the previous noisy sample x_t -> x_t-1
latents = self.scheduler.step(noise_pred, t, latents, eta)["prev_sample"]
latents = self.scheduler.step(noise_pred, t, latents, eta=eta)["prev_sample"]
# scale and decode the image latents with vae
latents = 1 / 0.18215 * latents
......
......@@ -116,6 +116,7 @@ class PNDMScheduler(SchedulerMixin, ConfigMixin):
model_output: Union[torch.FloatTensor, np.ndarray],
timestep: int,
sample: Union[torch.FloatTensor, np.ndarray],
**kwargs,
):
if self.counter < len(self.prk_timesteps):
return self.step_prk(model_output=model_output, timestep=timestep, sample=sample)
......
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