Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Fix ddim issue with older torch versions.

comfyanonymouse032ca613859
diff --git a/comfy/k_diffusion/external.py b/comfy/k_diffusion/external.py
index 7335d56c4..c1a137d9c 100644
--- a/comfy/k_diffusion/external.py
+++ b/comfy/k_diffusion/external.py
@@ -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)