allow pndm scheduler to be used with ldm pipeline (#165)
This commit is contained in:
parent
c1488ff348
commit
3228eb1609
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue