🚀 SoteDiffusion Wuerstchen3
SoteDiffusion Wuerstchen3 是对 Würstchen V3 进行的动漫微调模型,可用于将文本转化为动漫风格的图像。
新版本信息
新版本已发布:https://huggingface.co/Disty0/sotediffusion-v2
🚀 快速开始
本模型可通过 API 与 Fal.AI 结合使用,更多详情请参考:https://fal.ai/models/fal-ai/stable-cascade/sote-diffusion
✨ 主要特性
- 本版本由 fal.ai/grants 赞助发布。
- 使用 8 块 A100 80G GPU,在 600 万张图像上进行了 3 个轮次的训练。
📦 安装指南
SD.Next
- 访问:https://github.com/vladmandic/automatic/
- 进入
Models -> Huggingface
,在模型名称中输入 Disty0/sotediffusion-wuerstchen3-decoder
并点击下载。
- 下载完成后,加载
Disty0/sotediffusion-wuerstchen3-decoder
。
ComfyUI
请参考 CivitAI:https://civitai.com/models/353284
💻 使用示例
基础用法
import torch
from diffusers import StableCascadeCombinedPipeline
device = "cuda"
dtype = torch.bfloat16
model = "Disty0/sotediffusion-wuerstchen3-decoder"
pipe = StableCascadeCombinedPipeline.from_pretrained(model, torch_dtype=dtype)
pipe = pipe.to(device, dtype=dtype)
pipe.prior_pipe = pipe.prior_pipe.to(device, dtype=dtype)
prompt = "newest, extremely aesthetic, best quality, 1girl, solo, cat ears, pink hair, orange eyes, long hair, bare shoulders, looking at viewer, smile, indoors, casual, living room, playing guitar,"
negative_prompt = "very displeasing, worst quality, monochrome, realistic, oldest, loli,"
output = pipe(
width=1024,
height=1536,
prompt=prompt,
negative_prompt=negative_prompt,
decoder_guidance_scale=2.0,
prior_guidance_scale=7.0,
prior_num_inference_steps=30,
output_type="pil",
num_inference_steps=10
).images[0]
📚 详细文档
模型参数
基础训练参数
参数 |
值 |
amp |
bf16 |
weights |
fp32 |
save weights |
fp16 |
resolution |
1024x1024 |
effective batch size |
128 |
unet learning rate |
1e-5 |
te learning rate |
4e-6 |
optimizer |
Adafactor |
images |
6M |
epochs |
3 |
最终训练参数
参数 |
值 |
amp |
bf16 |
weights |
fp32 |
save weights |
fp16 |
resolution |
1024x1024 |
effective batch size |
128 |
unet learning rate |
4e-6 |
te learning rate |
none |
optimizer |
Adafactor |
images |
120K |
epochs |
16 |
数据集信息
数据集规模
数据集名称 |
总图像数 |
newest |
1,848,331 |
recent |
1,380,630 |
mid |
993,227 |
early |
566,152 |
oldest |
160,397 |
pixiv |
343,614 |
visual novel cg |
231,358 |
anime wallpaper |
104,790 |
Total |
5,628,499 |
数据集说明
- 最小尺寸为 1280x600(768,000 像素)。
- 使用 czkawka-cli 基于图像相似度进行去重。
- 约 120K 张高质量图像有意重复 5 次,使总图像数达到 620 万。
标签信息
标签顺序
模型以随机标签顺序进行训练,但数据集中的标签顺序如下:
aesthetic tags, quality tags, date tags, custom tags, rating tags, character, series, rest of the tags
日期标签
标签 |
日期 |
newest |
2022 至 2024 |
recent |
2019 至 2021 |
mid |
2015 至 2018 |
early |
2011 至 2014 |
oldest |
2005 至 2010 |
美学标签
分数大于 |
标签 |
数量 |
0.90 |
extremely aesthetic |
125,451 |
0.80 |
very aesthetic |
887,382 |
0.70 |
aesthetic |
1,049,857 |
0.50 |
slightly aesthetic |
1,643,091 |
0.40 |
not displeasing |
569,543 |
0.30 |
not aesthetic |
445,188 |
0.20 |
slightly displeasing |
341,424 |
0.10 |
displeasing |
237,660 |
rest of them |
very displeasing |
328,712 |
质量标签
分数大于 |
标签 |
数量 |
0.980 |
best quality |
1,270,447 |
0.900 |
high quality |
498,244 |
0.750 |
great quality |
351,006 |
0.500 |
medium quality |
366,448 |
0.250 |
normal quality |
368,380 |
0.125 |
bad quality |
279,050 |
0.025 |
low quality |
538,958 |
rest of them |
worst quality |
1,955,966 |
评级标签
标签 |
数量 |
general |
1,416,451 |
sensitive |
3,447,664 |
nsfw |
427,459 |
explicit nsfw |
336,925 |
自定义标签
数据集名称 |
自定义标签 |
image boards |
date, |
text |
The text says "text", |
characters |
character, series |
pixiv |
art by Display_Name, |
visual novel cg |
Full_VN_Name (short_3_letter_name), visual novel cg, |
anime wallpaper |
date, anime wallpaper, |
🔧 技术细节
训练信息
标注信息
- 用于标注的 GPU:1x Intel ARC A770 16GB
- GPU 时长:350 小时
- 用于标注的模型:SmilingWolf/wd-swinv2-tagger-v3
- 用于文本的模型:llava-hf/llava-1.5-7b-hf
- 标注命令:
python /mnt/DataSSD/AI/Apps/kohya_ss/sd-scripts/finetune/tag_images_by_wd14_tagger.py --model_dir "/mnt/DataSSD/AI/models/wd14_tagger_model" --repo_id "SmilingWolf/wd-swinv2-tagger-v3" --recursive --remove_underscore --use_rating_tags --character_tags_first --character_tag_expand --append_tags --onnx --caption_separator ", " --general_threshold 0.35 --character_threshold 0.50 --batch_size 4 --caption_extension ".txt" ./
📄 许可证
SoteDiffusion 模型遵循 Fair AI Public License 1.0-SD 许可协议,该协议与 Stable Diffusion 模型的许可协议兼容。要点如下:
- 修改共享:如果您修改了 SoteDiffusion 模型,必须同时共享您的修改和原始许可协议。
- 源代码可访问性:如果您的修改版本可以通过网络访问,需提供一种方式(如下载链接)让他人获取源代码。这也适用于派生模型。
- 分发条款:任何分发都必须遵循此许可协议或其他具有类似规则的协议。
- 合规性:若不遵守规定,必须在 30 天内纠正,以避免许可协议终止,强调透明度和遵守开源价值观。
注意:Fair AI 许可协议未涵盖的内容继承自 Stability AI 非商业许可协议,名为 LICENSE_INHERIT。
⚠️ 重要提示
- 本模型专为动漫插画设计,未对其写实能力进行测试。
- 模型可能会生成写实风格的图像,此时可在负向提示词中添加 "realistic" 标签。
- 远景中的眼睛和手部细节可能表现不佳。