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
97fcc4c6
Unverified
Commit
97fcc4c6
authored
Jun 15, 2022
by
Patrick von Platen
Committed by
GitHub
Jun 15, 2022
Browse files
Update README.md
parent
cee56cc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
README.md
README.md
+2
-2
No files found.
README.md
View file @
97fcc4c6
...
...
@@ -98,7 +98,7 @@ num_prediction_steps = len(noise_scheduler)
for
t
in
tqdm
.
tqdm
(
reversed
(
range
(
num_prediction_steps
)),
total
=
num_prediction_steps
):
# predict noise residual
with
torch
.
no_grad
():
residual
=
unet
(
image
,
t
)
residual
=
unet
(
image
,
t
)
# predict previous mean of image x_t-1
pred_prev_image
=
noise_scheduler
.
step
(
residual
,
image
,
t
)
...
...
@@ -107,7 +107,7 @@ for t in tqdm.tqdm(reversed(range(num_prediction_steps)), total=num_prediction_s
variance
=
0
if
t
>
0
:
noise
=
torch
.
randn
(
image
.
shape
,
generator
=
generator
).
to
(
image
.
device
)
variance
=
noise_scheduler
.
get_variance
(
t
).
sqrt
()
*
noise
variance
=
noise_scheduler
.
get_variance
(
t
).
sqrt
()
*
noise
# set current image to prev_image: x_t -> x_t-1
image
=
pred_prev_image
+
variance
...
...
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