HuggingFace镜像/sotediffusion-wuerstchen3
模型介绍文件和版本分析
下载使用量0

新版本已发布:https://huggingface.co/Disty0/sotediffusion-v2

SoteDiffusion Wuerstchen3

Würstchen V3 的动漫微调版本。

发布说明

  • 本版本由 fal.ai/grants 赞助发布
  • 使用 8 张 A100 80G GPU,在 600 万张图像上训练了 3 个 epoch。

API 使用方法

可通过 Fal.AI 的 API 使用本模型
详情请见:https://fal.ai/models/fal-ai/stable-cascade/sote-diffusion

界面使用指南

SD.Next

网址:https://github.com/vladmandic/automatic/

进入“模型”->“Huggingface”,在模型名称处输入 Disty0/sotediffusion-wuerstchen3-decoder,然后点击下载。
下载完成后,加载 Disty0/sotediffusion-wuerstchen3-decoder。

提示词:

newest, extremely aesthetic, best quality,

反向提示词:

very displeasing, worst quality, monochrome, realistic, oldest, loli,

参数:
采样器:默认

步数:30 或 40
优化器步数:10

CFG:7
次要 CFG:2 或 1

分辨率:1024x1536、2048x1152
只要是 128 的倍数,任何分辨率均可。

ComfyUI

请参考 CivitAI:https://civitai.com/models/353284

代码示例

pip install diffusers
import torch
from diffusers import StableCascadeCombinedPipeline

device = "cuda"
dtype = torch.bfloat16 # or torch.float16
model = "Disty0/sotediffusion-wuerstchen3-decoder"

pipe = StableCascadeCombinedPipeline.from_pretrained(model, torch_dtype=dtype)

# send everything to the gpu:
pipe = pipe.to(device, dtype=dtype)
pipe.prior_pipe = pipe.prior_pipe.to(device, dtype=dtype)

# or enable model offload to save vram:
# pipe.enable_model_cpu_offload()



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]

## do something with the output image

训练:

使用软件:Kohya SD-Scripts(Stable Cascade 分支)。
https://github.com/kohya-ss/sd-scripts/tree/stable-cascade

使用 GPU:8 块 Nvidia A100 80GB
GPU 时长:220 小时

基础训练

参数值
ampbf16
权重fp32
保存权重fp16
分辨率1024x1024
有效批大小128
unet 学习率1e-5
te 学习率4e-6
优化器Adafactor
图像数量600 万
训练轮次3

最终训练

参数值
ampbf16
权重fp32
保存权重fp16
分辨率1024x1024
有效批大小128
unet 学习率4e-6
te 学习率无
优化器Adafactor
图像数量12 万
训练轮次16

数据集:

用于标注的 GPU:1 块 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" ./
数据集名称图片总数
newest1,848,331
recent1,380,630
mid993,227
early566,152
oldest160,397
pixiv343,614
visual novel cg231,358
anime wallpaper104,790
Total5,628,499

注意:

  • 最小尺寸为 1280x600 | 768,000 像素
  • 使用 czkawka-cli 基于图像相似度进行去重
  • 约 12 万张超高质量图片被有意重复 5 次,使图片总数达到 620 万

标签:

模型训练时采用随机标签顺序,但如果您感兴趣,以下是数据集中的标签顺序:

aesthetic tags, quality tags, date tags, custom tags, rating tags, character, series, rest of the tags

日期:

标签日期
最新2022 年至 2024 年
近期2019 年至 2021 年
中期2015 年至 2018 年
早期2011 年至 2014 年
最早2005 年至 2010 年

美学标签:

使用模型:shadowlilac/aesthetic-shadow-v2

分数大于标签数量
0.90extremely aesthetic125.451
0.80very aesthetic887.382
0.70aesthetic1.049.857
0.50slightly aesthetic1.643.091
0.40not displeasing569.543
0.30not aesthetic445.188
0.20slightly displeasing341.424
0.10displeasing237.660
其余very displeasing328.712

质量标签:

使用模型:https://huggingface.co/hakurei/waifu-diffusion-v1-4/blob/main/models/aes-B32-v0.pth

分数大于标签数量
0.980best quality1.270.447
0.900high quality498.244
0.750great quality351.006
0.500medium quality366.448
0.250normal quality368.380
0.125bad quality279.050
0.025low quality538.958
其余worst quality1.955.966

评级标签:

标签数量
general1.416.451
sensitive3.447.664
nsfw427.459
explicit nsfw336.925

自定义标签:

数据集名称自定义标签
image boardsdate,
textThe text says "text",
characterscharacter, series
pixivart by Display_Name,
visual novel cgFull_VN_Name (short_3_letter_name), visual novel cg,
anime wallpaperdate, anime wallpaper,

局限性与偏差

偏差

  • 本模型专为动漫插画设计。
    其写实能力完全未经测试。

局限性

  • 可能会生成写实风格内容。
    出现这种情况时,需在负面提示词中添加“realistic”标签。
  • 远景中的眼睛和手部可能效果不佳。

许可证

SoteDiffusion 模型遵循 Fair AI Public License 1.0-SD 许可证,该许可证与 Stable Diffusion 模型的许可证兼容。核心要点如下:

  1. 修改共享:若对 SoteDiffusion 模型进行修改,必须同时分享所做的更改及原始许可证。
  2. 源代码可访问性:若修改后的版本可通过网络访问,需提供获取源代码的途径(如下载链接)。这同样适用于衍生模型。
  3. 分发条款:任何分发行为必须基于本许可证或其他具有类似规则的许可证。
  4. 合规性:若出现不合规情况,必须在 30 天内纠正,以避免许可证终止,这强调了透明度和对开源价值观的遵循。

注意:Fair AI 许可证未涵盖的内容,均继承自 Stability AI 非商业许可证,该许可证命名为 LICENSE_INHERIT。