Anime Detailer Xl Lora
模型简介
该模型是一个概念滑块适配器,允许用户通过调整参数控制生成动漫图像的细节程度,从高度细节化到更抽象表现均可实现。
模型特点
细节可调节
通过概念滑块控制生成图像的细节水平,范围从-2(较少细节)到2(更多细节)
动漫风格优化
专门针对动漫风格图像进行优化,能生成高质量的动漫人物和场景
安全张量支持
使用safetensors格式,确保模型加载和使用的安全性
模型能力
动漫风格图像生成
细节程度可调的图像生成
高质量人物肖像生成
使用案例
数字艺术创作
动漫角色设计
生成各种细节程度的动漫角色概念图
可获得从简略到精细的不同风格角色设计
动漫场景创作
生成具有不同细节水平的动漫风格场景
可根据需要调整场景的细节丰富程度
🚀 Anime Detailer XL LoRA
Anime Detailer XL LoRA是一款先进的LoRA适配器,可与Animagine XL 2.0配合使用。它专注于概念调制,能让用户调整生成的动漫风格图像的细节程度,通过操作概念滑块,用户可以创建从高度细节到更抽象表现的图像。
🚀 快速开始
安装依赖
确保安装最新的 diffusers
库以及其他必要的包:
pip install diffusers --upgrade
pip install transformers accelerate safetensors
运行示例代码
以下Python脚本展示了如何将LoRA与Animagine XL 2.0结合使用。默认调度器为 EulerAncestralDiscreteScheduler
,为清晰起见,也可显式定义。
import torch
from diffusers import (
StableDiffusionXLPipeline,
EulerAncestralDiscreteScheduler,
AutoencoderKL
)
# Initialize LoRA model and weights
lora_model_id = "Linaqruf/anime-detailer-xl-lora"
lora_filename = "anime-detailer-xl.safetensors"
lora_scale_slider = 2 # -2 for less detailed result
# 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')
# Load and fuse LoRA weights
pipe.load_lora_weights(lora_model_id, weight_name=lora_filename)
pipe.fuse_lora(lora_scale=lora_scale_slider)
# 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]
# Unfuse LoRA before saving the image
pipe.unfuse_lora()
image.save("anime_girl.png")
✨ 主要特性
Anime Detailer XL LoRA是一款前沿的LoRA适配器,专为与Animagine XL 2.0协同工作而设计。该独特模型专注于概念调制,使用户能够调整生成的动漫风格图像的细节程度。通过操作概念滑块,用户可以创建从高度详细到更抽象表现的图像。
📦 安装指南
确保安装最新的 diffusers
库以及其他必要的包:
pip install diffusers --upgrade
pip install transformers accelerate safetensors
💻 使用示例
基础用法
import torch
from diffusers import (
StableDiffusionXLPipeline,
EulerAncestralDiscreteScheduler,
AutoencoderKL
)
# Initialize LoRA model and weights
lora_model_id = "Linaqruf/anime-detailer-xl-lora"
lora_filename = "anime-detailer-xl.safetensors"
lora_scale_slider = 2 # -2 for less detailed result
# 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')
# Load and fuse LoRA weights
pipe.load_lora_weights(lora_model_id, weight_name=lora_filename)
pipe.fuse_lora(lora_scale=lora_scale_slider)
# 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]
# Unfuse LoRA before saving the image
pipe.unfuse_lora()
image.save("anime_girl.png")
📚 详细文档
模型详情
属性 | 详情 |
---|---|
开发者 | Linaqruf |
模型类型 | Stable Diffusion XL的LoRA适配器 |
模型描述 | 此适配器是一个概念滑块,允许用户控制动漫主题图像的细节程度。滑块设置越接近2,结果越详细;越接近 -2,结果越不详细。它是艺术家和创作者在动漫图像中寻求各种艺术表达的多功能工具。 |
许可证 | CreativeML Open RAIL++-M License |
微调基础模型 | Animagine XL 2.0 |
🔧 技术细节
Anime Detailer XL LoRA作为一个LoRA适配器,与Animagine XL 2.0结合使用,通过概念调制来控制生成的动漫图像的细节程度。它利用了 diffusers
库中的 StableDiffusionXLPipeline
进行图像生成,同时使用 EulerAncestralDiscreteScheduler
作为调度器。在代码实现中,首先加载VAE组件,然后配置管道,接着加载并融合LoRA权重,最后根据定义的提示生成图像。在保存图像之前,需要解除LoRA的融合。
📄 许可证
本项目采用 CreativeML Open RAIL++-M License 许可证。
致谢
我们的项目受益于以下重要工作:
- Erasing Concepts from Diffusion Models 作者:Rohit Gandikota等人
- LECO 作者:p1atdev
- AI Toolkit 作者:Ostris
Stable Diffusion V1 5
Openrail
稳定扩散是一种潜在的文本到图像扩散模型,能够根据任何文本输入生成逼真的图像。
图像生成
S
stable-diffusion-v1-5
3.7M
518
Stable Diffusion Inpainting
Openrail
基于稳定扩散的文本到图像生成模型,具备图像修复能力
图像生成
S
stable-diffusion-v1-5
3.3M
56
Stable Diffusion Xl Base 1.0
SDXL 1.0是基于扩散的文本生成图像模型,采用专家集成的潜在扩散流程,支持高分辨率图像生成
图像生成
S
stabilityai
2.4M
6,545
Stable Diffusion V1 4
Openrail
稳定扩散是一种潜在文本到图像扩散模型,能够根据任意文本输入生成逼真图像。
图像生成
S
CompVis
1.7M
6,778
Stable Diffusion Xl Refiner 1.0
SD-XL 1.0优化器模型是Stability AI开发的图像生成模型,专为提升SDXL基础模型生成的图像质量而设计,特别擅长最终去噪步骤处理。
图像生成
S
stabilityai
1.1M
1,882
Stable Diffusion 2 1
基于扩散的文本生成图像模型,支持通过文本提示生成和修改图像
图像生成
S
stabilityai
948.75k
3,966
Stable Diffusion Xl 1.0 Inpainting 0.1
基于Stable Diffusion XL的潜在文本到图像扩散模型,具备通过遮罩进行图像修复的功能
图像生成
S
diffusers
673.14k
334
Stable Diffusion 2 Base
基于扩散的文生图模型,可根据文本提示生成高质量图像
图像生成
S
stabilityai
613.60k
349
Playground V2.5 1024px Aesthetic
其他
开源文生图模型,能生成1024x1024分辨率及多种纵横比的美学图像,在美学质量上处于开源领域领先地位。
图像生成
P
playgroundai
554.94k
723
Sd Turbo
SD-Turbo是一款高速文本生成图像模型,仅需单次网络推理即可根据文本提示生成逼真图像。该模型作为研究原型发布,旨在探索小型蒸馏文本生成图像模型。
图像生成
S
stabilityai
502.82k
380
精选推荐AI模型
Llama 3 Typhoon V1.5x 8b Instruct
专为泰语设计的80亿参数指令模型,性能媲美GPT-3.5-turbo,优化了应用场景、检索增强生成、受限生成和推理任务
大型语言模型
Transformers 支持多种语言

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-Tiny是一个基于SODA数据集训练的超小型对话模型,专为边缘设备推理设计,体积仅为Cosmo-3B模型的2%左右。
对话系统
Transformers 英语

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
基于RoBERTa架构的中文抽取式问答模型,适用于从给定文本中提取答案的任务。
问答系统 中文
R
uer
2,694
98