Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: diffusers
|
| 3 |
+
pipeline_tag: text-to-image
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
# Style Portrait
|
| 7 |
+
|
| 8 |
+

|
| 9 |
+
|
| 10 |
+
Style Portrait is a SD-v1.5 based text-to-image generation model. It can generate high-quality 512*832 images of Asia portrait.
|
| 11 |
+
|
| 12 |
+
This repository contains checkpoints for diffusers and SD-WebUI.
|
| 13 |
+
|
| 14 |
+
# Checkpoints
|
| 15 |
+
|
| 16 |
+
- style-portait-v1-5-fp16.safetensors: Checkpoint for Stable-Diffusion-WebUI.
|
| 17 |
+
- Others: Checkpoint for Diffusers.
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
# Diffusers Usage
|
| 21 |
+
|
| 22 |
+
```python3
|
| 23 |
+
import torch
|
| 24 |
+
|
| 25 |
+
from diffusers import DiffusionPipeline
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
model_id = "Tramac/style-portrait-v1-5"
|
| 29 |
+
pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
| 30 |
+
pipeline = pipeline.to("cuda")
|
| 31 |
+
|
| 32 |
+
prompt = "1girl, long hair, close-up, elegant, upper body, natural skin texture, highly detailed"
|
| 33 |
+
negative_prompt = "cloned face, ugly, out of frame, mutated, extra arms, cross-eye, blurry, bad art, bad anatomy, badhands, watermark, text, long neck, worst quality, low quality"
|
| 34 |
+
image = pipeline(
|
| 35 |
+
prompt=prompt,
|
| 36 |
+
negative_prompt=negative_prompt,
|
| 37 |
+
height=832,
|
| 38 |
+
width=512,
|
| 39 |
+
).images[0]
|
| 40 |
+
|
| 41 |
+
image.save("demo.png")
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
# WebUI Usage
|
| 45 |
+
|
| 46 |
+
1. Download the checkpoint (style-portait-v1-5-fp16.safetensors) to /Stable-Diffusion-WebUI/models/Stable-diffusion.
|
| 47 |
+
2. Start up WebUI and load checkpoint.
|