Spaces:
Runtime error
A newer version of the Gradio SDK is available:
6.1.0
title: Magic Face V3
emoji: π€ͺ
colorFrom: green
colorTo: blue
sdk: gradio
sdk_version: 5.35.0
app_file: app.py
pinned: false
license: mit
short_description: Source-code Include
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:
English Explanation
Overview
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.
Key Features
- Face Identity Preservation: Uses InsightFace for face detection and embedding extraction, ensuring the generated images maintain the user's facial features
- Multiple Image Support: Can process multiple photos of the same person to create a better average representation
- Preset Styles: Offers 10 pre-configured transformation styles including:
- Classic art styles (Mona Lisa, Van Gogh)
- Fictional characters (Iron Hero, Star Wars Jedi, Matrix Hero)
- Historical figures (Egyptian Pharaoh, Greek God, Medieval Knight)
- Adventure themes (Pirate Captain, Sherlock Holmes)
- Custom Prompts: Users can write their own transformation descriptions
- Gender Selection: Optimizes generation based on selected gender
Technical Components
- Base Model: Realistic_Vision_V4.0_noVAE
- IP-Adapter: FaceID and FaceID Plus models for facial feature preservation
- Face Analysis: Buffalo_l model from InsightFace
- Generation Parameters:
- 512x768 resolution
- 100 inference steps
- Face strength: 2.1
- Likeness strength: 0.7
How It Works
- User uploads one or more face photos
- The system extracts facial embeddings using InsightFace
- If multiple photos are provided, it averages the embeddings
- The face is aligned and cropped for better results
- IP-Adapter integrates the facial features into the Stable Diffusion generation process
- The system generates a single portrait with the specified style while maintaining facial identity
Safety Features
- Includes negative prompts to prevent multiple people in generated images
- Ensures single person portraits only
- GPU acceleration via Spaces for faster processing
νκΈ μ€λͺ
κ°μ
MagicFace V3λ IP-Adapter FaceID κΈ°μ κ³Ό Stable Diffusionμ νμ©ν AI κΈ°λ° μΌκ΅΄ λ³ν μ ν리μΌμ΄μ μ λλ€. μ¬μ©μκ° μ λ‘λν μ¬μ§μ λ€μν μμ μ μ€νμΌμ΄λ κ°μμ μΊλ¦ν°λ‘ λ³ννλ©΄μλ μΌκ΅΄μ μ 체μ±μ μ μ§ν©λλ€.
μ£Όμ κΈ°λ₯
- μΌκ΅΄ μ μ²΄μ± λ³΄μ‘΄: InsightFaceλ₯Ό μ¬μ©νμ¬ μΌκ΅΄μ κ°μ§νκ³ μλ² λ©μ μΆμΆνμ¬ μμ±λ μ΄λ―Έμ§κ° μ¬μ©μμ μΌκ΅΄ νΉμ§μ μ μ§νλλ‘ ν©λλ€
- λ€μ€ μ΄λ―Έμ§ μ§μ: λμΌμΈμ μ¬λ¬ μ¬μ§μ μ²λ¦¬νμ¬ λ λμ νκ· ννμ μμ±ν μ μμ΅λλ€
- μ¬μ μ€μ μ€νμΌ: 10κ°μ§ μ¬μ ꡬμ±λ λ³ν μ€νμΌ μ 곡:
- ν΄λμ μνΈ μ€νμΌ (λͺ¨λ리μ, λ° κ³ ν)
- κ°μ μΊλ¦ν° (μμ΄μΈ νμ΄λ‘, μ€νμμ¦ μ λ€μ΄, λ§€νΈλ¦μ€ νμ΄λ‘)
- μμ¬μ μΈλ¬Ό (μ΄μ§νΈ νλΌμ€, κ·Έλ¦¬μ€ μ , μ€μΈ κΈ°μ¬)
- λͺ¨ν ν λ§ (ν΄μ μ μ₯, μ λ‘ νμ¦)
- μ¬μ©μ μ μ ν둬ννΈ: μ¬μ©μκ° μνλ λ³ν μ€λͺ μ μ§μ μμ± κ°λ₯
- μ±λ³ μ ν: μ νλ μ±λ³μ λ°λΌ μμ± μ΅μ ν
κΈ°μ μ ꡬμ±μμ
- κΈ°λ³Έ λͺ¨λΈ: Realistic_Vision_V4.0_noVAE
- IP-μ΄λν°: μΌκ΅΄ νΉμ§ 보쑴μ μν FaceID λ° FaceID Plus λͺ¨λΈ
- μΌκ΅΄ λΆμ: InsightFaceμ Buffalo_l λͺ¨λΈ
- μμ± λ§€κ°λ³μ:
- 512x768 ν΄μλ
- 100 μΆλ‘ λ¨κ³
- μΌκ΅΄ κ°λ: 2.1
- μ μ¬λ κ°λ: 0.7
μλ λ°©μ
- μ¬μ©μκ° ν μ₯ μ΄μμ μΌκ΅΄ μ¬μ§μ μ λ‘λ
- μμ€ν μ΄ InsightFaceλ₯Ό μ¬μ©νμ¬ μΌκ΅΄ μλ² λ© μΆμΆ
- μ¬λ¬ μ¬μ§μ΄ μ 곡λ κ²½μ° μλ² λ©μ νκ· κ° κ³μ°
- λ λμ κ²°κ³Όλ₯Ό μν΄ μΌκ΅΄ μ λ ¬ λ° ν¬λ‘
- IP-Adapterκ° μΌκ΅΄ νΉμ§μ Stable Diffusion μμ± νλ‘μΈμ€μ ν΅ν©
- μ§μ λ μ€νμΌλ‘ μΌκ΅΄ μ 체μ±μ μ μ§νλ©΄μ λ¨μΌ μΈλ¬Ό μ΄μν μμ±
μμ κΈ°λ₯
- μμ±λ μ΄λ―Έμ§μ μ¬λ¬ μ¬λμ΄ λνλλ κ²μ λ°©μ§νλ λ€κ±°ν°λΈ ν둬ννΈ ν¬ν¨
- λ¨μΌ μΈλ¬Ό μ΄μνλ§ μμ±λλλ‘ λ³΄μ₯
- λΉ λ₯Έ μ²λ¦¬λ₯Ό μν Spaces GPU κ°μ
μ΄ μ ν리μΌμ΄μ μ μ¬μ©μμ μΌκ΅΄μ λ€μν μμ μ μ€νμΌλ‘ λ³ννλ©΄μλ λ³ΈμΈμ μΌκ΅΄ νΉμ§μ μ μ§νλ νμ μ μΈ AI λꡬμ λλ€.