đ Animagine XL 2.0
Animagine XL 2.0 is an advanced latent text - to - image diffusion model. It can create high - resolution, detailed anime images. Fine - tuned from Stable Diffusion XL 1.0, it offers improved image quality and aesthetics, excelling in capturing diverse anime art styles.
đ Quick Start
Animagine XL 2.0 is accessible via [Gradio](https://github.com/gradio - app/gradio) Web UI and Google Colab. You can use these user - friendly interfaces for image generation:
- Gradio Web UI: [
](https://huggingface.co/spaces/Linaqruf/Animagine - XL)
- Google Colab: [](https://colab.research.google.com/#fileId=https%3A//huggingface.co/Linaqruf/animagine - xl/blob/main/Animagine_XL_demo.ipynb)
⨠Features
- High - Quality Anime Image Generation: It can generate high - resolution, detailed anime images from text descriptions.
- LoRA Collection: Comes with a suite of LoRA adapters to customize the aesthetic of generated images, including Pastel Style and Anime Nouveau.
- Flexible Prompting: Responds to natural language descriptions and Danbooru - style tagging for image generation.
đĻ Installation
Ensure the installation of the latest diffusers
library, along with other essential packages:
pip install diffusers --upgrade
pip install transformers accelerate safetensors
đģ Usage Examples
Basic Usage
The following Python script demonstrates how to do inference with Animagine XL 2.0. The default scheduler in the model config is EulerAncestralDiscreteScheduler, but it can be explicitly defined for clarity.
import torch
from diffusers import (
StableDiffusionXLPipeline,
EulerAncestralDiscreteScheduler,
AutoencoderKL
)
vae = AutoencoderKL.from_pretrained(
"madebyollin/sdxl-vae-fp16-fix",
torch_dtype=torch.float16
)
pipe = StableDiffusionXLPipeline.from_pretrained(
"Linaqruf/animagine-xl-2.0",
vae=vae,
torch_dtype=torch.float16,
use_safetensors=True,
variant="fp16"
)
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
pipe.to('cuda')
prompt = "face focus, cute, masterpiece, best quality, 1girl, green hair, sweater, looking at viewer, upper body, beanie, outdoors, night, turtleneck"
negative_prompt = "lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry"
image = pipe(
prompt,
negative_prompt=negative_prompt,
width=1024,
height=1024,
guidance_scale=12,
num_inference_steps=50
).images[0]
Advanced Usage
Animagine XL 2.0 responds effectively to natural language descriptions for image generation. For example:
prompt = "A girl with mesmerizing blue eyes looks at the viewer. Her long, white hair is adorned with blue butterfly hair ornaments."
negative_prompt = "lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry"
image = pipe(
prompt,
negative_prompt=negative_prompt,
width=1024,
height=1024,
guidance_scale=12,
num_inference_steps=50
).images[0]
đ Documentation
Prompt Guidelines
Animagine XL 2.0 responds to natural language descriptions for image generation. However, to achieve optimal results, it's recommended to use Danbooru - style tagging in your prompts, as the model is trained with images labeled using these tags.
Quality Modifiers
Quality Modifier |
Score Criterion |
masterpiece |
>150 |
best quality |
100 - 150 |
high quality |
75 - 100 |
medium quality |
25 - 75 |
normal quality |
0 - 25 |
low quality |
- 5 - 0 |
worst quality |
< - 5 |
Rating Modifiers
Rating Modifier |
Rating Criterion |
- |
general |
- |
sensitive |
nsfw |
questionable |
nsfw |
explicit |
To guide the model towards generating high - aesthetic images, use negative prompts like:
lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry
For higher quality outcomes, prepend prompts with:
masterpiece, best quality
đ§ Technical Details
Animagine XL 2.0 is a diffusion - based text - to - image generative model. It's fine - tuned from Stable Diffusion XL 1.0 using a high - quality anime - style image dataset.
đ License
This model is licensed under the [CreativeML Open RAIL++ - M License](https://huggingface.co/stabilityai/stable-diffusion - 2/blob/main/LICENSE - MODEL).
Model Details
Property |
Details |
Developed by |
Linaqruf |
Model Type |
Diffusion - based text - to - image generative model |
Model Description |
This is a model that excels in creating detailed and high - quality anime images from text descriptions. It's fine - tuned to understand and interpret a wide range of descriptive prompts, turning them into stunning visual art. |
License |
[CreativeML Open RAIL++ - M License](https://huggingface.co/stabilityai/stable-diffusion - 2/blob/main/LICENSE - MODEL) |
Finetuned from model |
[Stable Diffusion XL 1.0](https://huggingface.co/stabilityai/stable-diffusion - xl - base - 1.0) |