rityak commited on
Commit
c900068
·
verified ·
1 Parent(s): 7a17979

Upload 2 files

Browse files
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. README.md +111 -1
  3. img.png +3 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ img.png filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,3 +1,113 @@
1
  ---
2
- license: creativeml-openrail-m
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - en
4
+ tags:
5
+ - text-to-image
6
+ - stable-diffusion
7
+ - safetensors
8
+ - stable-diffusion-xl
9
+ license: openrail++
10
+ base_model:
11
+ - cagliostrolab/animagine-xl-3.1
12
  ---
13
+
14
+ # Animagus XL 1.0
15
+
16
+ ![image/png](/img.png)
17
+
18
+ ## Overview
19
+
20
+ **Animagus** is an anime-themed finetuned model built on top of Stable Diffusion XL, created over the Animagine XL series. The model merges over 20 specialized checkpoints (including various versions of Animagine, babesByStableYogi, bigasp, juggernaut, tofuANIMEBASEMODEL, kohakuXLZeta, starryXL, hassakuXL, animeIllustDiffusion, RaeDiffusion-XL, UrangDiffusion, clandestine, and ranimeXL) using multistage merging methods (`Karcher mean`, `add_difference` and `task_arithmetic`), and then finetuned on carefully selected illustration datasets. This results in more stable outputs, accurate anatomy, and rich colors, while preserving the “anime” style.
21
+
22
+ ## Model Details
23
+
24
+ - **Model type**: diffusion-based text-to-image
25
+ - **Base checkpoint**: Stable Diffusion XL 1.0
26
+ - **Initial finetuned models**: Animagine XL 3.1 and Animagine XL 4.0 Opt
27
+ - **License**: CreativeML Open RAIL++-M
28
+
29
+ ## Training Pipeline
30
+
31
+ **Step 1: Model Merging**
32
+ Multistage merging of over 20 anime-specific checkpoints using the following methods:
33
+
34
+ - **Karcher mean** (Riemannian center of mass): a generalization of the arithmetic mean to curved spaces (Riemannian manifolds), finding the point that minimizes the sum of squared Riemannian distances to all checkpoints.
35
+ - **subtract** and **add_difference** to preserve the unique characteristics of each checkpoint
36
+ - **fallback** and **task_arithmetic** for flexible combination of UNet, VAE, and CLIP components
37
+
38
+ **Step 2: Fine-tuning**
39
+ A few short iterations on a small but high-quality dataset:
40
+
41
+ - **pixiv** – a collection of illustrations with high aesthetic scores
42
+ - **latum** – expressive artworks with pleasant tones and fine line work
43
+ - **artists** – artworks by `asou`, `hara_harayutaka`, `hiroki_yyqw7151` in a vanilla anime screencap style
44
+ - **aiga** – AI-generated images with high aesthetic scores
45
+ - **anime** – screenshots and illustrations from anime and hentai
46
+
47
+ > **Note:** UNet and CLIP were fine-tuned separately due to an initial configuration error.
48
+
49
+ ## Usage Guidelines
50
+
51
+ The usage guidelines will be the same as for Animagine 3.1 and 4.0. For more details, please refer to:
52
+
53
+ - https://huggingface.co/cagliostrolab/animagine-xl-4.0
54
+ - https://huggingface.co/cagliostrolab/animagine-xl-3.1
55
+
56
+ ---
57
+
58
+ ### Recipe
59
+
60
+ **Step 1. Merging** **[Animagus XL Zero](https://huggingface.co/rityak/animagus/resolve/main/animagus.safetensors?download=true)** - Non-trained merging of checkpoints.
61
+
62
+ ```yaml
63
+ version: 0.1.0
64
+ model "SDXL\animagine\animagine-xl-4.0-opt.safetensors" model_config="sdxl-sgm" merge_space="weight"
65
+ model "SDXL\animagine\animagine-xl-3.1.safetensors" model_config="sdxl-sgm" merge_space="weight"
66
+ model "SDXL\babesByStableYogiSDXL_v50FP16.safetensors" model_config="sdxl-sgm" merge_space="weight"
67
+ model "SDXL\bigasp_v20.safetensors" model_config="sdxl-sgm" merge_space="weight"
68
+ model "SDXL\juggernautXL_ragnarokBy.safetensors" model_config="sdxl-sgm" merge_space="weight"
69
+ merge "karcher_mean_with_blocks" &2 &3 &4 alpha_clip_l=null alpha_clip_g=null alpha_in=null alpha_mid=null alpha_out=null alpha_embed_time=null alpha_embed_label=null max_iter=30.000000000000007 tol="3e-08" alpha_global="0.4, 0.3, 0.3"
70
+ merge "merge_checkpointing" &5
71
+ model "SDXL\sd_xl_base_1.0.safetensors" model_config="sdxl-sgm" merge_space="weight"
72
+ merge "subtract" &6 &7
73
+ literal 0.0 model_config="sdxl-sgm" merge_space="param"
74
+ merge "pick_component" &9 "clip_l"
75
+ merge "pick_component" &9 "clip_g"
76
+ merge "fallback" &10 &11
77
+ merge "pick_component" &9 "vae"
78
+ merge "fallback" &12 &13
79
+ literal 1.0000000000000002 model_config="sdxl-sgm" merge_space="param"
80
+ merge "pick_component" &15 "diffuser"
81
+ merge "fallback" &14 &16
82
+ merge "add_difference" &1 &8 &17
83
+ merge "fallback" &18 &1
84
+ model "SDXL\tofuANIMEBASEMODEL_050.safetensors" model_config="sdxl-sgm" merge_space="weight"
85
+ model "SDXL\kohakuXLZeta_rev1.safetensors" model_config="sdxl-sgm" merge_space="weight"
86
+ model "SDXL\starryXLV52_v52.safetensors" model_config="sdxl-sgm" merge_space="weight"
87
+ model "SDXL\hassakuXL_betaV06.safetensors" model_config="sdxl-sgm" merge_space="weight"
88
+ model "SDXL\animeIllustDiffusion_v08.safetensors" model_config="sdxl-sgm" merge_space="weight"
89
+ merge "karcher_mean_with_blocks" &1 &20 &21 &22 &23 &24 alpha_clip_l=null alpha_clip_g=null alpha_in=null alpha_mid=null alpha_out=null alpha_embed_time=null alpha_embed_label=null max_iter=30.000000000000007 tol="3e-08" alpha_global="0.1675, 0.1665, 0.1665, 0.1665, 0.1665, 0.1665"
90
+ merge "merge_checkpointing" &25
91
+ merge "subtract" &26 &1
92
+ merge "add_difference" &19 &27 1.0
93
+ merge "fallback" &28 &19
94
+ model "SDXL\animagine\RaeDiffusion-XL-v2.safetensors" model_config="sdxl-sgm" merge_space="weight"
95
+ model "SDXL\animagine\UrangDiffusion-2.0.safetensors" model_config="sdxl-sgm" merge_space="weight"
96
+ model "SDXL\animagine\clandestine-xl-1.0.safetensors" model_config="sdxl-sgm" merge_space="weight"
97
+ model "SDXL\animagine\ranimeXLBaseOnAnimagine_v10.safetensors" model_config="sdxl-sgm" merge_space="weight"
98
+ merge "task_arithmetic" &1 &30 &31 &32 &33 lambda_=1.0 weights="0.22, 0.26, 0.26, 0.26"
99
+ merge "merge_checkpointing" &34
100
+ merge "subtract" &30 &1
101
+ merge "subtract" &31 &1
102
+ merge "subtract" &32 &1
103
+ merge "subtract" &33 &1
104
+ merge "ties_sum_extended" &36 &37 &38 &39 k=0.20000000000000004 vote_sgn=true apply_stock=false apply_median=true cos_eps=1e-06 eps=1e-06 maxiter=100 ftol=1e-20
105
+ merge "add_difference" &35 &40 1.0
106
+ merge "fallback" &41 &35
107
+ merge "subtract" &42 &1
108
+ merge "add_difference" &29 &43 1.0
109
+ merge "fallback" &44 &29
110
+ merge "karcher_mean" &0 &45 max_iter=30.000000000000007 tol="1e-07" alphas="0.35, 0.65"
111
+ ```
112
+
113
+ **Step 2. Fine-tuning** **[Animagus XL](https://huggingface.co/rityak/animagus/resolve/main/animagus.safetensors?download=true)** A few short iterations on a small, high-quality dataset.
img.png ADDED

Git LFS Details

  • SHA256: 70eaa642b8745e85c87d13fad673128a273d7748ebe4c2cc206ec11534f21676
  • Pointer size: 132 Bytes
  • Size of remote file: 3.77 MB