Extensions/Anima Adapter Loader
ComfyUI Extension

Anima Adapter Loader

Supported by anima_lora trainer daemon, this introduces simplified comfyui ui for training in background.

By sorryhyun·Created 8 months ago·Updated about an hour ago· 152
sorryhyun/anima_lora
Nodes—
On cloudLocal install
Stars152
Updatedabout an hour ago
Readme

anima_lora

New: MOSS-Image LoRA. Train LoRAs for OpenMOSS's 5B MOSS-Image on a 16 GB card at 1.1 s/step, with Spectrum sampling (2.6×) — make gui, Model set to MOSS-Image. A separate line from Anima.

🛠️ Install: English · 한국어 · 日本語 · 中文

📖 Guidebook: English · 한국어 · 日本語 · 中文

<p align="center"> <img src="docs/gui.png" alt="Anima LoRA GUI — training-config editor with method/variant picker, inline method help, and live training monitor" width="900"> </p>

LoRA / T-LoRA training and inference engine for the Anima diffusion model (DiT, flow matching).

Install

One line: installs uv, picks NVIDIA CUDA or AMD ROCm on Windows, fetches the latest release, runs uv sync and opens the GUI (no git needed).

# Linux / macOS
curl -LsSf https://github.com/sorryhyun/anima_lora/releases/latest/download/install.sh | sh
# Windows (PowerShell)
irm https://github.com/sorryhyun/anima_lora/releases/latest/download/install.ps1 | iex

Sign in to Hugging Face and download models from the GUI. Requirements, checksum-verified and pinned installs, and the manual clone path: Advanced installation.

Features

Diagrams for every method: docs/anima/structure_images/, prose walkthroughs in docs/anima/structure/.

Fast training

MOSS-Image, fast and accurate: 13 GB peak VRAM · 1.1 s/step on an RTX 5070 Ti (rank 32, 1024²), against 1.6 s/step on bf16 at the same peak, with lower prediction error than bf16 at every σ tested (1.62% vs 1.93% at σ = 0.5). A LoRA freezes the base, so its linears run as GPTQ-calibrated int8 ConvRot GEMMs in both directions, over an fp32 residual stream. Details: training_step.md, accuracy.

Anima (bf16): 13.4 GB peak VRAM · 1.1 s/step on an RTX 5060 Ti (rank 32, 1 MP). Per-block torch.compile with a dynamic sequence axis (one graph per token-count tier), fused QKV/KV, an activation memory budget instead of gradient checkpointing, and a compile-clean hot path. Details: for_compile.md.

Anima's fp32 stream. The residual stream, modulation, q / k norms, RoPE, embedder and head run in fp32, and the block GEMMs and FlashAttention branch off it in int8 or bf16. Details: fp32_stream.md.

On by default

| Feature | Doc | |---|---| | LoRA with SVD-Down init (down_init = "weight_svd") | svd-down-lora.md | | T-LoRA timestep rank masking | timestep_mask.md | | Channel scaling (channel_scaling_alpha = 0.5, Adam-specific) | channel_scaling.md | | Free-fit native-aspect bucketing (the only resize mode) | for_compile.md | | AdaLN low-rank delta (train_adaln, provisional) | adaln.md | | CJK vocab pack (Japanese text in captions and images) | cjk_vocab_pack.md |

LoRA and T-LoRA bake losslessly into a standalone DiT: make merge [ADAPTER_DIR=… MULTIPLIER=0.8].

Inference stacks

Training-free; each composes with any checkpoint. Overview: docs/anima/inference/.

| Method | Doc | |---|---| | Spectrum — feature forecasting, ≈1.75× (ComfyUI node) | spectrum.md | | SMC-CFG — sliding-mode CFG correction | smc_cfg.md | | Modulation guidance | mod-guidance.md | | SPD — progressive multi-resolution sampling | spd.md | | Embedding inversion | invert.md |

Training stacks

| Method | Doc | |---|---| | HydraLoRA — multi-head LoRA with per-sample routing (ComfyUI node) | hydra-lora.md | | Turbo — DP-DMD few-step distillation, output is a normal LoRA (4-step student) | turbo.md | | Soft Tokens (experimental) | soft_tokens.md | | DirectEdit + Anima Tagger (experimental) | directedit_editing_v3.md | | EasyControl (experimental) | easycontrol.md |

Want to contribute? EasyControl adapters (canny / depth / pose / …, one PR per control type) — see CONTRIBUTING.md → Priority areas.

Usage

make gui                  # config editor + dataset browser + training monitor
make preprocess           # resize + cache latents / text embeddings
make lora                 # or PRESET=low_vram make lora
make test                 # sample with the latest LoRA

Config chain: configs/base.toml → configs/presets.toml[<preset>] → configs/methods/<method>.toml → CLI args. Flags: training.md, inference.md. All docs: docs/.

Advanced installation

Requirements: NVIDIA Ampere or newer with driver ≥595 (Python 3.13 + PyTorch 2.14 + CUDA 13.2). Windows ROCm targets RDNA 4 (gfx1200 / gfx1201; certified on RX 9060 XT / 9070 XT) with PyTorch 2.13 + ROCm 10.0.

The installer writes to ./anima_lora/ (ANIMA_DIR overrides) and, on Windows, adds an "Anima LoRA GUI" desktop shortcut. Force the backend with $env:ANIMA_BACKEND='cuda' or 'rocm'. Pin a release with ANIMA_VERSION=<tag>. Update in place with make update.

<details> <summary><b>Safer install</b> — verify the script before running</summary>

Every release ships a checksums.txt (SHA-256 of the installers and source archives).

# Linux / macOS
curl -fLO https://github.com/sorryhyun/anima_lora/releases/latest/download/install.sh
curl -fLO https://github.com/sorryhyun/anima_lora/releases/latest/download/checksums.txt
grep install.sh checksums.txt | sha256sum -c -    # must print "install.sh: OK"
less install.sh
sh install.sh
# Windows (PowerShell)
iwr https://github.com/sorryhyun/anima_lora/releases/latest/download/install.ps1 -OutFile install.ps1
iwr https://github.com/sorryhyun/anima_lora/releases/latest/download/checksums.txt -OutFile checksums.txt
(Get-FileHash install.ps1 -Algorithm SHA256).Hash.ToLower()   # compare against checksums.txt
notepad install.ps1
powershell -ExecutionPolicy Bypass -File .\install.ps1
</details>

Manual (from a clone)

uv sync                                                    # CUDA (default, every platform)
uv sync --no-group cuda-windows --group rocm-windows       # Windows AMD only
uv sync --no-default-groups --group torch-213              # older torch (or torch-212)
uv sync --no-default-groups --group fa2-sm120              # RTX 50-series only: patched FlashAttention in the venv
make sync                                                  # same, with the torch stack picked from the GPU (below)

hf auth login             # or sign in from the GUI
make download-models      # DiT, TE, VAE, PE-Spatial, CJK vocab pack, tagger, tag DB → models/
make download-list        # installed vs missing; SAM3 and OCR are opt-in
  • A plain uv sync installs the default stack. make sync and make update sync the stack saved in .anima_torch; with no file yet they pick it from the hardware (Linux x86_64 with an RTX 50-series card: fa2-sm120, or fa2-sm120-fp32div when libstdc++ is new enough for the kitchen wheel below) and save it. ANIMA_TORCH=2.13 make sync picks one by hand. ROCm users repeat the same --group flags on every later manual uv sync.
  • The manual CUDA path does not install the CUDA 13.2 toolkit that torch.compile / Triton needs: see installation guide, Appendix B.
  • Install with uv sync against the committed uv.lock, not pip install: pip ignores uv's index strategy and the prebuilt flash-attn wheels.
  • Optional, Linux x86_64: comfy-kitchen with the INT8 activation fix (comfy-kitchen#289). The int8 DiT linears then skip their fp32 input copy at the same output, and the int8 backward and the MOSS int8 text encoder divide in fp32. The trainer detects the kernel at runtime; the stock one keeps working. Needs libstdc++ from GCC 13+ (Ubuntu 24.04+). It ships in the fa2-sm120-fp32div stack (uv sync --no-default-groups --group fa2-sm120-fp32div, or ANIMA_TORCH=2.14-sm120-fp32div make sync), which make sync picks by itself on an RTX 50-series Linux box that meets the libstdc++ floor.

Try it in the browser

anima-turbo-webgpu.vercel.app runs Anima Turbo 4-step (v4, int8 ONNX) on your own GPU through WebGPU, with no install. The model files (3.2 GB) download once from Hugging Face and are cached in the browser; on an RTX 5070 Ti a 768² image takes about 3 s. Needs desktop Chrome / Edge or a recent Android Chrome with shader-f16. On Linux with an NVIDIA card, launch Chrome with --enable-features=Vulkan --enable-dawn-features=vulkan_enable_f16_on_nvidia. Source: project/webgpu_int8/demo/.

License

Toolkit code: MIT.

Portions are derived from kohya-ss/sd-scripts (Apache License 2.0) and remain under it — full text in LICENSE-APACHE, attribution and a statement of modifications in NOTICE. Thanks to kohya-ss and the sd-scripts contributors.

Anima / CircleStone base model weights ship under the CircleStone Labs Non-Commercial License v1.0 and are not relicensed by this repo. Any LoRA, fine-tune, or merged checkpoint trained from them is a Derivative and inherits the non-commercial terms. See NOTICE.