Panchovix commited on
Commit
fe7131b
·
verified ·
1 Parent(s): a853201

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +313 -5
README.md CHANGED
@@ -1,5 +1,313 @@
1
- ---
2
- license: other
3
- license_name: other
4
- license_link: LICENSE
5
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ tags:
5
+ - text-to-image
6
+ - stable-diffusion
7
+ - safetensors
8
+ - stable-diffusion-xl
9
+ widget:
10
+ - text: >-
11
+ 1girl, green hair, sweater, looking at viewer, upper body, beanie, outdoors,
12
+ night, turtleneck, masterpiece, high score, great score, absurdres
13
+ parameter:
14
+ negative_prompt: >-
15
+ lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit,
16
+ fewer digits, cropped, worst quality, low quality, low score, bad score,
17
+ average score, signature, watermark, username, blurry
18
+ example_title: 1girl
19
+ - text: >-
20
+ 1boy, male focus, green hair, sweater, looking at viewer, upper body,
21
+ beanie, outdoors, night, turtleneck, masterpiece, high score, great score,
22
+ absurdres
23
+ parameter:
24
+ negative_prompt: >-
25
+ lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit,
26
+ fewer digits, cropped, worst quality, low quality, low score, bad score,
27
+ average score, signature, watermark, username, blurry
28
+ example_title: 1boy
29
+ license: openrail++
30
+ base_model:
31
+ - stabilityai/stable-diffusion-xl-base-1.0
32
+ ---
33
+
34
+ Cyberfixes merges for animagine 4.0 (OPT)
35
+
36
+ # Animagine XL 4.0
37
+
38
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/_tsxjwf3VPu94xh9wJSbo.png)
39
+
40
+ ## Overview
41
+
42
+ **Animagine XL 4.0**, also stylized as **Anim4gine**, is the ultimate anime-themed finetuned SDXL model and the latest installment of [Animagine XL series](https://huggingface.co/collections/Linaqruf/animagine-xl-669888c0add5adaf09754aca). Despite being a continuation, the model was retrained from [Stable Diffusion XL 1.0](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0) with a massive dataset of 8.4M diverse anime-style images from various sources with the knowledge cut-off of January 7th 2025 and finetuned for approximately 2650 GPU hours. Similar to the previous version, this model was trained using tag ordering method for the identity and style training.
43
+ With the release of **Animagine XL 4.0 Opt (Optimized)**, the model has been further refined with an additional dataset, improving **stability**, **anatomy accuracy**, **noise reduction**, **color saturation**, and **overall color accuracy**. These enhancements make **Animagine XL 4.0 Opt** more consistent and visually appealing while maintaining the signature quality of the series.
44
+
45
+
46
+ ## Changelog
47
+ - 2025-02-13 – Added Animagine XL 4.0 Opt
48
+ - Better stability for more consistent outputs
49
+ - Enhanced anatomy with more accurate proportions
50
+ - Reduced noise and artifacts in generations
51
+ - Fixed low saturation issues, resulting in richer colors
52
+ - Improved color accuracy for more visually appealing results
53
+ - 2025-01-24 – Initial release
54
+
55
+
56
+ ## Model Details
57
+
58
+ - **Developed by**: [Cagliostro Research Lab](https://github.com/cagliostrolab)
59
+ - **Model type**: Diffusion-based text-to-image generative model
60
+ - **License**: [CreativeML Open RAIL++-M](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/LICENSE.md)
61
+ - **Model Description**: This is a model that can be used to generate and modify specifically anime-themed images based on text prompt
62
+ - **Fine-tuned from**: [Stable Diffusion XL 1.0](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0)
63
+
64
+ ## Downstream Use
65
+
66
+ 1. Use this model in our [`Hugging Face Spaces`](https://huggingface.co/spaces/cagliostrolab/animagine-xl-4.0)
67
+ 2. Use it in [`ComfyUI`](https://github.com/comfyanonymous/ComfyUI) or [`Stable Diffusion Webui`](https://github.com/AUTOMATIC1111/stable-diffusion-webui)
68
+ 3. Use it with 🧨 `diffusers`
69
+
70
+ ## 🧨 Diffusers Installation
71
+
72
+ ### 1. Install Required Libraries
73
+
74
+ ```bash
75
+ pip install diffusers transformers accelerate safetensors --upgrade
76
+ ```
77
+
78
+ ### 2. Example Code
79
+ The example below uses `lpw_stable_diffusion_xl` pipeline which enables better handling of long, weighted and detailed prompts. The model is already uploaded in FP16 format, so there's no need to specify `variant="fp16"` in the `from_pretrained` call.
80
+
81
+ ```python
82
+ import torch
83
+ from diffusers import StableDiffusionXLPipeline
84
+
85
+ pipe = StableDiffusionXLPipeline.from_pretrained(
86
+ "cagliostrolab/animagine-xl-4.0",
87
+ torch_dtype=torch.float16,
88
+ use_safetensors=True,
89
+ custom_pipeline="lpw_stable_diffusion_xl",
90
+ add_watermarker=False
91
+ )
92
+ pipe.to('cuda')
93
+
94
+ prompt = "1girl, arima kana, oshi no ko, hoshimachi suisei, hoshimachi suisei \(1st costume\), cosplay, looking at viewer, smile, outdoors, night, v, masterpiece, high score, great score, absurdres"
95
+ negative_prompt = "lowres, bad anatomy, bad hands, text, error, missing finger, extra digits, fewer digits, cropped, worst quality, low quality, low score, bad score, average score, signature, watermark, username, blurry"
96
+
97
+ image = pipe(
98
+ prompt,
99
+ negative_prompt=negative_prompt,
100
+ width=832,
101
+ height=1216,
102
+ guidance_scale=5,
103
+ num_inference_steps=28
104
+ ).images[0]
105
+
106
+ image.save("./arima_kana.png")
107
+ ```
108
+
109
+ ## Usage Guidelines
110
+
111
+ The summary can be seen in the image for the prompt guideline.
112
+
113
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/64c088660a4d02f37a965f6c/YPe3MCnQAHM7nCZ1vQ7vI.png)
114
+
115
+ ### 1. Prompt Structure
116
+ The model was trained with tag-based captions and the tag-ordering method. Use this structured template:
117
+
118
+ ```
119
+ 1girl/1boy/1other, character name, from which series, rating, everything else in any order and end with quality enhancement
120
+ ```
121
+
122
+ ### 2. Quality Enhancement Tags
123
+ Add these tags at the end of your prompt:
124
+
125
+ ```
126
+ masterpiece, high score, great score, absurdres
127
+ ```
128
+
129
+ ### 3. Recommended Negative Prompt
130
+ ```
131
+ lowres, bad anatomy, bad hands, text, error, missing finger, extra digits, fewer digits, cropped, worst quality, low quality, low score, bad score, average score, signature, watermark, username, blurry
132
+ ```
133
+
134
+ ### 4. Optimal Settings
135
+ - **CFG Scale**: 4-7 (5 Recommended)
136
+ - **Sampling Steps**: 25-28 (28 Recommended)
137
+ - **Preferred Sampler**: Euler Ancestral (Euler a)
138
+
139
+ ### 5. Recommended Resolutions
140
+
141
+ | Orientation | Dimensions | Aspect Ratio |
142
+ |------------|------------|--------------|
143
+ | Square | 1024 x 1024| 1:1 |
144
+ | Landscape | 1152 x 896 | 9:7 |
145
+ | | 1216 x 832 | 3:2 |
146
+ | | 1344 x 768 | 7:4 |
147
+ | | 1536 x 640 | 12:5 |
148
+ | Portrait | 896 x 1152 | 7:9 |
149
+ | | 832 x 1216 | 2:3 |
150
+ | | 768 x 1344 | 4:7 |
151
+ | | 640 x 1536 | 5:12 |
152
+
153
+ ### 6. Final Prompt Structure Example
154
+ ```
155
+ 1girl, firefly \(honkai: star rail\), honkai \(series\), honkai: star rail, safe, casual, solo, looking at viewer, outdoors, smile, reaching towards viewer, night, masterpiece, high score, great score, absurdres
156
+ ```
157
+
158
+ ## Special Tags
159
+
160
+ The model supports various special tags that can be used to control different aspects of the image generation process. These tags are carefully weighted and tested to provide consistent results across different prompts.
161
+
162
+ ### Quality Tags
163
+ Quality tags are fundamental controls that directly influence the overall image quality and detail level. Available quality tags:
164
+ - `masterpiece`
165
+ - `best quality`
166
+ - `low quality`
167
+ - `worst quality`
168
+
169
+ | <img src="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/bDdKraYxjiReKknlYJepR.png" width="100%" style="max-height: 400px; object-fit: contain;"> | <img src="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/mAgMMKL2tBj8oBuWHTYUz.png" width="100%" style="max-height: 400px; object-fit: contain;"> |
170
+ |---|---|
171
+ | Sample image using `"masterpiece, best quality"` quality tags with negative prompt left empty. | Sample image using `"low quality, worst quality"` quality tags with negative prompt left empty. |
172
+
173
+ ### Score Tags
174
+ Score tags provide a more nuanced control over image quality compared to basic quality tags. They have a stronger impact on steering output quality in this model. Available score tags:
175
+ - `high score`
176
+ - `great score`
177
+ - `good score`
178
+ - `average score`
179
+ - `bad score`
180
+ - `low score`
181
+
182
+ | <img src="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/PXK6D1yhD8SND-VHFQOXD.png" width="100%" style="max-height: 400px; object-fit: contain;"> | <img src="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/0uUw7DQ9IMiSNE_MZ9Uyf.png" width="100%" style="max-height: 400px; object-fit: contain;"> |
183
+ |---|---|
184
+ | Sample image using `"high score, great score"` score tags with negative prompt left empty. | Sample image using `"bad score, low score"` score tags with negative prompt left empty. |
185
+
186
+ ### Temporal Tags
187
+ Temporal tags allow you to influence the artistic style based on specific time periods or years. This can be useful for generating images with era-specific artistic characteristics. Supported year tags:
188
+ - `year 2005`
189
+ - `year {n}`
190
+ - `year 2025`
191
+
192
+ | <img src="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/weRv0BmfkZrBhcW5NxXAI.png" width="100%" style="max-height: 400px; object-fit: contain;"> | <img src="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/WwFoeLrbN2MkXuGHh91Ky.png" width="100%" style="max-height: 400px; object-fit: contain;"> |
193
+ |---|---|
194
+ | Sample image of Hatsune Miku with `"year 2007"` temporal tag. | Sample image of Hatsune Miku with `"year 2023"` temporal tag. |
195
+
196
+ ### Rating Tags
197
+ Rating tags help control the content safety level of generated images. These tags should be used responsibly and in accordance with applicable laws and platform policies. Supported ratings:
198
+ - `safe`
199
+ - `sensitive`
200
+ - `nsfw`
201
+ - `explicit`
202
+
203
+ ## Training Information
204
+
205
+ The model was trained using state-of-the-art hardware and optimized hyperparameters to ensure the highest quality output. Below are the detailed technical specifications and parameters used during the training process:
206
+
207
+ | Parameter | Value |
208
+ |-----------|--------|
209
+ | Hardware | 7 x H100 80GB SXM5 |
210
+ | Num Images | 8,401,464 |
211
+ | UNet Learning Rate | 2.5e-6 |
212
+ | Text Encoder Learning Rate | 1.25e-6 |
213
+ | Scheduler | Constant With Warmup |
214
+ | Warmup Steps | 5% |
215
+ | Batch Size | 32 |
216
+ | Gradient Accumulation Steps | 2 |
217
+ | Training Resolution | 1024x1024 |
218
+ | Optimizer | Adafactor |
219
+ | Input Perturbation Noise | 0.1 |
220
+ | Debiased Estimation Loss | Enabled |
221
+ | Mixed Precision | fp16 |
222
+
223
+ ## Acknowledgement
224
+
225
+ This long-term project would not have been possible without the groundbreaking work, innovative contributions, and comprehensive documentation provided by **Stability AI**, **Novel AI**, and **Waifu Diffusion Team**. We are especially grateful for the kickstarter grant from **Main** that enabled us to progress beyond V2. For this iteration, we would like to express our sincere gratitude to everyone in the community for their continuous support, particularly:
226
+
227
+ 1. [**Moescape AI**](https://moescape.ai/): Our invaluable collaboration partner in model distribution and testing
228
+ 2. **Lesser Rabbit**: For providing essential computing and research grants
229
+ 3. [**Kohya SS**](https://github.com/kohya-ss): For developing the comprehensive open-source training framework
230
+ 4. [**discus0434**](https://github.com/discus0434): For creating the industry-leading open-source Aesthetic Predictor 2.5
231
+ 5. **Early testers**: For their dedication in providing critical feedback and thorough quality assurance
232
+
233
+ ## Contributors
234
+
235
+ We extend our heartfelt appreciation to our dedicated team members who have contributed significantly to this project, including but not limited to:
236
+
237
+ ### Model
238
+ - [**KayfaHaarukku**](https://huggingface.co/kayfahaarukku)
239
+ - [**Raelina**](https://huggingface.co/Raelina)
240
+ - [**Linaqruf**](https://huggingface.co/Linaqruf)
241
+
242
+ ### Gradio
243
+ - [**Damar Jati**](https://huggingface.co/DamarJati)
244
+
245
+ ### Relations, finance, and quality assurance
246
+ - [**Scipius**](https://huggingface.co/Scipius2121)
247
+ - [**Asahina**](https://huggingface.co/Asahina2K)
248
+ - [**Bell**](https://huggingface.co/ItsMeBell)
249
+ - [**BoboiAzumi**](https://huggingface.co/Boboiazumi)
250
+
251
+ ### Data
252
+ - [**Pomegranata**](https://huggingface.co/paripi)
253
+ - [**Kr1SsSzz**](https://huggingface.co/Kr1SsSzz)
254
+ - [**Fiqi**](https://huggingface.co/saikanov)
255
+ - [**William Adams Soeherman**](https://huggingface.co/williamsoeherman)
256
+
257
+ ## Fundraising Has New Methods!
258
+
259
+ We're excited to introduce new fundraising methods through GitHub Sponsors to support training, research, and model development. Your support helps us push the boundaries of what's possible with AI.
260
+
261
+ **You can help us with:**
262
+
263
+ * **Donate**: Contribute via ETH, USDT, or USDC to the address below, or sponsor us on GitHub.
264
+
265
+ * **Share**: Spread the word about our models and share your creations!
266
+
267
+ * **Feedback**: Let us know how we can improve.
268
+
269
+ **Donation Address**:
270
+
271
+ ETH/USDT/USDC(e): ```0xd8A1dA94BA7E6feCe8CfEacc1327f498fCcBFC0C```
272
+
273
+ **Github Sponsor**: [https://github.com/sponsors/cagliostrolab/](https://github.com/sponsors/cagliostrolab/)
274
+
275
+
276
+ <details>
277
+ <summary>Why do we use Cryptocurrency?</summary>
278
+ When we initially opened fundraising through Ko-fi and using PayPal as withdrawal methods, our PayPal account was flagged and eventually banned, despite our efforts to explain the purpose of our project. Unfortunately, this forced us to refund all donations and left us without a reliable way to receive support. To avoid such issues and ensure transparency, we have now switched to cryptocurrency as the way to raise the fund.
279
+ </details>
280
+
281
+ <details>
282
+ <summary>Want to Donate in Non-Crypto Currency?</summary>
283
+ Although we had a bad experience with Paypal, and you’d like to support us but prefer not to use cryptocurrency, feel free to contact us via [Discord Server](https://discord.gg/cqh9tZgbGc) for alternative donation methods.
284
+ </details>
285
+
286
+ ## Join Our Discord Server
287
+ Feel free to join our discord server
288
+ <div style="text-align: center;">
289
+ <a href="https://discord.gg/cqh9tZgbGc">
290
+ <img src="https://discord.com/api/guilds/1115542847395987519/widget.png?style=banner2" alt="Discord Banner 2"/>
291
+ </a>
292
+ </div>
293
+
294
+ ## Limitations
295
+
296
+ - **Prompt Format**: Limited to tag-based text prompts; natural language input may not be effective
297
+ - **Anatomy**: May struggle with complex anatomical details, particularly hand poses and finger counting
298
+ - **Text Generation**: Text rendering in images is currently not supported and not recommended
299
+ - **New Characters**: Recent characters may have lower accuracy due to limited training data availability
300
+ - **Multiple Characters**: Scenes with multiple characters may require careful prompt engineering
301
+ - **Resolution**: Higher resolutions (e.g., 1536x1536) may show degradation as training used original SDXL resolution
302
+ - **Style Consistency**: May require specific style tags as training focused more on identity preservation than style consistency
303
+
304
+ ## License
305
+
306
+ This model adopts the original [CreativeML Open RAIL++-M License](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/LICENSE.md) from Stability AI without any modifications or additional restrictions. The license terms remain exactly as specified in the original SDXL license, which includes:
307
+
308
+ - ✅ **Permitted**: Commercial use, modifications, distributions, private use
309
+ - ❌ **Prohibited**: Illegal activities, harmful content generation, discrimination, exploitation
310
+ - ⚠️ **Requirements**: Include license copy, state changes, preserve notices
311
+ - 📝 **Warranty**: Provided "AS IS" without warranties
312
+
313
+ Please refer to the [original SDXL license](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/LICENSE.md) for the complete and authoritative terms and conditions.