openfree commited on
Commit
694e0a8
ยท
verified ยท
1 Parent(s): 5a3d4bf

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +82 -0
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 ๋„๊ตฌ์ž…๋‹ˆ๋‹ค.