Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
diffusers
Commits
c7514490
Unverified
Commit
c7514490
authored
Dec 27, 2023
by
Jianqi Pan
Committed by
GitHub
Dec 27, 2023
Browse files
fix: use retrieve_latents (#6337)
parent
c1e8bdf1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
examples/community/stable_diffusion_tensorrt_img2img.py
examples/community/stable_diffusion_tensorrt_img2img.py
+2
-1
No files found.
examples/community/stable_diffusion_tensorrt_img2img.py
View file @
c7514490
...
...
@@ -50,6 +50,7 @@ from diffusers.pipelines.stable_diffusion import (
StableDiffusionPipelineOutput
,
StableDiffusionSafetyChecker
,
)
from
diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_img2img
import
retrieve_latents
from
diffusers.schedulers
import
DDIMScheduler
from
diffusers.utils
import
logging
...
...
@@ -608,7 +609,7 @@ class TorchVAEEncoder(torch.nn.Module):
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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment