模型概述
模型特點
模型能力
使用案例
🚀 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(點擊查看)在許可證方面提供的幫助。

