File size: 5,363 Bytes
ce1093f
 
 
 
 
 
 
 
 
 
 
 
 
06234ca
 
 
 
 
2af9df0
aa757c6
06234ca
 
 
 
 
 
 
2af9df0
06234ca
 
 
 
 
 
f04fd73
06234ca
f04fd73
aa757c6
06234ca
aea1192
 
7ed0072
 
 
 
aea1192
 
99ea90c
 
aea1192
 
 
 
 
fe32ade
789620e
99ea90c
 
 
 
005731e
99ea90c
ec46405
 
 
 
 
99ea90c
aa757c6
 
06234ca
 
 
 
 
 
 
 
 
 
 
ed85eb1
06234ca
88984b3
 
 
 
e5e75fe
7a3ca71
88984b3
 
 
 
aa757c6
88984b3
 
 
 
 
 
aa757c6
005731e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
06234ca
 
dabc71b
 
 
 
 
 
 
88984b3
06234ca
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
---
license: apache-2.0
tags:
- anime
- diffusion
- text-to-image
- image-generation
library_name: diffusers
pipeline_tag: text-to-image
language:
- en
---

![Aniimage-1 Samples](collage.png)

# Aniimage-1

Aniimage-1 is the first latent diffusion model developed by 8BitStudio.
The model is a 256x256 anime image generation model trained from scratch using a UNet + VAE + CLIP architecture at 449.1 million parameters.
Aniimage-1 has been trained on 830,001 anime images from [Danbooru](https://danbooru.donmai.us/). It is not based on any existing models, the UNet is trained from scratch.

## Model Details

| | |
|---|---|
| **Resolution** | 256×256 |
| **Architecture** | Latent Diffusion (UNet + VAE + CLIP) |
| **Parameters** | 441.9M |
| **Training Steps** | 88,000 |
| **Batch Size** | 64 |
| **Dataset** | ~830K curated anime images from Danbooru |
| **GPU** | NVIDIA RTX 5060 Ti 16GB |
| **Scheduler** | DDIM or DPM ++ 2M |

## Requirements

- **GPU**: ~3.4 GB VRAM minimum (recommend 4+ GB)
- **CPU**: ~2 GB RAM. Image generation is extremely slow on CPU.

## Quick Start

<a href="https://huggingface.co/8BitStudio/Aniimage-1/blob/main/Aniimage_1_Colab.ipynb">
  <img src="https://img.shields.io/badge/Open%20in-Colab-orange?logo=googlecolab&style=for-the-badge" alt="Open In Colab" height="40">
</a>

[![Download Generator](https://img.shields.io/badge/Download-generate__hf.py-blue?style=for-the-badge)](https://huggingface.co/8BitStudio/Aniimage-1/resolve/main/generate_hf.py)

after downloading, install the dependencies.

```bash
pip install torch torchvision diffusers transformers safetensors pillow huggingface_hub
python generate_hf.py
```

recommended settings: Scheduler on DPM++ 2M with 25 steps and a CFG of 7.5. If you are using Euler, 30 steps and 5 CFG works the best.
recommended negative prompt: "low quality, ugly, blurry, distorted, deformed, bad anatomy, bad proportions, extra limbs, missing limbs, watermark,
text, signature, washed out, flat colors, manga panel, disfigured, poorly drawn, jpeg artifacts, cropped, out of frame"

## Prompting

Aniimage uses plain text captions as well as Danbooru tags.

An example of acceptable captions:

"A smiling anime girl with red hair and a school uniform"

"1girl, solo, smile, red_hair, school_uniform, anime_coloring"

Long prompts and enhanced prompts usually result in worse overall results. Try to keep your prompts short.

## Capabilities

- Anime character generation with varied hair colors and styles
- School uniforms, fantasy outfits, maid dresses, and more
- Background scenes: cherry blossoms, night sky, interiors, nature

## Limitations

- 256×256 resolution — fine details like hands and small features can be rough
- Faces can sometimes look similar or 'melty' across different prompts
- Little to none NSFW content — trained on mostly SFW dataset only
- Does worse when generating men due to dataset bias


## Oddities

<div>
  <img src="una%20chica%20anime%20con%20cabello%20largo%20rosa.png" width="320" style="display:block; margin-bottom:2px;">
  <sub>Prompt: una chica anime con cabello largo rosa<br>
  (an anime girl with long pink hair)</sub>
</div>

As shown above, Aniimage-1 can sometimes understand Spanish prompts. Longer prompts may be less reliable, but Spanish support does work in some cases.
Strangely, Japanese does not work at all, producing images that look extremely distorted and not conforming to the prompt at all.

<div>
  <img src="anime%20girl%20with%20short%20silver%20hair%20sitting%20by%20a%20win%201.png" width="320" style="display:block; margin-bottom:2px;">
  <sub>Prompt: anime girl with short silver hair sitting by a window</sub>
</div>

Aniimage-1 has a bad habit of hiding hands. This is likely because hands turn out melty, if you don't specify it, hands will likely be concealed, hidden, or simply no hands at all.

<div>
  <img src="1girl%2C%20solo%2C%20school_uniform%2C%20sailor_collar%2C%20pleate.png" width="320" style="display:block; margin-bottom:2px;">
  <sub>Prompt: 1girl, solo, school_uniform, sailor_collar, pleated_skirt, brown_hair, smile, classroom</sub>
</div>

When using Danbooru tags, it is much more likely to have black boxes or bars around the sides of an image as seen above.
This may be caused by how the model’s training data was filtered, possibly from not cropping images that were smaller than or outside its expected aspect ratio.

<div>
  <img src="A%20portrait%20of%20a%20solo%20anime%20girl%20with%20brown%20hair%20we%201.png" width="320" style="display:block; margin-bottom:2px;">
  <sub>Prompt: A portrait of a solo anime girl with brown hair wearing a school uniform with a sailor collar and a pleated skirt in a classroom</sub>
</div>

When using plain English text, you are much less likely to experience this issue.

## What's Next

**[Aniimage-2](https://huggingface.co/8BitStudio/Aniimage-2) is complete!**

It features a native resolution of 512×512 and was trained on 1.2 million unique images, compared with the 830,000 images used to train Aniimage-1.

Aniimage-2 also switches from Aniimage-1’s epsilon-prediction objective to v-prediction and uses a zero-terminal signal-to-noise ratio. 
It also uses uniform timestep sampling, while the upcoming Aniimage-3 will adopt logit-normal noise-level sampling as part of its flow-matching objective.



## License

Apache 2.0