Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use retrieve_latents #6337

Merged
merged 1 commit into from
Dec 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/community/stable_diffusion_tensorrt_img2img.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
StableDiffusionPipelineOutput,
StableDiffusionSafetyChecker,
)
from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_img2img import retrieve_latents
from diffusers.schedulers import DDIMScheduler
from diffusers.utils import logging

Expand Down Expand Up @@ -608,7 +609,7 @@ def __init__(self, model):
self.vae_encoder = model

def forward(self, x):
return self.vae_encoder.encode(x).latent_dist.sample()
return retrieve_latents(self.vae_encoder.encode(x))


class VAEEncoder(BaseModel):
Expand Down
Loading