mirror of
https://github.com/huggingface/diffusers.git
synced 2026-01-27 17:22:53 +03:00
[RF inversion community pipeline] add eta_decay (#10199)
* add decay * add decay * style
This commit is contained in:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user