From 36d72f3ae13ec2bcbd14e6bd6b8df821d3ff688e Mon Sep 17 00:00:00 2001 From: Jedrzej Kosinski Date: Tue, 21 Nov 2023 20:46:26 -0600 Subject: [PATCH] Make sure current_index exists, to match latest ComfyUI changes (backwards compatible) --- animatediff/sampling.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/animatediff/sampling.py b/animatediff/sampling.py index 3ab3321..d290434 100644 --- a/animatediff/sampling.py +++ b/animatediff/sampling.py @@ -100,7 +100,8 @@ def forward_timestep_embed( x = layer(x, context) elif isinstance(layer, SpatialTransformer): x = layer(x, context, transformer_options) - transformer_options["current_index"] += 1 + if "current_index" in transformer_options: + transformer_options["current_index"] += 1 elif isinstance(layer, openaimodel.Upsample): x = layer(x, output_shape=output_shape) else: