Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
c6c659f2
Commit
c6c659f2
authored
Jun 09, 2022
by
anton-l
Browse files
improve the glide example
parent
02cdd683
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
models/vision/glide/modeling_glide.py
models/vision/glide/modeling_glide.py
+1
-1
models/vision/glide/run_glide.py
models/vision/glide/run_glide.py
+2
-1
No files found.
models/vision/glide/modeling_glide.py
View file @
c6c659f2
...
...
@@ -223,6 +223,6 @@ class GLIDE(DiffusionPipeline):
sampled_prev_image
=
prev_image
+
prev_variance
image
=
sampled_prev_image
image
=
image
[
0
]
.
permute
(
1
,
2
,
0
)
image
=
image
.
permute
(
0
,
2
,
3
,
1
)
return
image
models/vision/glide/run_glide.py
View file @
c6c659f2
...
...
@@ -11,9 +11,10 @@ model_id = "fusing/glide-base"
pipeline
=
DiffusionPipeline
.
from_pretrained
(
model_id
)
# run inference (text-conditioned denoising + upscaling)
img
=
pipeline
(
"a c
lip art of a hugging face
"
,
generator
)
img
=
pipeline
(
"a c
rayon drawing of a corgi
"
,
generator
)
# process image to PIL
img
=
img
.
squeeze
(
0
)
img
=
((
img
+
1
)
*
127.5
).
round
().
clamp
(
0
,
255
).
to
(
torch
.
uint8
).
cpu
().
numpy
()
image_pil
=
PIL
.
Image
.
fromarray
(
img
)
...
...
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