đ Style Enhancer XL LoRA
Style Enhancer XL LoRA is an advanced LoRA adapter that enhances the capabilities of Animagine XL 2.0. It excels in fine - tuning anime - style images, offering high - quality and detailed outputs. It integrates well with Stable Diffusion XL and supports Danbooru tags for creative image generation.
đ Quick Start
Installation
Ensure the installation of the latest diffusers
library, along with other essential packages:
pip install diffusers --upgrade
pip install transformers accelerate safetensors
Usage
The following Python script demonstrates how to utilize the Style Enhancer XL LoRA with Animagine XL 2.0. The default scheduler is EulerAncestralDiscreteScheduler, but it can be explicitly defined for clarity.
import torch
from diffusers import (
StableDiffusionXLPipeline,
EulerAncestralDiscreteScheduler,
AutoencoderKL
)
lora_model_id = "Linaqruf/style-enhancer-xl-lora"
lora_filename = "style-enhancer-xl.safetensors"
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')
pipe.load_lora_weights(lora_model_id, weight_name=lora_filename)
pipe.fuse_lora(lora_scale=0.6)
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]
pipe.unfuse_lora()
image.save("anime_girl.png")
⨠Features
- Advanced Enhancement: It is an advanced, high - resolution LoRA adapter designed to enhance the capabilities of Animagine XL 2.0.
- Anime - Style Tuning: Excels in fine - tuning and refining anime - style images, producing high - quality and detailed outputs.
- Stable Diffusion Integration: Seamlessly integrates with the Stable Diffusion XL framework.
- Danbooru Tag Support: Uniquely supports Danbooru tags for precise and creative 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
import torch
from diffusers import (
StableDiffusionXLPipeline,
EulerAncestralDiscreteScheduler,
AutoencoderKL
)
lora_model_id = "Linaqruf/style-enhancer-xl-lora"
lora_filename = "style-enhancer-xl.safetensors"
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')
pipe.load_lora_weights(lora_model_id, weight_name=lora_filename)
pipe.fuse_lora(lora_scale=0.6)
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]
pipe.unfuse_lora()
image.save("anime_girl.png")
đ Documentation
Model Details
Property |
Details |
Developed by |
Linaqruf |
Model Type |
LoRA adapter for Stable Diffusion XL |
Model Description |
A compact yet powerful adapter designed to augment and enhance the output of large models like Animagine XL 2.0. This adapter not only improves the style and quality of anime - themed images but also allows users to recreate the distinct 'old - school' art style of SD 1.5. It's the perfect tool for generating high - fidelity, anime - inspired visual content. |
License |
[CreativeML Open RAIL++ - M License](https://huggingface.co/stabilityai/stable-diffusion-2/blob/main/LICENSE - MODEL) |
Finetuned from model |
Animagine XL 2.0 |
đ License
This model is released under the [CreativeML Open RAIL++ - M License](https://huggingface.co/stabilityai/stable-diffusion-2/blob/main/LICENSE - MODEL).