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
cef0e367
Unverified
Commit
cef0e367
authored
Dec 13, 2024
by
Linoy Tsaban
Committed by
GitHub
Dec 13, 2024
Browse files
[RF inversion community pipeline] add eta_decay (#10199)
* add decay * add decay * style
parent
ec9bfa9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
examples/community/pipeline_flux_rf_inversion.py
examples/community/pipeline_flux_rf_inversion.py
+5
-6
No files found.
examples/community/pipeline_flux_rf_inversion.py
View file @
cef0e367
...
...
@@ -648,6 +648,8 @@ class RFInversionFluxPipeline(
height
:
Optional
[
int
]
=
None
,
width
:
Optional
[
int
]
=
None
,
eta
:
float
=
1.0
,
decay_eta
:
Optional
[
bool
]
=
False
,
eta_decay_power
:
Optional
[
float
]
=
1.0
,
strength
:
float
=
1.0
,
start_timestep
:
float
=
0
,
stop_timestep
:
float
=
0.25
,
...
...
@@ -880,12 +882,9 @@ class RFInversionFluxPipeline(
v_t
=
-
noise_pred
v_t_cond
=
(
y_0
-
latents
)
/
(
1
-
t_i
)
eta_t
=
eta
if
start_timestep
<=
i
<
stop_timestep
else
0.0
if
start_timestep
<=
i
<
stop_timestep
:
# controlled vector field
v_hat_t
=
v_t
+
eta
*
(
v_t_cond
-
v_t
)
else
:
v_hat_t
=
v_t
if
decay_eta
:
eta_t
=
eta_t
*
(
1
-
i
/
num_inference_steps
)
**
eta_decay_power
# Decay eta over the loop
v_hat_t
=
v_t
+
eta_t
*
(
v_t_cond
-
v_t
)
# SDE Eq: 17 from https://arxiv.org/pdf/2410.10792
latents
=
latents
+
v_hat_t
*
(
sigmas
[
i
]
-
sigmas
[
i
+
1
])
...
...
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