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
fb420664
Unverified
Commit
fb420664
authored
Jan 27, 2025
by
Giuseppe Catalano
Committed by
GitHub
Jan 27, 2025
Browse files
Revert RePaint scheduler 'fix' (#10644)
Co-authored-by:
Giuseppe Catalano
<
giuseppelorenzo.catalano@unito.it
>
parent
e89ab5bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
src/diffusers/schedulers/scheduling_repaint.py
src/diffusers/schedulers/scheduling_repaint.py
+5
-1
No files found.
src/diffusers/schedulers/scheduling_repaint.py
View file @
fb420664
...
@@ -319,7 +319,11 @@ class RePaintScheduler(SchedulerMixin, ConfigMixin):
...
@@ -319,7 +319,11 @@ class RePaintScheduler(SchedulerMixin, ConfigMixin):
prev_unknown_part
=
alpha_prod_t_prev
**
0.5
*
pred_original_sample
+
pred_sample_direction
+
variance
prev_unknown_part
=
alpha_prod_t_prev
**
0.5
*
pred_original_sample
+
pred_sample_direction
+
variance
# 8. Algorithm 1 Line 5 https://arxiv.org/pdf/2201.09865.pdf
# 8. Algorithm 1 Line 5 https://arxiv.org/pdf/2201.09865.pdf
prev_known_part
=
(
alpha_prod_t_prev
**
0.5
)
*
original_image
+
(
1
-
alpha_prod_t_prev
)
*
noise
# The computation reported in Algorithm 1 Line 5 is incorrect. Line 5 refers to formula (8a) of the same paper,
# which tells to sample from a Gaussian distribution with mean "(alpha_prod_t_prev**0.5) * original_image"
# and variance "(1 - alpha_prod_t_prev)". This means that the standard Gaussian distribution "noise" should be
# scaled by the square root of the variance (as it is done here), however Algorithm 1 Line 5 tells to scale by the variance.
prev_known_part
=
(
alpha_prod_t_prev
**
0.5
)
*
original_image
+
((
1
-
alpha_prod_t_prev
)
**
0.5
)
*
noise
# 9. Algorithm 1 Line 8 https://arxiv.org/pdf/2201.09865.pdf
# 9. Algorithm 1 Line 8 https://arxiv.org/pdf/2201.09865.pdf
pred_prev_sample
=
mask
*
prev_known_part
+
(
1.0
-
mask
)
*
prev_unknown_part
pred_prev_sample
=
mask
*
prev_known_part
+
(
1.0
-
mask
)
*
prev_unknown_part
...
...
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