File size: 4,156 Bytes
0663c69 c89df6e 0663c69 c89df6e 0663c69 c89df6e a11abf8 c89df6e a11abf8 c89df6e 68b551a c89df6e a11abf8 c89df6e a11abf8 c89df6e a11abf8 c89df6e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
---
title: Stable Diffusion WebUI
emoji: ๐ธ
colorFrom: pink
colorTo: purple
sdk: docker
pinned: false
---
# ๐ธ Anime Diffusion WebUI
ํ๊น
ํ์ด์ค ์คํ์ด์ค์์ ์คํ๋๋ ์ ๋๋ฉ์ด์
์คํ์ผ ์ด๋ฏธ์ง ์์ฑ๊ธฐ์
๋๋ค.
## โจ ๊ธฐ๋ฅ
- **ํ
์คํธ โ ์ด๋ฏธ์ง (txt2img)**: ํ๋กฌํํธ๋ฅผ ์
๋ ฅํ์ฌ ์ด๋ฏธ์ง ์์ฑ
- **์ด๋ฏธ์ง โ ์ด๋ฏธ์ง (img2img)**: ๊ธฐ์กด ์ด๋ฏธ์ง๋ฅผ ์ ๋๋ฉ์ด์
์คํ์ผ๋ก ๋ณํ
- **๋ค์ํ ์ ๋๋ฉ์ด์
๋ชจ๋ธ**: 8๊ฐ์ง ์ธ๊ธฐ ๋ชจ๋ธ ์ง์
- **๋ค๊ฑฐํฐ๋ธ ํ๋กฌํํธ**: ์ํ์ง ์๋ ์์ ์ ์ธ
- **๋ณํ ๊ฐ๋ ์กฐ์ **: img2img์์ ์๋ณธ ์ ์ง ์ ๋ ์กฐ์
- **REST API ์ง์**: ์ธ๋ถ ์ฑ์์ API ํธ์ถ ๊ฐ๋ฅ
## ๐ค ์ง์ ๋ชจ๋ธ
| ๋ชจ๋ธ | ํน์ง |
|------|------|
| **Mistoon Anime V3** โญ | ์นดํฐํ ์ ๋๋ฉ์ด์
, ์ ๋ช
ํ ์์, ๋๊บผ์ด ์ธ๊ณฝ์ |
| **Anything V5** | ๊ฐ์ฅ ์ธ๊ธฐ ์๋ ์ ๋๋ฉ์ด์
๋ชจ๋ธ |
| **Counterfeit V3** | ๊ณ ํ์ง ์ ๋๋ฉ์ด์
/์ผ๋ฌ์คํธ |
| **DreamShaper V8** | ๋ค์ํ ์คํ์ผ ์ง์ |
| **OpenJourney V4** | Midjourney ์คํ์ผ |
| **Stable Diffusion v1.5** | ๊ธฐ๋ณธ ๋ชจ๋ธ |
| **MeinaMix V11** | ๊ณ ํ๋ฆฌํฐ ์ ๋๋ฉ์ด์
|
| **ReV Animated** | ์ ๋๋ฉ์ด์
ํนํ |
## ๐ ์ฌ์ฉ๋ฒ
1. ๋๋กญ๋ค์ด์์ ์ํ๋ ๋ชจ๋ธ์ ์ ํํฉ๋๋ค
2. ํ๋กฌํํธ ์
๋ ฅ์ฐฝ์ ์ํ๋ ์ด๋ฏธ์ง๋ฅผ ์ค๋ช
ํฉ๋๋ค
3. (์ ํ) ๋ค๊ฑฐํฐ๋ธ ํ๋กฌํํธ๋ก ์ํ์ง ์๋ ์์๋ฅผ ์ง์ ํฉ๋๋ค
4. ์ด๋ฏธ์ง ํฌ๊ธฐ์ ์์ฑ ์ต์
์ ์กฐ์ ํฉ๋๋ค
5. "๐ ์ด๋ฏธ์ง ์์ฑ" ๋ฒํผ์ ํด๋ฆญํฉ๋๋ค
## ๐ก ํ๋กฌํํธ ์์
```
1girl, solo, long blue hair, blue eyes, school uniform,
cherry blossoms, masterpiece, best quality, detailed
```
## โ ๏ธ ์ฃผ์์ฌํญ
- CPU ๋ชจ๋์์๋ ์ด๋ฏธ์ง ์์ฑ์ 2-5๋ถ ์ ๋ ์์๋ฉ๋๋ค
- ์ฒซ ์คํ ์ ๋ชจ๋ธ ๋ค์ด๋ก๋๋ก ์ถ๊ฐ ์๊ฐ์ด ํ์ํฉ๋๋ค
- GPU ์คํ์ด์ค๋ฅผ ์ฌ์ฉํ๋ฉด ํจ์ฌ ๋น ๋ฅธ ์์ฑ์ด ๊ฐ๋ฅํฉ๋๋ค
## ๐ REST API ์ฌ์ฉ๋ฒ
์ด ํ๋ก์ ํธ๋ ์น ์ธํฐํ์ด์ค๋ฟ๋ง ์๋๋ผ REST API๋ ์ ๊ณตํฉ๋๋ค.
### 1. ํ
์คํธ โ ์ด๋ฏธ์ง API (txt2img)
- **์๋ํฌ์ธํธ**: `POST /api/generate`
- **๋ณธ๋ฌธ ๊ตฌ์กฐ (JSON)**:
```json
{
"prompt": "์์ฑํ ํ๋กฌํํธ (ํ์)",
"negative_prompt": "์ ์ธํ ํ๊ทธ (์ ํ)",
"model_name": "์ฌ์ฉํ ๋ชจ๋ธ ์ด๋ฆ (์ ํ)",
"width": 512,
"height": 512,
"num_inference_steps": 25,
"guidance_scale": 7.5,
"seed": -1
}
```
### 2. ์ด๋ฏธ์ง โ ์ด๋ฏธ์ง API (img2img)
- **์๋ํฌ์ธํธ**: `POST /api/img2img`
- **๋ณธ๋ฌธ ๊ตฌ์กฐ (JSON)**:
```json
{
"image_base64": "Base64๋ก ์ธ์ฝ๋ฉ๋ ์
๋ ฅ ์ด๋ฏธ์ง (ํ์)",
"prompt": "๋ณํํ ์คํ์ผ ํ๋กฌํํธ (ํ์)",
"negative_prompt": "์ ์ธํ ํ๊ทธ (์ ํ)",
"model_name": "์ฌ์ฉํ ๋ชจ๋ธ ์ด๋ฆ (์ ํ)",
"strength": 0.75,
"num_inference_steps": 25,
"guidance_scale": 7.5,
"seed": -1
}
```
### 3. Python ํธ์ถ ์์ (txt2img)
```python
import requests
import base64
url = "https://your-space.hf.space/api/generate"
payload = {
"prompt": "1girl, anime, long hair, masterpiece",
"negative_prompt": "bad anatomy, blurry",
}
response = requests.post(url, json=payload)
data = response.json()
if data["success"]:
with open("output.png", "wb") as f:
f.write(base64.b64decode(data["image_base64"]))
```
### 4. Python ํธ์ถ ์์ (img2img)
```python
import requests
import base64
# ์ด๋ฏธ์ง๋ฅผ Base64๋ก ์ธ์ฝ๋ฉ
with open("input.jpg", "rb") as f:
image_base64 = base64.b64encode(f.read()).decode("utf-8")
url = "https://your-space.hf.space/api/img2img"
payload = {
"image_base64": image_base64,
"prompt": "anime style, colorful, masterpiece",
"strength": 0.75
}
response = requests.post(url, json=payload)
data = response.json()
if data["success"]:
with open("output.png", "wb") as f:
f.write(base64.b64decode(data["image_base64"]))
```
## ๐ ๏ธ ๊ธฐ์ ์คํ
- **FastAPI / Uvicorn** - REST API ์๋ฒ
- **Gradio** - ์น ์ธํฐํ์ด์ค
- **Diffusers** - ํ๊น
ํ์ด์ค ๋ํจ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ
- **Docker** - ์ปจํ
์ด๋ ํ๊ฒฝ
- **PyTorch** - ๋ฅ๋ฌ๋ ํ๋ ์์ํฌ
|