stable-diffusion safetensors

PVC v4

This model is a latent diffusion model finetuned on Waifu Diffusion v1.5 beta 2.6 with PVC figure images. You can use Danbooru tags to generate images.

Downloads

<div class="flex flex-col dark:bg-gray-900 rounded-md divide-y dark:divide-gray-800">

<div class="flex justify-between px-4 py-2"> <a class="underline" href="https://huggingface.co/p1atdev/pvc-v4/resolve/checkpoints/pvc-v4-fp16.safetensors">pvc-v4-fp16.safetensors</a> <div>2.58 GB</div> </div>

<div class="flex justify-between px-4 py-2"> <a class="underline" href="https://huggingface.co/p1atdev/pvc-v4/resolve/checkpoints/pvc-v4-fp32.safetensors">pvc-v4-fp32.safetensors</a> <div>4.31 GB</div> </div>

<div class="flex justify-between px-4 py-1"> <a class="underline opacity-75" href="https://huggingface.co/p1atdev/pvc-v4/tree/checkpoints">Show all</a> </div>

</div>

Please use WD's vae to get good results!

Prompt guide

Highres fix is highly recommended.

Trigger words

Negative prompt

(worst quality, low quality, bad aesthetic, oldest), bad anatomy, bad hands, text, cropped, signature, blurry

Comparison to v3

sample-diff-1

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

Examples

TODO: あとでやる

Training information

<details> <table> <thead> <tr><th>Parameter</td><td>Value</th></tr> </thead> <tbody>

<tr><td>Service</td><td>Runpod</td></tr> <tr><td>GPU</td><td>A4500</td></tr> <tr><td>Script</td><td><a href="https://github.com/kohya-ss/sd-scripts" target="_blank">kohya-ss/sd-scripts</a></td></tr> <tr><td>Cost</td><td>about $10</td></tr> <tr><td>Hours</td><td>about 30 hours</td></tr>

<tr><td>Dataset</td><td>about 18000 images from p1atdev/pvc</td></tr> <tr><td>Resolution</td><td>768</td></tr> <tr><td>Epochs</td><td>13</td></tr> <tr><td>Optimizer</td><td>Lion</td></tr> <tr><td>LR</td><td>1e-7</td></tr> <tr><td>Scheduler</td><td>cosine_with_restarts</td></tr> <tr><td>Train Batch Size</td><td>12</td></tr>

</tbody> </table> </details>

🧨 Diffusers

Using the 🤗's Diffusers library to run Stable Diffusion 2 in a simple and efficient manner.

pip install diffusers transformers accelerate scipy safetensors
pip install xformers

Using 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)

Using 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)

License

This model is released under the Fair AI Public License 1.0-SD (https://freedevproject.org/faipl-1.0-sd/). If any derivative of this model is made, please share your changes accordingly. Special thanks to ronsor/undeleted (https://undeleted.ronsor.com/) for help with the license.

WD1.5 と同じ Fair AI Public License 1.0-SD ライセンスです。生成サービスなどでこのモデルまたは派生モデルを使う場合は、サービスの利用者にモデルを公開する必要があります。詳しい/正確なライセンスは 原文 を参照ください。