"...ldm/git@developer.sourcefind.cn:chenpangpang/ComfyUI.git" did not exist on "21f04fe632a5192d8f29f1bc0c852b24eb9dce2f"
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):
return log_sigma.exp()
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)
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