Spaces:
Runtime error
Runtime error
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 λꡬμ
λλ€.
|