这个模型是在 Waifu Diffusion v1.5 beta 2.6 上对 PVC 图像进行微调的潜在扩散模型。您可以使用 Danbooru 标签生成图像。
请使用 WD's vae 获取好的结果!
强烈推荐使用高分辨率修复。
pvc 表示 pvc 材质风格,但不是必需的。
figma 是具有关节的模型风格,更倾向于产品缩略图。要获取关节,请将 figma 强调为 1.2 ~ 1.5倍或使用 doll joints 标签。
nendoroid 是迷你人物模型的风格。与 chibi 一起使用可获得更好的迷你人物。
(worst quality, low quality, bad aesthetic, oldest), bad anatomy, bad hands, text, cropped, signature, blurry
masterpiece, best quality, best aesthetic, 1girl, red hair, cat ears, closed eyes, closed mouth, expressionless, maid costume, apron, lolita dress, frills, lying on back, sheets, red flowers, from above Negative prompt: (worst quality, low quality, bad aesthetic, oldest), bad anatomy, bad hands, text, error, cropped, jpeg artifacts, signature, watermark, username, blurry Steps: 18, Sampler: DPM++ 2M Karras, CFG scale: 7, Seed: 1166304922, Size: 512x768, Model hash: 0866b17d46, Model: pvc-v3-fp16, Denoising strength: 0.7, Clip skip: 2, Hires upscale: 1.5, Hires steps: 12, Hires upscaler: Latent
TODO:稍后完成
| Parameter | Value |
|---|---|
| Service | Runpod |
| GPU | A4500 |
| Script | 12310321 |
| Cost | about $10 |
| Hours | about 30 hours |
| Dataset | about 18000 images from p1atdev/pvc |
| Resolution | 768 |
| Epochs | 13 |
| Optimizer | Lion |
| LR | 1e-7 |
| Scheduler | cosine_with_restarts |
| Train Batch Size | 12 |
使用 🤗's Diffusers library 来简单高效地运行 Stable Diffusion 2。
pip install diffusers transformers accelerate scipy safetensors pip install xformers
使用 StableDiffusionPipeline:
import torch
from diffusers import StableDiffusionPipeline
model_id = "p1atdev/pvc-v4"
pipe = StableDiffusionPipeline.from_pretrained(
model_id,
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, bad aesthetic, 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-v4"
pipe = DiffusionPipeline.from_pretrained(
model_id,
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, bad aesthetic, oldest, bad anatomy"
image = pipe(
prompt,
negative_prompt=negative_prompt,
guidance_scale=7.0,
num_inference_steps=20
).images[0]
display(image)
此模型发布在公平AI公共许可证1.0-SD下( https://freedevproject.org/faipl-1.0-sd/ )。如果生成此模型的任何派生版本,请相应共享您的更改。特别感谢 ronsor/undeleted( https://undeleted.ronsor.com/ )对许可证的帮助。
该模型采用与 WD1.5 相同的公平AI公共许可证1.0-SD。如果在生成服务等中使用此模型或其派生者,则需要公开向服务用户提供模型。有关详细/准确的许可信息,请参阅 原文 。