模型简介
模型特点
模型能力
使用案例
🚀 PVC v3
PVC v3 是一个基于潜在扩散模型的图像生成模型,它在 Waifu Diffusion v1.5 beta 2 的基础上,使用 PVC 手办图像进行了微调。用户可以使用 Danbooru 标签来生成图像。
🚀 快速开始
使用 🤗 的 Diffusers 库 可以简单高效地运行 Stable Diffusion 2。
pip install diffusers transformers accelerate scipy safetensors
pip install --pre xformers
使用 StableDiffusionPipeline
:
import torch
from diffusers import StableDiffusionPipeline
model_id = "p1atdev/pvc-v3"
revision = "fp16" # "main" or "fp16"
pipe = StableDiffusionPipeline.from_pretrained(
model_id,
revision=revision,
torch_dtype=torch.float16,
)
pipe = pipe.to("cuda")
pipe.enable_attention_slicing()
pipe.enable_xformers_memory_efficient_attention() # required
prompt = "pvc, masterpiece, best quality, exceptional, 1girl, cat ears, red hair, long hair, hairpin, swept bangs, yellow eyes, black jacket, white shirt, blue tie, white gloves, hand up, upper body, looking at viewer, buildings"
negative_prompt = "nsfw, nude, worst quality, low quality, oldest, bad anatomy"
image = pipe(
prompt,
negative_prompt=negative_prompt,
guidance_scale=7.0,
num_inference_steps=20
).images[0]
# save image
image.save("pvc_figure.png")
# or just display it
# display(image)
使用 StableDiffusionLongPromptWeightingPipeline
:
import torch
from diffusers import DiffusionPipeline
model_id = "p1atdev/pvc-v3"
revision = "fp16" # "main" or "fp16"
pipe = DiffusionPipeline.from_pretrained(
model_id,
revision=revision,
torch_dtype=torch.float16,
custom_pipeline="lpw_stable_diffusion"
)
pipe = pipe.to("cuda")
pipe.enable_attention_slicing()
pipe.enable_xformers_memory_efficient_attention() # required
prompt = """
pvc, anime, masterpiece, best quality, exceptional,
1girl, bangs, bare shoulders, beret, black hair, black shorts, blue hair, bracelet, breasts, buttons,
colored inner hair, double-breasted, eyewear removed, green headwear, green jacket, grey eyes, grey sky,
hat, jacket, jewelry, long hair, looking at viewer, multicolored hair, neck ring, o-ring, off shoulder, rain,
round eyewear, shorts, sidelocks, small breasts, solo, sunglasses, wavy hair, wet, zipper
""" # long prompt
negative_prompt = "nsfw, nude, worst quality, low quality, oldest, bad anatomy"
image = pipe(
prompt,
negative_prompt=negative_prompt,
guidance_scale=7.0,
num_inference_steps=20
).images[0]
display(image)
✨ 主要特性
- 基于 Waifu Diffusion v1.5 beta 2 微调,生成的图像具有 PVC 手办风格。
- 支持使用 Danbooru 标签进行图像生成。
- 提供多种模型版本供用户选择。
📦 安装指南
pip install diffusers transformers accelerate scipy safetensors
pip install --pre xformers
💻 使用示例
基础用法
import torch
from diffusers import StableDiffusionPipeline
model_id = "p1atdev/pvc-v3"
revision = "fp16" # "main" or "fp16"
pipe = StableDiffusionPipeline.from_pretrained(
model_id,
revision=revision,
torch_dtype=torch.float16,
)
pipe = pipe.to("cuda")
pipe.enable_attention_slicing()
pipe.enable_xformers_memory_efficient_attention() # required
prompt = "pvc, masterpiece, best quality, exceptional, 1girl, cat ears, red hair, long hair, hairpin, swept bangs, yellow eyes, black jacket, white shirt, blue tie, white gloves, hand up, upper body, looking at viewer, buildings"
negative_prompt = "nsfw, nude, worst quality, low quality, oldest, bad anatomy"
image = pipe(
prompt,
negative_prompt=negative_prompt,
guidance_scale=7.0,
num_inference_steps=20
).images[0]
# save image
image.save("pvc_figure.png")
# or just display it
# display(image)
高级用法
import torch
from diffusers import DiffusionPipeline
model_id = "p1atdev/pvc-v3"
revision = "fp16" # "main" or "fp16"
pipe = DiffusionPipeline.from_pretrained(
model_id,
revision=revision,
torch_dtype=torch.float16,
custom_pipeline="lpw_stable_diffusion"
)
pipe = pipe.to("cuda")
pipe.enable_attention_slicing()
pipe.enable_xformers_memory_efficient_attention() # required
prompt = """
pvc, anime, masterpiece, best quality, exceptional,
1girl, bangs, bare shoulders, beret, black hair, black shorts, blue hair, bracelet, breasts, buttons,
colored inner hair, double-breasted, eyewear removed, green headwear, green jacket, grey eyes, grey sky,
hat, jacket, jewelry, long hair, looking at viewer, multicolored hair, neck ring, o-ring, off shoulder, rain,
round eyewear, shorts, sidelocks, small breasts, solo, sunglasses, wavy hair, wet, zipper
""" # long prompt
negative_prompt = "nsfw, nude, worst quality, low quality, oldest, bad anatomy"
image = pipe(
prompt,
negative_prompt=negative_prompt,
guidance_scale=7.0,
num_inference_steps=20
).images[0]
display(image)
📚 详细文档
下载
文件名 | 大小 | 链接 |
---|---|---|
pvc-v3-fp16.safetensors | 2.58 GB | 点击下载 |
pvc-v3-fp16.ckpt | 2.58 GB | 点击下载 |
pvc-v3-fp32.safetensors | 5.16 GB | 点击下载 |
pvc-v3-fp32.ckpt | 5.16 GB | 点击下载 |
请使用 WD 的 vae 以获得更好的效果! 此外,你可以在负向提示词中使用 badquality embedding!
提示词指南
触发词
pvc
表示 PVC 材质风格,但并非总是必需。figma
是具有关节的手办风格,更倾向于产品缩略图。与doll joints
一起使用可获得更好的关节效果。nendoroid
表示黏土人风格。与chibi
一起使用可获得更好的效果。
提示
PVC 手办风格更接近动漫风格,而非写实风格。因此,有时建议在正向提示词中加入 anime
,或在负向提示词中加入 realistic
,以获得更好的效果。如果你想避免生成过于写实的面部,可以尝试这种方法!
示例
这里展示了一些使用该模型生成的图像示例,以及对应的提示词和参数设置。
正向提示词:masterpiece, best quality, pvc, 1girl, cat ears, blue hair, gradient hair, colored inner hair, long hair, floating hair, blue eyes, school uniform, blue shirt, ribbon, short skirt, thighhighs, zettai ryouiki, school bag, from above, cowboy shot, looking at viewer, wind, street, day 负向提示词:badquality, oldest, chibi 步数:28 采样器:DPM++ SDE Karras CFG 比例:10 种子:744670484 尺寸:576x768 模型哈希值:0866b17d46 模型:pvc-v3-fp16 去噪强度:0.6 Clip 跳过:2 高分辨率放大:1.5 高分辨率上采样器:Latent
(其他示例图片及对应信息同理展示,此处省略)
训练信息
参数 | 值 |
---|---|
服务 | Runpod |
GPU | A5000 |
笔记本 | Linaqruf/kohya-trainer |
成本 | 约 2 美元 |
时长 | 约 6 小时 |
数据集 | 来自 p1atdev/pvc 的 7467 张图像 |
分辨率 | 896 |
轮数 | 5 |
优化器 | Lion |
学习率 | 4e-7 |
调度器 | cosine_with_restarts |
训练批次大小 | 1 |
🔧 技术细节
该模型基于潜在扩散模型,在 Waifu Diffusion v1.5 beta 2 的基础上,使用 PVC 手办图像进行微调。训练过程中使用了特定的优化器和调度器,以提高模型的性能和稳定性。
📄 许可证
PVC v3 采用 Fair AI Public License 1.0-SD 许可协议(点击查看)。如果对该模型进行了衍生创作,请相应地分享你的更改。特别感谢 ronsor/undeleted(点击查看)在许可证方面提供的帮助。

