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
OpenDAS
diffusers
Commits
f57a2e07
Unverified
Commit
f57a2e07
authored
Dec 02, 2022
by
Dhruv Naik
Committed by
GitHub
Dec 02, 2022
Browse files
Fix Imagic example (#1520)
fix typo, remove incorrect arguments from .train()
parent
3ceaa280
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
examples/community/README.md
examples/community/README.md
+4
-6
No files found.
examples/community/README.md
View file @
f57a2e07
...
@@ -411,7 +411,7 @@ pipe = DiffusionPipeline.from_pretrained(
...
@@ -411,7 +411,7 @@ pipe = DiffusionPipeline.from_pretrained(
custom_pipeline
=
"imagic_stable_diffusion"
,
custom_pipeline
=
"imagic_stable_diffusion"
,
scheduler
=
DDIMScheduler
(
beta_start
=
0.00085
,
beta_end
=
0.012
,
beta_schedule
=
"scaled_linear"
,
clip_sample
=
False
,
set_alpha_to_one
=
False
)
scheduler
=
DDIMScheduler
(
beta_start
=
0.00085
,
beta_end
=
0.012
,
beta_schedule
=
"scaled_linear"
,
clip_sample
=
False
,
set_alpha_to_one
=
False
)
).
to
(
device
)
).
to
(
device
)
generator
=
th
.
Generator
(
"cuda"
).
manual_seed
(
0
)
generator
=
t
orc
h
.
Generator
(
"cuda"
).
manual_seed
(
0
)
seed
=
0
seed
=
0
prompt
=
"A photo of Barack Obama smiling with a big grin"
prompt
=
"A photo of Barack Obama smiling with a big grin"
url
=
'https://www.dropbox.com/s/6tlwzr73jd1r9yk/obama.png?dl=1'
url
=
'https://www.dropbox.com/s/6tlwzr73jd1r9yk/obama.png?dl=1'
...
@@ -421,17 +421,15 @@ init_image = init_image.resize((512, 512))
...
@@ -421,17 +421,15 @@ init_image = init_image.resize((512, 512))
res
=
pipe
.
train
(
res
=
pipe
.
train
(
prompt
,
prompt
,
image
=
init_image
,
image
=
init_image
,
guidance_scale
=
7.5
,
num_inference_steps
=
50
,
generator
=
generator
)
generator
=
generator
)
res
=
pipe
(
alpha
=
1
)
res
=
pipe
(
alpha
=
1
,
guidance_scale
=
7.5
,
num_inference_steps
=
50
)
os
.
makedirs
(
"imagic"
,
exist_ok
=
True
)
os
.
makedirs
(
"imagic"
,
exist_ok
=
True
)
image
=
res
.
images
[
0
]
image
=
res
.
images
[
0
]
image
.
save
(
'./imagic/imagic_image_alpha_1.png'
)
image
.
save
(
'./imagic/imagic_image_alpha_1.png'
)
res
=
pipe
(
alpha
=
1.5
)
res
=
pipe
(
alpha
=
1.5
,
guidance_scale
=
7.5
,
num_inference_steps
=
50
)
image
=
res
.
images
[
0
]
image
=
res
.
images
[
0
]
image
.
save
(
'./imagic/imagic_image_alpha_1_5.png'
)
image
.
save
(
'./imagic/imagic_image_alpha_1_5.png'
)
res
=
pipe
(
alpha
=
2
)
res
=
pipe
(
alpha
=
2
,
guidance_scale
=
7.5
,
num_inference_steps
=
50
)
image
=
res
.
images
[
0
]
image
=
res
.
images
[
0
]
image
.
save
(
'./imagic/imagic_image_alpha_2.png'
)
image
.
save
(
'./imagic/imagic_image_alpha_2.png'
)
```
```
...
...
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