--- license: apache-2.0 base_model: circlestone-labs/Anima tags: - lora - distillation - anime - text-to-image - anima library_name: diffusers --- # Anima Distillation LoRAs [CircleStone Labs / Anima v1.0](https://huggingface.co/circlestone-labs/Anima) (2B パラメータ DiT、Cosmos-Predict2 派生) 用の **蒸留 LoRA コレクション**。 4-step / CFG=1.0 で teacher 品質に近づける各手法を順次追加していく。 ## Available LoRAs | サブディレクトリ | 手法 | 推奨 step / CFG | ステータス | 詳細 | |---|---|---|---|---| | [`pcm/`](pcm) | Phased Consistency Model | 4-step / CFG=1.0 | ✅ 配布中 (5000 step、$22) | [pcm/README.md](pcm/README.md) | | `dmd2/` (近日) | DMD2 + TrigFlow (cosmos-predict2.5) | 4-step / CFG=1.0 | 🟢 訓練中 (resume after step 500) | — | | `dmdx/` (近日) | DMDX (ADM、arxiv 2507.18569v1) | 4-step / CFG=1.0 | 🟢 訓練中 (新規実装) | — | 将来追加検討: LADD / Reflow / Z-Image trajectory / SiD2 など。 ## ソースコード 訓練コード・データセット生成・Modal 実装一式: - HF (同アカウント上): [**darask0/rapid-anima**](https://huggingface.co/darask0/rapid-anima) - GitHub: [**daraskme/rapid-anima**](https://github.com/daraskme/rapid-anima) 両 repo は同内容のミラー。Issue / PR は GitHub 側で対応推奨。 ## File Formats 各サブディレクトリには **2 種類のフォーマット**で同じ重みを配布: | 拡張子 | 用途 | |---|---| | `*_peft.safetensors` | PEFT (diffusers) — 自前推論スクリプト、`peft` library | | `*_comfy.safetensors` | ComfyUI — `LoraLoaderModelOnly` で直接ロード可 | ## ComfyUI 最短手順 1. `*_comfy.safetensors` を `ComfyUI/models/loras/` に配置 2. Anima v1.0 base workflow に `LoraLoaderModelOnly` を挿入、`strength_model: 1.0` 3. KSampler を設定: - **steps: 4** - **cfg: 1.0** - sampler / scheduler: `er_sde + simple` (Anima 公式デフォルト、安定) または `res_multistep + beta` (anime style 強め) 4. `ModelSamplingAuraFlow` で `sigma_shift: 3.0` (Anima 公式必須) 詳細な使い方・訓練ハイパーパラメータは各サブディレクトリの `README.md` を参照。 ## サンプル (PCM、step 4000、4-step、res_multistep + beta) ![sample](pcm/samples/sample_step4000_res_multistep_beta.png) Prompt: `2girls, flandre scarlet, remilia scarlet, touhou, ...` 4-step CFG=1.0、Anima v1.0 base、seed 42。 2 キャラ分離 / 衣装ディテール / 背景 / anime style がすべて保たれている。 DMD2 / DMDX 配布時には追加の比較画像を掲載予定。 ## 訓練手法の概要 ### PCM (Phased Consistency Model) - num_euler_timesteps N=50 を K=4 phase に分割、4-step inference に最適化 - pseudo-Huber loss + CFG-augmentation (w∈[4.0, 5.0]) を訓練に embed - cold-start で安定 (warm-start 不要)、5000 step / B200 で ~$22 ### DMD2 + TrigFlow (進行中) - NVIDIA cosmos-predict2.5 公式系統、2 PEFT adapter (student + fake_score) を runtime 切替 - 逆 KL gradient trick で score matching、TTUR (5 critic : 1 generator) - warm-start = Civitai Anima Turbo、teacher_cfg=4.5 / shift=3.0 (Anima 整合) ### DMDX (進行中、新規実装) - 論文 [arxiv 2507.18569v1](https://arxiv.org/html/2507.18569v1) (ByteDance Seed Vision) の ADM-only 移植 - DMD2 の逆 KL を **学習可能 discriminator による hinge GAN (TVD)** に置換 - cubic time schedule + teacher Δt evolution で時刻情報を D に与える - LADD-style discriminator (teacher frozen backbone + spectral norm heads) を流用 ## License - 本リポジトリの **LoRA 重み**: Apache-2.0 - **Base model (Anima v1.0)** には別途以下のライセンスが適用される (派生モデルも縛り受ける): - CircleStone Labs Non-Commercial License - NVIDIA Open Model License (Derivative Model 条項) - **非商用利用のみ可能**。商用利用は Anima 公式に問い合わせ: [circlestone-labs/Anima](https://huggingface.co/circlestone-labs/Anima) ## References - PCM: [Wang et al. NeurIPS 2024](https://arxiv.org/abs/2405.18407) / [G-U-N/Phased-Consistency-Model](https://github.com/G-U-N/Phased-Consistency-Model) - DMD2: [Yin et al. 2024](https://arxiv.org/abs/2405.14867) / NVIDIA [cosmos-predict2.5](https://github.com/nvidia-cosmos) - DMDX: [Lu et al. 2025](https://arxiv.org/html/2507.18569v1) (ByteDance Seed Vision) - Anima base: [circlestone-labs/Anima](https://huggingface.co/circlestone-labs/Anima)