Spaces:
Running
on
Zero
Running
on
Zero
Update README.md
Browse files
README.md
CHANGED
@@ -10,4 +10,86 @@ pinned: false
|
|
10 |
license: mit
|
11 |
short_description: Source-code Include
|
12 |
---
|
|
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
license: mit
|
11 |
short_description: Source-code Include
|
12 |
---
|
13 |
+
Looking at this code, it's a Gradio-based web application called "MagicFace V3" that uses IP-Adapter technology to transform user faces into various character styles. Here's a detailed explanation:
|
14 |
|
15 |
+
## English Explanation
|
16 |
+
|
17 |
+
### Overview
|
18 |
+
MagicFace V3 is an AI-powered face transformation application that uses Stable Diffusion with IP-Adapter FaceID technology. It allows users to upload their photos and transform them into various artistic styles or fictional characters while preserving their facial identity.
|
19 |
+
|
20 |
+
### Key Features
|
21 |
+
1. **Face Identity Preservation**: Uses InsightFace for face detection and embedding extraction, ensuring the generated images maintain the user's facial features
|
22 |
+
2. **Multiple Image Support**: Can process multiple photos of the same person to create a better average representation
|
23 |
+
3. **Preset Styles**: Offers 10 pre-configured transformation styles including:
|
24 |
+
- Classic art styles (Mona Lisa, Van Gogh)
|
25 |
+
- Fictional characters (Iron Hero, Star Wars Jedi, Matrix Hero)
|
26 |
+
- Historical figures (Egyptian Pharaoh, Greek God, Medieval Knight)
|
27 |
+
- Adventure themes (Pirate Captain, Sherlock Holmes)
|
28 |
+
4. **Custom Prompts**: Users can write their own transformation descriptions
|
29 |
+
5. **Gender Selection**: Optimizes generation based on selected gender
|
30 |
+
|
31 |
+
### Technical Components
|
32 |
+
- **Base Model**: Realistic_Vision_V4.0_noVAE
|
33 |
+
- **IP-Adapter**: FaceID and FaceID Plus models for facial feature preservation
|
34 |
+
- **Face Analysis**: Buffalo_l model from InsightFace
|
35 |
+
- **Generation Parameters**:
|
36 |
+
- 512x768 resolution
|
37 |
+
- 100 inference steps
|
38 |
+
- Face strength: 2.1
|
39 |
+
- Likeness strength: 0.7
|
40 |
+
|
41 |
+
### How It Works
|
42 |
+
1. User uploads one or more face photos
|
43 |
+
2. The system extracts facial embeddings using InsightFace
|
44 |
+
3. If multiple photos are provided, it averages the embeddings
|
45 |
+
4. The face is aligned and cropped for better results
|
46 |
+
5. IP-Adapter integrates the facial features into the Stable Diffusion generation process
|
47 |
+
6. The system generates a single portrait with the specified style while maintaining facial identity
|
48 |
+
|
49 |
+
### Safety Features
|
50 |
+
- Includes negative prompts to prevent multiple people in generated images
|
51 |
+
- Ensures single person portraits only
|
52 |
+
- GPU acceleration via Spaces for faster processing
|
53 |
+
|
54 |
+
---
|
55 |
+
|
56 |
+
## ํ๊ธ ์ค๋ช
|
57 |
+
|
58 |
+
### ๊ฐ์
|
59 |
+
MagicFace V3๋ IP-Adapter FaceID ๊ธฐ์ ๊ณผ Stable Diffusion์ ํ์ฉํ AI ๊ธฐ๋ฐ ์ผ๊ตด ๋ณํ ์ ํ๋ฆฌ์ผ์ด์
์
๋๋ค. ์ฌ์ฉ์๊ฐ ์
๋ก๋ํ ์ฌ์ง์ ๋ค์ํ ์์ ์ ์คํ์ผ์ด๋ ๊ฐ์์ ์บ๋ฆญํฐ๋ก ๋ณํํ๋ฉด์๋ ์ผ๊ตด์ ์ ์ฒด์ฑ์ ์ ์งํฉ๋๋ค.
|
60 |
+
|
61 |
+
### ์ฃผ์ ๊ธฐ๋ฅ
|
62 |
+
1. **์ผ๊ตด ์ ์ฒด์ฑ ๋ณด์กด**: InsightFace๋ฅผ ์ฌ์ฉํ์ฌ ์ผ๊ตด์ ๊ฐ์งํ๊ณ ์๋ฒ ๋ฉ์ ์ถ์ถํ์ฌ ์์ฑ๋ ์ด๋ฏธ์ง๊ฐ ์ฌ์ฉ์์ ์ผ๊ตด ํน์ง์ ์ ์งํ๋๋ก ํฉ๋๋ค
|
63 |
+
2. **๋ค์ค ์ด๋ฏธ์ง ์ง์**: ๋์ผ์ธ์ ์ฌ๋ฌ ์ฌ์ง์ ์ฒ๋ฆฌํ์ฌ ๋ ๋์ ํ๊ท ํํ์ ์์ฑํ ์ ์์ต๋๋ค
|
64 |
+
3. **์ฌ์ ์ค์ ์คํ์ผ**: 10๊ฐ์ง ์ฌ์ ๊ตฌ์ฑ๋ ๋ณํ ์คํ์ผ ์ ๊ณต:
|
65 |
+
- ํด๋์ ์ํธ ์คํ์ผ (๋ชจ๋๋ฆฌ์, ๋ฐ ๊ณ ํ)
|
66 |
+
- ๊ฐ์ ์บ๋ฆญํฐ (์์ด์ธ ํ์ด๋ก, ์คํ์์ฆ ์ ๋ค์ด, ๋งคํธ๋ฆญ์ค ํ์ด๋ก)
|
67 |
+
- ์ญ์ฌ์ ์ธ๋ฌผ (์ด์งํธ ํ๋ผ์ค, ๊ทธ๋ฆฌ์ค ์ , ์ค์ธ ๊ธฐ์ฌ)
|
68 |
+
- ๋ชจํ ํ
๋ง (ํด์ ์ ์ฅ, ์
๋ก ํ์ฆ)
|
69 |
+
4. **์ฌ์ฉ์ ์ ์ ํ๋กฌํํธ**: ์ฌ์ฉ์๊ฐ ์ํ๋ ๋ณํ ์ค๋ช
์ ์ง์ ์์ฑ ๊ฐ๋ฅ
|
70 |
+
5. **์ฑ๋ณ ์ ํ**: ์ ํ๋ ์ฑ๋ณ์ ๋ฐ๋ผ ์์ฑ ์ต์ ํ
|
71 |
+
|
72 |
+
### ๊ธฐ์ ์ ๊ตฌ์ฑ์์
|
73 |
+
- **๊ธฐ๋ณธ ๋ชจ๋ธ**: Realistic_Vision_V4.0_noVAE
|
74 |
+
- **IP-์ด๋ํฐ**: ์ผ๊ตด ํน์ง ๋ณด์กด์ ์ํ FaceID ๋ฐ FaceID Plus ๋ชจ๋ธ
|
75 |
+
- **์ผ๊ตด ๋ถ์**: InsightFace์ Buffalo_l ๋ชจ๋ธ
|
76 |
+
- **์์ฑ ๋งค๊ฐ๋ณ์**:
|
77 |
+
- 512x768 ํด์๋
|
78 |
+
- 100 ์ถ๋ก ๋จ๊ณ
|
79 |
+
- ์ผ๊ตด ๊ฐ๋: 2.1
|
80 |
+
- ์ ์ฌ๋ ๊ฐ๋: 0.7
|
81 |
+
|
82 |
+
### ์๋ ๋ฐฉ์
|
83 |
+
1. ์ฌ์ฉ์๊ฐ ํ ์ฅ ์ด์์ ์ผ๊ตด ์ฌ์ง์ ์
๋ก๋
|
84 |
+
2. ์์คํ
์ด InsightFace๋ฅผ ์ฌ์ฉํ์ฌ ์ผ๊ตด ์๋ฒ ๋ฉ ์ถ์ถ
|
85 |
+
3. ์ฌ๋ฌ ์ฌ์ง์ด ์ ๊ณต๋ ๊ฒฝ์ฐ ์๋ฒ ๋ฉ์ ํ๊ท ๊ฐ ๊ณ์ฐ
|
86 |
+
4. ๋ ๋์ ๊ฒฐ๊ณผ๋ฅผ ์ํด ์ผ๊ตด ์ ๋ ฌ ๋ฐ ํฌ๋กญ
|
87 |
+
5. IP-Adapter๊ฐ ์ผ๊ตด ํน์ง์ Stable Diffusion ์์ฑ ํ๋ก์ธ์ค์ ํตํฉ
|
88 |
+
6. ์ง์ ๋ ์คํ์ผ๋ก ์ผ๊ตด ์ ์ฒด์ฑ์ ์ ์งํ๋ฉด์ ๋จ์ผ ์ธ๋ฌผ ์ด์ํ ์์ฑ
|
89 |
+
|
90 |
+
### ์์ ๊ธฐ๋ฅ
|
91 |
+
- ์์ฑ๋ ์ด๋ฏธ์ง์ ์ฌ๋ฌ ์ฌ๋์ด ๋ํ๋๋ ๊ฒ์ ๋ฐฉ์งํ๋ ๋ค๊ฑฐํฐ๋ธ ํ๋กฌํํธ ํฌํจ
|
92 |
+
- ๋จ์ผ ์ธ๋ฌผ ์ด์ํ๋ง ์์ฑ๋๋๋ก ๋ณด์ฅ
|
93 |
+
- ๋น ๋ฅธ ์ฒ๋ฆฌ๋ฅผ ์ํ Spaces GPU ๊ฐ์
|
94 |
+
|
95 |
+
์ด ์ ํ๋ฆฌ์ผ์ด์
์ ์ฌ์ฉ์์ ์ผ๊ตด์ ๋ค์ํ ์์ ์ ์คํ์ผ๋ก ๋ณํํ๋ฉด์๋ ๋ณธ์ธ์ ์ผ๊ตด ํน์ง์ ์ ์งํ๋ ํ์ ์ ์ธ AI ๋๊ตฌ์
๋๋ค.
|