Skip to content

Commit

Permalink
Merge PR #502 from Kosinkadink/develop
Browse files Browse the repository at this point in the history
Fix some calls for PIA, FancyVideo, AnimateLCM-I2V, and CameraControl not being refactored properly in PR
  • Loading branch information
Kosinkadink authored Dec 3, 2024
2 parents 2a5bb72 + 8b1afce commit edb939f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions animatediff/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ def perform_special_model_features(self, model: BaseModel, conds: list, x_in: Te
for special_model in special_models:
if special_model.model.is_in_effect():
attachment = get_mm_attachment(special_model)
if attachment.is_pia():
if attachment.is_pia(special_model):
special_model.model.inject_unet_conv_in_pia_fancyvideo(model)
conds = get_conds_with_c_concat(conds,
attachment.get_pia_c_concat(model, x_in))
elif attachment.is_fancyvideo():
elif attachment.is_fancyvideo(special_model):
# TODO: handle other weights
special_model.model.inject_unet_conv_in_pia_fancyvideo(model)
conds = get_conds_with_c_concat(conds,
Expand All @@ -90,9 +90,9 @@ def restore_special_model_features(self, model: BaseModel):
if len(special_models) > 0:
for special_model in reversed(special_models):
attachment = get_mm_attachment(special_model)
if attachment.is_pia():
if attachment.is_pia(special_model):
special_model.model.restore_unet_conv_in_pia_fancyvideo(model)
elif attachment.is_fancyvideo():
elif attachment.is_fancyvideo(special_model):
# TODO: fill out
special_model.model.restore_unet_conv_in_pia_fancyvideo(model)

Expand Down Expand Up @@ -189,8 +189,9 @@ def _apply_model_wrapper(executor, *args, **kwargs):
ADGS: AnimateDiffGlobalState = transformer_options["ADGS"]
if ADGS.motion_models is not None:
for motion_model in ADGS.motion_models.models:
motion_model.prepare_alcmi2v_features(x=x, cond_or_uncond=cond_or_uncond, ad_params=ad_params, latent_format=executor.class_obj.latent_format)
motion_model.prepare_camera_features(x=x, cond_or_uncond=cond_or_uncond, ad_params=ad_params)
attachment = get_mm_attachment(motion_model)
attachment.prepare_alcmi2v_features(motion_model, x=x, cond_or_uncond=cond_or_uncond, ad_params=ad_params, latent_format=executor.class_obj.latent_format)
attachment.prepare_camera_features(motion_model, x=x, cond_or_uncond=cond_or_uncond, ad_params=ad_params)
del x
return executor(*args, **kwargs)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "comfyui-animatediff-evolved"
description = "Improved AnimateDiff integration for ComfyUI."
version = "1.3.0"
version = "1.3.1"
license = { file = "LICENSE" }
dependencies = []

Expand Down

0 comments on commit edb939f

Please sign in to comment.