Skip to content

feat(anima): Anima Controlnets + Inpainting Adapter#9284

Open
kappacommit wants to merge 8 commits into
invoke-ai:mainfrom
kappacommit:anima-inpainting
Open

feat(anima): Anima Controlnets + Inpainting Adapter#9284
kappacommit wants to merge 8 commits into
invoke-ai:mainfrom
kappacommit:anima-inpainting

Conversation

@kappacommit

@kappacommit kappacommit commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds support for kohya-ss's ControlNet-LLLite adapters for Anima — small add-on models (8–66 MB) that bring two user-facing improvements:

  • Better inpainting and outpainting. With the new optional Inpaint Adapter (Advanced settings), the model is conditioned on the surrounding image and the results blend in cleanly. In fixed-seed side-by-side tests, seam artifacts dropped by ~60% and the composition breaks disappeared.
  • Control layers for Anima. Sketch/scribble, lineart, depth, and pose adapters can now guide Anima generations from a drawing or reference image — the same Control Layer workflow as other model families.

All variants are available as one-click starter model installs, work with existing Anima setups, and add no measurable generation time. The inpaint adapter applies automatically when inpainting/outpainting on Canvas; control adapters are picked per control layer.

Under the hood: a new backend module (ported with attribution from kohya's Apache-2.0 reference implementation), model-manager registration that routes inpaint vs. control variants to the right pickers, an anima_lllite node, and canvas graph wiring for both surfaces.

Related Issues / Discussions

N/A — integrates https://huggingface.co/kohya-ss/Anima-LLLite (reference implementations: kohya-ss/ComfyUI-Anima-LLLite, kohya-ss/sd-scripts).

QA Instructions

Requires the Anima starter models (Base 1.0, Qwen3 0.6B encoder, QwenImage VAE).

  1. Inpainting Adapter
  • Install it via starter models
  • In the advanced section below the VAE/Encoder, select the inpainting adapter
  • Do inpainting just as you always would, apply an inpaint mask and go
  • Inpainting quality should appear marginally more coherent and logical
  1. Controlnets
  • Install via starter models
  • Use just as you would any other controlnet

Merge Plan

No DB schema changes. Redux changes are additive with defaults (no slice migration needed). The 7 commits are two logical stacks (inpainting adapter, then control layers) and can be reviewed in order.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • ❗Changes to a redux slice have a corresponding migration (not required — additive fields with defaults, per existing precedent)
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

🤖 Generated with Claude Code

Your Name and others added 7 commits June 9, 2026 20:50
Port of kohya-ss ControlNet-LLLite v2 for the Anima DiT (from the
Apache-2.0 ComfyUI-Anima-LLLite reference), restructured to build from
a safetensors state dict + metadata without a transformer instance so
it can live in the model cache. Binds to transformer Linears by path
regex with guaranteed restore, supports the 4-channel inpainting
conditioning (masked RGB + binary mask), and includes the
patch-padding-aware cond sizing helpers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
New ControlNet_Checkpoint_Anima_Config probed on the lllite_conditioning1./
lllite_dit_blocks_ key namespace (no overlap with SDXL LLLite or Z-Image
control), a loader that builds the adapter from metadata at the Anima
inference dtype, and an Anima LLLite Inpainting starter model entry for
kohya-ss/Anima-LLLite.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
New anima_lllite invocation (image + optional mask + model + weight +
step range) and an optional control_lllite input on anima_denoise
(v1.7.0). The conditioning image is built once per generation from the
actual latent dims, the adapter binds after LoRA patching, the
multiplier is step-range gated in both the Euler and scheduler-driver
paths, and restore/clear always run on exit since the adapter instance
is shared via the model cache.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds an Inpaint Adapter model picker + weight control to the Anima
advanced settings, and wires anima_lllite into the canvas inpaint and
outpaint graphs (all scaled/unscaled branches). The canvas denoise-limit
mask is white = keep, while LLLite expects white = inpaint, so the mask
is inverted via img_lerp before it reaches the adapter.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ControlNet_Checkpoint_Anima_Config records cond_in_channels at probe time
(metadata with conv1-shape fallback) so the UI can route inpaint (4ch) and
general control (3ch) variants to different surfaces; null means installed
before this field existed. Adds starter entries for the remaining LLLite
variants: Sketch (any-test-like-v2) plus the Preview3-era depth, scribble,
lineart and pose adapters.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
control_lllite now takes a single field or a list (v1.8.0). Adapters are
sorted by model key for deterministic composition, applied in order after
LoRA patching, gated per-step by their own weight and step range, and
restored in reverse order with per-adapter exception isolation since the
bind chain is only safe to unwind LIFO. Duplicate adapter models are
rejected because the model cache shares one instance per key.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds the anima_lllite control-adapter type to control layers, lifts the
hard unsupported-base block for Anima (t2i/control-lora still warn), and
routes models by conditioning channels: 3ch adapters appear in control
layers, 4ch and legacy installs in the Inpaint Adapter picker. Control
layers and the inpaint adapter feed a shared collect node into the
denoise list input across all generation modes, and duplicate adapter
models block Invoke with a per-layer warning.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions github-actions Bot added python PRs that change python files invocations PRs that change invocations backend PRs that change backend files frontend PRs that change frontend files python-tests PRs that change python tests labels Jun 10, 2026
@kappacommit kappacommit changed the title feat(anima): ControlNet-LLLite support (inpainting adapter + control layers) feat(anima): Anima Controlnets + Inpainting Adapter Jun 10, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend PRs that change backend files frontend PRs that change frontend files invocations PRs that change invocations python PRs that change python files python-tests PRs that change python tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant