Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

fix(anima): ignore community checkpoint pos_embedder runtime buffers (#9201)

Lincoln Stein8fdb514d52c1
diff --git a/invokeai/backend/model_manager/load/model_loaders/anima.py b/invokeai/backend/model_manager/load/model_loaders/anima.py
index 94dc2dcc5a..8d068f5468 100644
--- a/invokeai/backend/model_manager/load/model_loaders/anima.py
+++ b/invokeai/backend/model_manager/load/model_loaders/anima.py
@@ -129,8 +129,17 @@ class AnimaCheckpointModel(ModelLoader):
if sd[k].is_floating_point():
sd[k] = sd[k].to(model_dtype)
- # Filter out rotary embedding inv_freq buffers that are regenerated at runtime
- keys_to_remove = [k for k in sd.keys() if k.endswith(".inv_freq")]
+ # Filter out tensors that are regenerated at runtime and therefore not part of the
+ # in-memory module state. Some community-trained checkpoints (e.g. animaCatTower_v10)
+ # serialize derived pos_embedder buffers/cached tensors that the official model
+ # registers as non-persistent (or recomputes locally).
+ runtime_only_suffixes = (
+ ".inv_freq",
+ "pos_embedder.dim_spatial_range",
+ "pos_embedder.dim_temporal_range",
+ "pos_embedder.seq",
+ )
+ keys_to_remove = [k for k in sd.keys() if k.endswith(runtime_only_suffixes)]
for k in keys_to_remove:
del sd[k]