Fix SDE inference producing noise when shift != 1.0
#3
by
FabioSarracino
- opened
modeling_acestep_v15_base.py
CHANGED
|
@@ -1941,8 +1941,7 @@ class AceStepConditionGenerationModel(AceStepPreTrainedModel):
|
|
| 1941 |
# Stochastic Differential Equation: predict clean, then re-add noise
|
| 1942 |
t_curr_bsz = t_curr * torch.ones((bsz,), device=device, dtype=dtype)
|
| 1943 |
pred_clean = self.get_x0_from_noise(xt, vt, t_curr_bsz)
|
| 1944 |
-
|
| 1945 |
-
xt = self.renoise(pred_clean, next_timestep)
|
| 1946 |
elif infer_method == "ode":
|
| 1947 |
# Ordinary Differential Equation: Euler method
|
| 1948 |
# dx/dt = -v, so x_{t+1} = x_t - v_t * dt
|
|
|
|
| 1941 |
# Stochastic Differential Equation: predict clean, then re-add noise
|
| 1942 |
t_curr_bsz = t_curr * torch.ones((bsz,), device=device, dtype=dtype)
|
| 1943 |
pred_clean = self.get_x0_from_noise(xt, vt, t_curr_bsz)
|
| 1944 |
+
xt = self.renoise(pred_clean, t_prev)
|
|
|
|
| 1945 |
elif infer_method == "ode":
|
| 1946 |
# Ordinary Differential Equation: Euler method
|
| 1947 |
# dx/dt = -v, so x_{t+1} = x_t - v_t * dt
|