"...composable_kernel_rocm.git" did not exist on "29eaa2dc93a0d74d562e8960c99d226049dca06c"
Commit e032ca61 authored by comfyanonymous's avatar comfyanonymous
Browse files

Fix ddim issue with older torch versions.

parent 18885f80
...@@ -91,7 +91,9 @@ class DiscreteSchedule(nn.Module): ...@@ -91,7 +91,9 @@ class DiscreteSchedule(nn.Module):
return log_sigma.exp() return log_sigma.exp()
def predict_eps_discrete_timestep(self, input, t, **kwargs): def predict_eps_discrete_timestep(self, input, t, **kwargs):
sigma = self.t_to_sigma(t.round()) if t.dtype != torch.int64 and t.dtype != torch.int32:
t = t.round()
sigma = self.t_to_sigma(t)
input = input * ((utils.append_dims(sigma, input.ndim) ** 2 + 1.0) ** 0.5) input = input * ((utils.append_dims(sigma, input.ndim) ** 2 + 1.0) ** 0.5)
return (input - self(input, sigma, **kwargs)) / utils.append_dims(sigma, input.ndim) return (input - self(input, sigma, **kwargs)) / utils.append_dims(sigma, input.ndim)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment