库名称: diffusers
许可证: openrail++
语言:
- 英语
标签:
- 文生图
- 稳定扩散
- LoRA
- 安全张量
- 稳定扩散XL
基础模型: Linaqruf/animagine-xl-2.0
示例:
- 文本: 面部特写,可爱,杰作,最佳质量,1女孩,绿发,毛衣,注视观众,上半身,无檐帽,户外,夜晚,高领衫
参数:
负面提示: 低分辨率,结构错误,手部畸形,文字,错误,缺指,多指,少指,裁剪,最差质量,低质量,普通质量,JPEG伪影,签名,水印,用户名,模糊
示例标题: 1女孩
- 文本: 面部特写,美少年,杰作,最佳质量,1男孩,绿发,毛衣,注视观众,上半身,无檐帽,户外,夜晚,高领衫
参数:
负面提示: 低分辨率,结构错误,手部畸形,文字,错误,缺指,多指,少指,裁剪,最差质量,低质量,普通质量,JPEG伪影,签名,水印,用户名,模糊
示例标题: 1男孩
动漫细节增强XL LoRA
概述
动漫细节增强XL LoRA 是一款前沿的LoRA适配器,专为与Animagine XL 2.0协同工作而设计。这个独特模型专注于概念调节,使用户能够调整生成动漫风格图像的细节水平。通过操作概念滑块,用户可以创建从高度细节化到更抽象表现的各种图像。
模型详情
🧨 Diffusers安装
确保安装最新版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
)
lora_model_id = "Linaqruf/anime-detailer-xl-lora"
lora_filename = "anime-detailer-xl.safetensors"
lora_scale_slider = 2
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=lora_scale_slider)
prompt = "面部特写,可爱,杰作,最佳质量,1女孩,绿发,毛衣,注视观众,上半身,无檐帽,户外,夜晚,高领衫"
negative_prompt = "低分辨率,结构错误,手部畸形,文字,错误,缺指,多指,少指,裁剪,最差质量,低质量,普通质量,JPEG伪影,签名,水印,用户名,模糊"
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("动漫女孩.png")
致谢
我们的项目受益于以下重要工作: