Downloads · 30 days
0
coreml-community/coreml-animagine-xl-2.0
coreml-animagine-xl-2.0 is a text-to-image model from coreml-community. Use it when you need an image from a text prompt. The card lists the license as openrail++.
<style .title-container { display: flex; justify-content: center; align-items: center; height: 100vh; / Adjust this value to position the title vertically / }
Downloads · 30 days
0
Access
Public
Updated Apr 10, 2024
Repo size
25.5 GB
Likes
9
Public
Click a slice to open those files.
.zip19.8 GB · 100%
From the Hugging Face model README
original version is only compatible with CPU & GPU optionsplit_einsum version takes about 5-10 minutes to load the model for the first time and is available for both CPU & Neural Engine and CPU & GPU options. If your Mac has a lot of GPUs, using the CPU & GPU option will speed up image generation.vae-encoder for use with image2image.CoreML format.safety checker (for NSFW content).Sources: Hugging Face
The remaining contents of this model card were copied from the original animagine-xl-2.0 repo
<h1 class="title"> <span>Animagine XL 2.0</span> </h1> <table class="custom-table"> <tr> <td> <div class="custom-image-container"> <img class="custom-image" src="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/fmkK9WYAPgwbrDcKOybBZ.png" alt="sample1"> </div> <div class="custom-image-container"> <img class="custom-image" src="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/TFaH_13XbFh0_NSn4Tzav.png" alt="sample4"> </div> </td> <td> <div class="custom-image-container"> <img class="custom-image" src="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/twkZ4xvmUBTWZZ88DG0v-.png" alt="sample2"> </div> <div class="custom-image-container"> <img class="custom-image" src="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/5LyRRqLwt73u-eOy1HZ_7.png" alt="sample3"> </td> <td> <div class="custom-image-container"> <img class="custom-image" src="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/f8aLXc_Slewo7iVxlE246.png" alt="sample1"> </div> <div class="custom-image-container"> <img class="custom-image" src="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/PYI5I7VR_zdEZUidn8fIr.png" alt="sample4"> </div> </td> </tr> </table>Animagine XL 2.0 is an advanced latent text-to-image diffusion model designed to create high-resolution, detailed anime images. It's fine-tuned from Stable Diffusion XL 1.0 using a high-quality anime-style image dataset. This model, an upgrade from Animagine XL 1.0, excels in capturing the diverse and distinct styles of anime art, offering improved image quality and aesthetics.
The Animagine XL 2.0 model is complemented by an impressive suite of LoRA (Low-Rank Adaptation) adapters, each designed to imbue the generated images with unique stylistic attributes. This collection of adapters allows users to customize the aesthetic of their creations to match specific art styles, ranging from the vivid and bright Pastel Style to the intricate and ornate Anime Nouveau.
<table class="custom-table"> <tr> <td> <div class="custom-image-container"> <a href="https://huggingface.co/Linaqruf/style-enhancer-xl-lora"> <img class="custom-image" src="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/7k2c5pW6zMpOiuW9kVsrs.png" alt="sample1"> <div class="overlay"> Style Enhancer </div> </a> </div> </td> <td> <div class="custom-image-container"> <a href="https://huggingface.co/Linaqruf/anime-detailer-xl-lora"> <img class="custom-image" src="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/2yAWKA84ux1wfzaMD3cNu.png" alt="sample1"> <div class="overlay"> Anime Detailer </div> </a> </div> </td> <td> <div class="custom-image-container"> <a href="https://huggingface.co/Linaqruf/sketch-style-xl-lora"> <img class="custom-image" src="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/Iv6h6wC4HTq0ue5UABe_W.png" alt="sample1"> <div class="overlay"> Sketch Style </div> </a> </div> </td> <td> <div class="custom-image-container"> <a href="https://huggingface.co/Linaqruf/pastel-style-xl-lora"> <img class="custom-image" src="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/0Bu6fj33VHC2rTXoD-anR.png" alt="sample1"> <div class="overlay"> Pastel Style </div> </a> </div> </td> <td> <div class="custom-image-container"> <a href="https://huggingface.co/Linaqruf/anime-nouveau-xl-lora"> <img class="custom-image" src="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/Mw_U_1VcrcBGt-i6Lu06d.png" alt="sample1"> <div class="overlay"> Anime Nouveau </div> </a> </div> </td> </tr> </table>Animagine XL is accessible via Gradio Web UI and Google Colab, offering user-friendly interfaces for image generation:
Ensure the installation of the latest diffusers library, along with other essential packages:
pip install diffusers --upgrade
pip install transformers accelerate safetensors
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
)
# Load VAE component
vae = AutoencoderKL.from_pretrained(
"madebyollin/sdxl-vae-fp16-fix",
torch_dtype=torch.float16
)
# Configure the pipeline
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')
# Define prompts and generate image
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]
Animagine XL 2.0 responds effectively to natural language descriptions for image generation. For example:
A girl with mesmerizing blue eyes looks at the viewer. Her long, white hair is adorned with blue butterfly hair ornaments.
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. For instance:
1girl, green hair, sweater, looking at viewer, upper body, beanie, outdoors, night, turtleneck
This model incorporates quality and rating modifiers during dataset processing, influencing image generation based on specified criteria:
| 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 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
This table presents a detailed comparison to illustrate how training quality tags can significantly influence the outcomes of generative results. It showcases various attributes, both positive and negative, demonstrating the impact of quality tags in steering the generation of visual content.
<table class="custom-table"> <tr> <th colspan="6" align="center"> Quality Tags Comparison </th> </tr> <tr> <td colspan="1">Prompt</td> <td colspan="5" align="center" style="font-style: italic">"1girl, fu xuan, honkai:star rail, sweater, looking at viewer, upper body, beanie, outdoors, night, turtleneck"</td> </tr> <tr> <td>Positive</td> <td>-</td> <td>masterpiece, best quality</td> <td>-</td> <td>masterpiece, best quality</td> <td>masterpiece, best quality</td> </tr> <tr> <td>Negative</td> <td>-</td> <td>-</td> <td>worst quality, low quality, normal quality</td> <td>worst quality, low quality, normal quality</td> <td>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</td> </tr> <tr> <td></td> <td> <div class="custom-image-container"> <a href="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/6Jgm3iii23ZMHVAJcR02u.png" target="_blank"> <img class="custom-image" src="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/6Jgm3iii23ZMHVAJcR02u.png" alt="Comparison 1"> </a> </div> </td> <td> <div class="custom-image-container"> <a href="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/vLYdEN3u5GnIaTDiPT-Nw.png" target="_blank"> <img class="custom-image" src="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/vLYdEN3u5GnIaTDiPT-Nw.png" alt="Comparison 2"> </a> </div> </td> <td> <div class="custom-image-container"> <a href="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/4jw_6xjEWmcqwPNFp6ktC.png" target="_blank"> <img class="custom-image" src="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/4jw_6xjEWmcqwPNFp6ktC.png" alt="Comparison 3"> </a> </div> </td> <td> <div class="custom-image-container"> <a href="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/x7SNaPLKJXm1ZtoKIYiHs.png" target="_blank"> <img class="custom-image" src="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/x7SNaPLKJXm1ZtoKIYiHs.png" alt="Comparison 4"> </a> </div> </td> <td> <div class="custom-image-container"> <a href="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/5HnkLvrahnqdL28_GegxI.png" target="_blank"> <img class="custom-image" src="https://cdn-uploads.huggingface.co/production/uploads/6365c8dbf31ef76df4042821/5HnkLvrahnqdL28_GegxI.png" alt="Comparison 5"> </a> </div> </td> </tr> </table>This model supports generating images at the following dimensions:
| Dimensions | Aspect Ratio |
|---|---|
| 1024 x 1024 | 1:1 Square |
| 1152 x 896 | 9:7 |
| 896 x 1152 | 7:9 |
| 1216 x 832 | 19:13 |
| 832 x 1216 | 13:19 |
| 1344 x 768 | 7:4 Horizontal |
| 768 x 1344 | 4:7 Vertical |
| 1536 x 640 | 12:5 Horizontal |
| 640 x 1536 | 5:12 Vertical |
Note: The model's training configuration is subject to future enhancements.
In the second iteration (Animagine XL 2.0), we have addressed the 'broken neck' issue prevalent in poses like "looking back" and "from behind". Now, characters are consistently "looking at viewer" by default, enhancing the naturalism and accuracy of the generated images.

| Configuration Item | Animagine XL 1.0 | Animagine XL 2.0 |
|---|---|---|
| GPU | A100 40G | A100 80G |
| Dataset | 8000 images | 170k + 83k images |
| Global Epochs | Not Applicable | 20 |
| Learning Rate | 4e-7 | 1e-6 |
| Batch Size | 16 | 32 |
| Train Text Encoder | False | True |
| Train Special Tags | False | True |
| Image Resolution | 1024 | 1024 |
| Bucket Resolution | 1024 x 256 | 2048 x 512 |
| Caption Dropout | 0.5 | 0 |
The Animagine XL 2.0 model, with its advanced text-to-image diffusion capabilities, is highly versatile and can be applied in various fields:
The Animagine XL 2.0 model, while advanced in its capabilities, has certain limitations that users should be aware of:
We extend our gratitude to: