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
9a4d53a4
"cacheflow/git@developer.sourcefind.cn:norm/vllm.git" did not exist on "8917782af6a5892a0afb697badbe761dc8558619"
Unverified
Commit
9a4d53a4
authored
Jun 27, 2022
by
Patrick von Platen
Committed by
GitHub
Jun 27, 2022
Browse files
Update README.md
parent
ba264419
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
README.md
README.md
+26
-0
No files found.
README.md
View file @
9a4d53a4
...
@@ -234,6 +234,7 @@ See [paper](https://arxiv.org/abs/2011.13456) for more information on SDE VE.
...
@@ -234,6 +234,7 @@ See [paper](https://arxiv.org/abs/2011.13456) for more information on SDE VE.
from
diffusers
import
DiffusionPipeline
from
diffusers
import
DiffusionPipeline
import
torch
import
torch
import
PIL.Image
import
PIL.Image
import
numpy
as
np
torch
.
manual_seed
(
32
)
torch
.
manual_seed
(
32
)
...
@@ -249,6 +250,31 @@ image_pil = PIL.Image.fromarray(image[0])
...
@@ -249,6 +250,31 @@ image_pil = PIL.Image.fromarray(image[0])
# save image
# save image
image_pil
.
save
(
"test.png"
)
image_pil
.
save
(
"test.png"
)
```
```
#### **Example 32x32 image generation with SDE VP**
See
[
paper
](
https://arxiv.org/abs/2011.13456
)
for more information on SDE VE.
```
python
from
diffusers
import
DiffusionPipeline
import
torch
import
PIL.Image
import
numpy
as
np
torch
.
manual_seed
(
32
)
score_sde_sv
=
DiffusionPipeline
.
from_pretrained
(
"fusing/cifar10-ddpmpp-deep-vp"
)
# Note this might take up to 3 minutes on a GPU
image
=
score_sde_sv
(
num_inference_steps
=
1000
)
image
=
image
.
permute
(
0
,
2
,
3
,
1
).
cpu
().
numpy
()
image
=
np
.
clip
(
image
*
255
,
0
,
255
).
astype
(
np
.
uint8
)
image_pil
=
PIL
.
Image
.
fromarray
(
image
[
0
])
# save image
image_pil
.
save
(
"test.png"
)
```
#### **Text to Image generation with Latent Diffusion**
#### **Text to Image generation with Latent Diffusion**
...
...
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