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.
TypeScript ai-artartificial-intelligencegenerative-artimage-generationimg2imginpaintinglatent-diffusionlinuxmacosoutpaintingstable-diffusiontxt2imgwindows
feat(anima): apply Anima LoRAs and LLLite adapters to the blocks the finetunes kept
Alexander Eichhornbc85648e7c82
diff --git a/docs/src/content/docs/Users Guide/03.Models/Local Models/anima.mdx b/docs/src/content/docs/Users Guide/03.Models/Local Models/anima.mdxindex 2260a44412..706c57b5a1 100644--- a/docs/src/content/docs/Users Guide/03.Models/Local Models/anima.mdx+++ b/docs/src/content/docs/Users Guide/03.Models/Local Models/anima.mdx@@ -75,11 +75,12 @@ file and is refused at install with a message that says so.Both finetunes are derivatives of Anima and fall under the same non-commercial license.-:::caution[LoRAs and LLLite adapters]-LoRAs and ControlNet-LLLite adapters trained on Anima address its transformer blocks by position. The-finetunes insert their extra blocks between the original ones, so from the third block on, such an-adapter patches different blocks than it was trained on. It loads and runs, but expect weaker or-different results than on Anima itself.+:::note[LoRAs and LLLite adapters]+LoRAs and ControlNet-LLLite adapters address the transformer's blocks by position, and the finetunes+insert their extra blocks between the original ones. Invoke moves an adapter trained on Anima to the+blocks the finetune kept from Anima, and one trained on Anima-2.9B to its blocks in Anima-3.8B.+Anima-2.9B keeps Anima's blocks unchanged, so Anima adapters work there as on Anima itself.+Anima-3.8B trained most of them further, so expect weaker or different results there.:::## Generation settingsdiff --git a/docs/src/content/docs/contributing/new-model-integration.mdx b/docs/src/content/docs/contributing/new-model-integration.mdxindex be2fe41cf8..f53f0e34d7 100644--- a/docs/src/content/docs/contributing/new-model-integration.mdx+++ b/docs/src/content/docs/contributing/new-model-integration.mdx@@ -971,7 +971,7 @@ Anima-2.9B (40 blocks instead of 28) needed only the second row. Anima-3.8B (526. **Unsupported releases.** Refuse a recognized checkpoint you do not support with `InvalidMatchError` and a pointer to the one you do.-7. **Existing adapters.** LoRAs and control adapters address blocks by name, and names carry the block index. A depth expansion that inserts blocks between the original ones shifts every index after the first insertion, so an adapter trained on the original loads and runs against the wrong blocks. Say so in the user guide; a remap needs the insertion positions, which only some checkpoints record.+7. **Existing adapters.** LoRAs and control adapters address blocks by name, and names carry the block index. A depth expansion that inserts blocks between the original ones shifts every index after the first insertion, so an adapter trained on the original loads and runs against the wrong blocks. A remap needs the insertion positions, and model cards rarely list them, but the weights do. Compare each block of the expanded checkpoint with the original's: a block that was not trained further is bit-identical to its source, and one trained further still has a cosine similarity near 1 to it, while an inserted copy stays far lower. Record the measured table next to the architecture (Anima: `invokeai/backend/anima/block_layout.py`), apply it where the adapter binds, and say in the user guide which results to expect.</Steps>:::tip[Checklist: Extending an architecture]{icon="approve-check"}diff --git a/invokeai/app/invocations/anima/anima_denoise.py b/invokeai/app/invocations/anima/anima_denoise.pyindex df3a13cec4..adc67402b0 100644--- a/invokeai/app/invocations/anima/anima_denoise.py+++ b/invokeai/app/invocations/anima/anima_denoise.py@@ -60,6 +60,7 @@ from invokeai.backend.flux.schedulers import (from invokeai.backend.model_manager.taxonomy import BaseModelTypefrom invokeai.backend.patches.layer_patcher import LayerPatcher, PatchSpecfrom invokeai.backend.patches.lora_conversions.anima_lora_constants import ANIMA_LORA_TRANSFORMER_PREFIX+from invokeai.backend.patches.lora_conversions.anima_lora_conversion_utils import anima_lora_for_depthfrom invokeai.backend.patches.model_patch_raw import ModelPatchRawfrom invokeai.backend.rectified_flow.rectified_flow_inpaint_extension import (RectifiedFlowInpaintExtension,@@ -761,7 +762,7 @@ class AnimaDenoiseInvocation(BaseInvocation):exit_stack.enter_context(LayerPatcher.apply_smart_model_patches(model=transformer,- patches=self._lora_iterator(context),+ patches=self._lora_iterator(context, len(transformer.blocks)),prefix=ANIMA_LORA_TRANSFORMER_PREFIX,dtype=inference_dtype,cached_weights=cached_weights,@@ -990,8 +991,12 @@ class AnimaDenoiseInvocation(BaseInvocation):return step_callback- def _lora_iterator(self, context: InvocationContext) -> Iterator[PatchSpec]:- """Iterate over LoRA models to apply to the transformer."""+ def _lora_iterator(self, context: InvocationContext, transformer_depth: int) -> Iterator[PatchSpec]:+ """Iterate over LoRA models to apply to the transformer.++ A LoRA trained on a shallower Anima has its blocks moved to where this depth-expanded model keeps+ them (see `invokeai.backend.anima.block_layout`).+ """for lora in self.transformer.loras:lora_info = context.models.load(lora.lora)if not isinstance(lora_info.model, ModelPatchRaw):@@ -999,4 +1004,11 @@ class AnimaDenoiseInvocation(BaseInvocation):f"Expected ModelPatchRaw for LoRA '{lora.lora.key}', got {type(lora_info.model).__name__}. ""The LoRA model may be corrupted or incompatible.")- yield (lora_info.model, lora.weight, lora_info.model_in_ram())+ patch, moved_from = anima_lora_for_depth(lora_info.model, transformer_depth)+ if moved_from is not None:+ name = lora_info.config.name if lora_info.config is not None else lora.lora.key+ context.logger.info(+ f"LoRA '{name}' was trained on a {moved_from}-block Anima; applying it to the "+ f"matching blocks of this {transformer_depth}-block model."+ )+ yield (patch, lora.weight, lora_info.model_in_ram())diff --git a/invokeai/backend/anima/block_layout.py b/invokeai/backend/anima/block_layout.pynew file mode 100644index 0000000000..2319f09b35--- /dev/null+++ b/invokeai/backend/anima/block_layout.py@@ -0,0 +1,47 @@+"""Where the depth-expanded Anima finetunes keep the blocks of the model they grew from.++Anima-2.9B and Anima-3.8B insert new DiT blocks between the existing ones (LLaMA-Pro style interleaved expansion),+so an adapter that addresses blocks by index -- a LoRA, a ControlNet-LLLite -- trained on the shallower model would,+from the third block on, patch different blocks than the ones it was trained on. These tables send it to the right+ones. Measured from the released checkpoints:++- Anima-2.9B-preview-v1 (40 blocks) holds all 28 blocks of Anima base-v1.0 bit for bit: its card says only the new+ layers were trained. The 12 new blocks sit at 2, 5, 8, 11, 14, 17, 21, 24, 27, 30, 33 and 36.+- Anima-3.8B v1.1 (52 blocks) holds the 40 blocks of Anima-2.9B nearly unchanged: each has a mean cosine similarity of+ at least 0.9997 to its 2.9B block, and 11 are bit-identical. The 12 new blocks, at 3, 7, 11, ..., 47, are at about+ 0.6 to the neighbor they were copied from. Ten blocks of Anima base-v1.0 are still bit-identical in it, all at the+ positions below.++Keyed by depth: these are the only depth-expanded Anima models. A future finetune with one of these depths but+another layout would need its own entry.+"""++from typing import Optional++ANIMA_BASE_DEPTH = 28++# (source depth, target depth) -> the target position of each source block.+_POSITIONS: dict[tuple[int, int], tuple[int, ...]] = {+ (28, 40): (0, 1, 3, 4, 6, 7, 9, 10, 12, 13, 15, 16, 18, 19, 20, 22, 23, 25, 26, 28, 29, 31, 32, 34, 35, 37, 38, 39),+ (40, 52): (+ 0, 1, 2, 4, 5, 6, 8, 9, 10, 12, 13, 14, 16, 17, 18, 20, 21, 22, 24, 25,+ 26, 28, 29, 30, 32, 33, 34, 36, 37, 38, 40, 41, 42, 44, 45, 46, 48, 49, 50, 51,+ ),+} # fmt: skip+_POSITIONS[(28, 52)] = tuple(_POSITIONS[(40, 52)][i] for i in _POSITIONS[(28, 40)])++KNOWN_DEPTHS = (28, 40, 52)+++def adapter_block_positions(max_block_index: int, target_depth: int) -> Optional[tuple[int, ...]]:+ """Where, in a `target_depth`-block model, the blocks of the model an adapter was trained on sit.++ The adapter's own depth is read off the highest block it addresses: the smallest known depth that has that block.+ An adapter trained on Anima base touches block 27; one trained on Anima-2.9B, a block past 27. Returns None when+ the adapter addresses blocks by index as before -- same depth, a deeper adapter than the model, or no layout for+ the pair.+ """+ source_depth = next((depth for depth in KNOWN_DEPTHS if depth > max_block_index), None)+ if source_depth is None or source_depth >= target_depth:+ return None+ return _POSITIONS.get((source_depth, target_depth))diff --git a/invokeai/backend/anima/control_net_lllite.py b/invokeai/backend/anima/control_net_lllite.pyindex dd36f2e5b2..df81822274 100644--- a/invokeai/backend/anima/control_net_lllite.py+++ b/invokeai/backend/anima/control_net_lllite.py@@ -32,6 +32,9 @@ import torchimport torch.nn.functional as Ffrom torch import nn+from invokeai.backend.anima.block_layout import adapter_block_positions+from invokeai.backend.util.logging import InvokeAILogger+ASPP_DEFAULT_DILATIONS: tuple[int, ...] = (1, 2, 4, 8)_SAVED_COND_PREFIX = "lllite_conditioning1."@@ -511,10 +514,21 @@ class AnimaControlNetLLLite(nn.Module):m.multiplier = multiplierdef apply_to(self, transformer: nn.Module) -> None:- """Swap the forward of each target Linear in ``transformer``. Idempotent."""+ """Swap the forward of each target Linear in ``transformer``. Idempotent.++ An adapter trained on a shallower Anima binds to the blocks where this depth-expanded model keeps+ them (see ``invokeai.backend.anima.block_layout``).+ """self.restore()+ depth = len(transformer.blocks)+ positions = adapter_block_positions(self._max_block_index(), depth)+ if positions is not None:+ InvokeAILogger.get_logger(__name__).info(+ f"ControlNet-LLLite addresses {self._max_block_index() + 1} blocks; binding it to the matching "+ f"blocks of this {depth}-block model."+ )for m in self.lllite_modules:- target = self._resolve_target(transformer, m.lllite_name)+ target = self._resolve_target(transformer, m.lllite_name, positions)if not isinstance(target, nn.Linear):raise TypeError(f"LLLite target for '{m.lllite_name}' is {type(target).__name__}, expected nn.Linear")if target.in_features != m.in_dim:@@ -536,12 +550,19 @@ class AnimaControlNetLLLite(nn.Module):for m in self.lllite_modules:m.unbind()+ def _max_block_index(self) -> int:+ return max(+ int(match.group(1)) for m in self.lllite_modules if (match := MODULE_NAME_PATTERN.match(m.lllite_name))+ )+@staticmethod- def _resolve_target(transformer: nn.Module, name: str) -> nn.Module:+ def _resolve_target(transformer: nn.Module, name: str, positions: Sequence[int] | None = None) -> nn.Module:match = MODULE_NAME_PATTERN.match(name)if match is None:raise ValueError(f"Unrecognized LLLite module name: '{name}'")block_idx = int(match.group(1))+ if positions is not None:+ block_idx = positions[block_idx]blocks = transformer.blocksif block_idx >= len(blocks):raise ValueError(diff --git a/invokeai/backend/patches/lora_conversions/anima_lora_conversion_utils.py b/invokeai/backend/patches/lora_conversions/anima_lora_conversion_utils.pyindex b55a96dca7..1707a2a212 100644--- a/invokeai/backend/patches/lora_conversions/anima_lora_conversion_utils.py+++ b/invokeai/backend/patches/lora_conversions/anima_lora_conversion_utils.py@@ -10,10 +10,11 @@ Some Anima LoRAs also target the Qwen3 text encoder with lora_te_ prefix keys"""import re-from typing import Dict+from typing import Dict, Optionalimport torch+from invokeai.backend.anima.block_layout import KNOWN_DEPTHS, adapter_block_positionsfrom invokeai.backend.patches.layers.base_layer_patch import BaseLayerPatchfrom invokeai.backend.patches.layers.utils import any_lora_layer_from_state_dictfrom invokeai.backend.patches.lora_conversions.anima_lora_constants import (@@ -298,3 +299,31 @@ def lora_model_from_anima_state_dict(state_dict: Dict[str, torch.Tensor], alpha:layers[final_key] = layerreturn ModelPatchRaw(layers=layers)+++_TRANSFORMER_BLOCK_KEY_RE = re.compile(rf"^{re.escape(ANIMA_LORA_TRANSFORMER_PREFIX)}blocks\.(\d+)\.")+++def anima_lora_for_depth(patch: ModelPatchRaw, target_depth: int) -> tuple[ModelPatchRaw, Optional[int]]:+ """The LoRA with its DiT block keys moved to where `target_depth`'s model keeps the blocks it was trained on.++ A LoRA trained on Anima base, applied to a depth-expanded finetune (see `invokeai.backend.anima.block_layout`),+ would otherwise patch the wrong blocks from the third one on. Returns the patch -- a new one sharing the layers,+ so the cached LoRA stays as it is -- and the depth it was moved from, or the patch itself and None when nothing+ moves. Only `blocks.N.` keys of the transformer move; the LLM adapter's own `llm_adapter.blocks.N.` and the text+ encoder's keys do not.+ """+ indices = [int(match.group(1)) for key in patch.layers if (match := _TRANSFORMER_BLOCK_KEY_RE.match(key))]+ if not indices:+ return patch, None+ positions = adapter_block_positions(max(indices), target_depth)+ if positions is None:+ return patch, None++ def moved(key: str) -> str:+ return _TRANSFORMER_BLOCK_KEY_RE.sub(+ lambda m: f"{ANIMA_LORA_TRANSFORMER_PREFIX}blocks.{positions[int(m.group(1))]}.", key, count=1+ )++ source_depth = next(depth for depth in KNOWN_DEPTHS if depth > max(indices))+ return ModelPatchRaw(layers={moved(key): layer for key, layer in patch.layers.items()}), source_depthdiff --git a/tests/backend/anima/test_block_layout.py b/tests/backend/anima/test_block_layout.pynew file mode 100644index 0000000000..2c86d5a20a--- /dev/null+++ b/tests/backend/anima/test_block_layout.py@@ -0,0 +1,63 @@+"""Where the depth-expanded Anima finetunes keep the blocks of the model they grew from."""++import pytest++from invokeai.backend.anima import block_layout+from invokeai.backend.anima.block_layout import adapter_block_positions++BASE_TO_2_9B = block_layout._POSITIONS[(28, 40)]+FROM_2_9B_TO_3_8B = block_layout._POSITIONS[(40, 52)]+BASE_TO_3_8B = block_layout._POSITIONS[(28, 52)]++[email protected](("source", "target"), [(28, 40), (40, 52), (28, 52)])+def test_every_source_block_has_its_own_target_block_in_order(source: int, target: int) -> None:+ positions = block_layout._POSITIONS[(source, target)]+ assert len(positions) == source+ assert list(positions) == sorted(set(positions))+ assert positions[0] == 0 and positions[-1] < target+++def test_the_new_blocks_sit_where_the_checkpoints_have_them() -> None:+ """Measured: in 2.9B, the blocks that are not bit-identical to an Anima base block; in 3.8B, the blocks at a cosine+ similarity of about 0.6 to every 2.9B block."""+ assert sorted(set(range(40)) - set(BASE_TO_2_9B)) == [2, 5, 8, 11, 14, 17, 21, 24, 27, 30, 33, 36]+ assert sorted(set(range(52)) - set(FROM_2_9B_TO_3_8B)) == list(range(3, 48, 4))+++def test_the_base_blocks_still_bit_identical_in_3_8b_are_where_the_composed_table_puts_them() -> None:+ """Ten blocks of Anima base-v1.0 are bit-identical in Anima-3.8B v1.1 -- an independent check of the composition."""+ measured = {5: 9, 7: 13, 10: 20, 14: 26, 15: 29, 19: 37, 21: 41, 22: 42, 23: 45, 27: 51}+ assert {base: BASE_TO_3_8B[base] for base in measured} == measured+++ ("max_block_index", "target_depth", "expected"),+ [+ (27, 40, BASE_TO_2_9B),+ (27, 52, BASE_TO_3_8B),+ (39, 52, FROM_2_9B_TO_3_8B),+ # A base LoRA that leaves out the last blocks still comes from a 28-block model.+ (20, 40, BASE_TO_2_9B),+ ],+ ids=["base-on-2.9B", "base-on-3.8B", "2.9B-on-3.8B", "partial-base-on-2.9B"],+)+def test_a_shallower_adapter_moves_to_the_blocks_it_was_trained_on(max_block_index, target_depth, expected) -> None:+ assert adapter_block_positions(max_block_index, target_depth) == expected+++ ("max_block_index", "target_depth"),+ [(27, 28), (39, 40), (51, 52), (39, 28), (51, 40), (60, 52), (27, 30)],+ ids=[+ "base-on-base",+ "2.9B-on-2.9B",+ "3.8B-on-3.8B",+ "deeper-adapter",+ "3.8B-on-2.9B",+ "unknown-depth",+ "no-layout",+ ],+)+def test_everything_else_addresses_blocks_by_index(max_block_index, target_depth) -> None:+ assert adapter_block_positions(max_block_index, target_depth) is Nonediff --git a/tests/backend/anima/test_control_net_lllite.py b/tests/backend/anima/test_control_net_lllite.pyindex f09b7f1a48..f64dd88e98 100644--- a/tests/backend/anima/test_control_net_lllite.py+++ b/tests/backend/anima/test_control_net_lllite.py@@ -3,6 +3,7 @@ state dict, exact-passthrough guarantees, forward-swap binding/restore,multi-adapter composition, and the conditioning image preprocessing helpers."""import os+import refrom pathlib import Pathimport pytest@@ -762,3 +763,47 @@ def test_from_state_dict_real_file() -> None:assert not torch.equal(y, plain_linear(linear, x))finally:module.unbind()+++# ----------------------------------------------------------------------------+# Depth-expanded finetunes+# ----------------------------------------------------------------------------+++def _adapter_for_blocks(*indices: int) -> AnimaControlNetLLLite:+ """The synthetic 2-block adapter, its blocks renamed to ``indices``."""+ renamed = {}+ for key, value in make_synthetic_state_dict().items():+ match = re.match(r"^lllite_dit_blocks_(\d+)_", key)+ if match:+ key = f"lllite_dit_blocks_{indices[int(match.group(1))]}_{key[match.end() :]}"+ renamed[key] = value+ return AnimaControlNetLLLite.from_state_dict(renamed, None)+++def _is_wrapped(model: AnimaControlNetLLLite, linear: nn.Linear) -> bool:+ x = torch.randn(1, 4, IN_DIM, generator=torch.Generator().manual_seed(5))+ model.set_multiplier(1.0)+ model.set_cond_image(matching_cond_image())+ return not torch.equal(linear(x), plain_linear(linear, x))+++def test_a_base_adapter_binds_to_the_base_blocks_of_anima_2_9b() -> None:+ """Anima base's block 27 is Anima-2.9B's block 39 (see ``invokeai.backend.anima.block_layout``)."""+ model = _adapter_for_blocks(0, 27)+ transformer = FakeTransformer(IN_DIM, 40)+ model.apply_to(transformer)++ assert _is_wrapped(model, transformer.blocks[39].self_attn.q_proj)+ assert not _is_wrapped(model, transformer.blocks[27].self_attn.q_proj)+ assert _is_wrapped(model, transformer.blocks[0].self_attn.q_proj)+ model.restore()+++def test_a_base_adapter_binds_by_index_on_anima_base() -> None:+ model = _adapter_for_blocks(0, 27)+ transformer = FakeTransformer(IN_DIM, 28)+ model.apply_to(transformer)++ assert _is_wrapped(model, transformer.blocks[27].self_attn.q_proj)+ model.restore()diff --git a/tests/backend/patches/lora_conversions/test_anima_lora_conversion_utils.py b/tests/backend/patches/lora_conversions/test_anima_lora_conversion_utils.pyindex 3d7972cda3..3bdfd6771d 100644--- a/tests/backend/patches/lora_conversions/test_anima_lora_conversion_utils.py+++ b/tests/backend/patches/lora_conversions/test_anima_lora_conversion_utils.py@@ -8,9 +8,11 @@ from invokeai.backend.patches.lora_conversions.anima_lora_constants import (from invokeai.backend.patches.lora_conversions.anima_lora_conversion_utils import (_convert_kohya_te_key,_convert_kohya_unet_key,+ anima_lora_for_depth,is_state_dict_likely_anima_lora,lora_model_from_anima_state_dict,)+from invokeai.backend.patches.model_patch_raw import ModelPatchRawfrom tests.backend.patches.lora_conversions.lora_state_dicts.anima_lora_kohya_format import (state_dict_keys as anima_kohya_keys,)@@ -228,3 +230,65 @@ def test_empty_state_dict_returns_empty_model():"""An empty state dict should produce a ModelPatchRaw with no layers."""lora_model = lora_model_from_anima_state_dict({})assert len(lora_model.layers) == 0+++# --- depth-expanded finetunes ------------------------------------------------------------------------+++def _patch(*keys: str) -> ModelPatchRaw:+ return ModelPatchRaw(layers={key: object() for key in keys}) # type: ignore[misc]+++T = ANIMA_LORA_TRANSFORMER_PREFIX+++def test_a_base_lora_moves_to_the_base_blocks_of_anima_2_9b() -> None:+ original = _patch(+ f"{T}blocks.0.self_attn.q_proj",+ f"{T}blocks.2.cross_attn.k_proj",+ f"{T}blocks.27.mlp.layer2",+ f"{T}llm_adapter.blocks.3.self_attn.q_proj",+ f"{ANIMA_LORA_QWEN3_PREFIX}layers.2.self_attn.q_proj",+ )+ moved, moved_from = anima_lora_for_depth(original, 40)++ assert moved_from == 28+ assert sorted(moved.layers) == sorted(+ [+ f"{T}blocks.0.self_attn.q_proj",+ f"{T}blocks.3.cross_attn.k_proj",+ f"{T}blocks.39.mlp.layer2",+ # The LLM adapter's own blocks and the text encoder are not DiT blocks.+ f"{T}llm_adapter.blocks.3.self_attn.q_proj",+ f"{ANIMA_LORA_QWEN3_PREFIX}layers.2.self_attn.q_proj",+ ]+ )+ # The same layer objects, and the cached LoRA itself untouched.+ assert set(map(id, moved.layers.values())) == set(map(id, original.layers.values()))+ assert f"{T}blocks.27.mlp.layer2" in original.layers+++def test_a_base_lora_moves_to_the_base_blocks_of_anima_3_8b() -> None:+ moved, moved_from = anima_lora_for_depth(_patch(f"{T}blocks.2.mlp.layer1", f"{T}blocks.27.mlp.layer1"), 52)+ assert moved_from == 28+ assert sorted(moved.layers) == [f"{T}blocks.4.mlp.layer1", f"{T}blocks.51.mlp.layer1"]+++def test_an_anima_2_9b_lora_moves_to_its_blocks_in_anima_3_8b() -> None:+ moved, moved_from = anima_lora_for_depth(_patch(f"{T}blocks.3.mlp.layer1", f"{T}blocks.39.mlp.layer1"), 52)+ assert moved_from == 40+ assert sorted(moved.layers) == [f"{T}blocks.4.mlp.layer1", f"{T}blocks.51.mlp.layer1"]+++ ("keys", "depth"),+ [+ ((f"{T}blocks.27.mlp.layer1",), 28),+ ((f"{T}blocks.39.mlp.layer1",), 40),+ ((f"{T}llm_adapter.blocks.0.self_attn.q_proj", f"{ANIMA_LORA_QWEN3_PREFIX}layers.0.mlp.up_proj"), 40),+ ],+ ids=["base-on-base", "2.9B-on-2.9B", "no-dit-blocks"],+)+def test_a_lora_for_this_depth_is_returned_as_it_is(keys, depth) -> None:+ original = _patch(*keys)+ assert anima_lora_for_depth(original, depth) == (original, None)