--- library_name: diffusers license: openrail++ language: - en tags: - text-to-image - stable-diffusion - lora - safetensors - stable-diffusion-xl base_model: Linaqruf/animagine-xl-2.0 widget: - text: face focus, cute, masterpiece, best quality, 1girl, green hair, sweater, looking at viewer, upper body, beanie, outdoors, night, turtleneck parameter: 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 example_title: 1girl - text: face focus, bishounen, masterpiece, best quality, 1boy, green hair, sweater, looking at viewer, upper body, beanie, outdoors, night, turtleneck parameter: 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 example_title: 1boy ---

Style Enhancer XL LoRA


## Overview **Style Enhancer XL LoRA** is a high resolution, LoRA adapter for Animagine XL 2.0. The model has been fine-tuned using a curated dataset of superior-quality anime-style images. Like other anime-style Stable Diffusion models, it also supports Danbooru tags to generate images. e.g. _**face focus, cute, masterpiece, best quality, 1girl, green hair, sweater, looking at viewer, upper body, beanie, outdoors, night, turtleneck**_
## Model Details - **Developed by:** [Linaqruf](https://github.com/Linaqruf) - **Model type:** LoRA adapter - **Model Description:** This is a small model that should be used with big model and can be used to generate and modify high quality anime-themed images based on text prompts. This adapter can enhance Animagine XL 2.0 style and also get `old-school` SD 1.5 anime model artstyle. - **License:** [CreativeML Open RAIL++-M License](https://huggingface.co/stabilityai/stable-diffusion-2/blob/main/LICENSE-MODEL) - **Finetuned from model:** [Animagine XL 2.0](https://huggingface.co/Linaqruf/animagine-xl-2.0)
## 🧨 Diffusers Make sure to upgrade diffusers to >= 0.23.0: ``` pip install diffusers --upgrade ``` In addition make sure to install `transformers`, `safetensors`, `accelerate` as well as the invisible watermark: ``` pip install invisible_watermark transformers accelerate safetensors ``` Running the pipeline (The default scheduler for Animagine XL 2.0 is **EulerAncestralDiscreteScheduler** but you may also declare it in the code if you want to make sure)*: ```py 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") ```
## Limitation This model inherit Stable Diffusion XL 1.0 [limitation](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0#limitations)