MagicFace-V3 / README.md
openfree's picture
Update README.md
694e0a8 verified

A newer version of the Gradio SDK is available: 6.1.0

Upgrade
metadata
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

  1. Face Identity Preservation: Uses InsightFace for face detection and embedding extraction, ensuring the generated images maintain the user's facial features
  2. Multiple Image Support: Can process multiple photos of the same person to create a better average representation
  3. 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)
  4. Custom Prompts: Users can write their own transformation descriptions
  5. 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

  1. User uploads one or more face photos
  2. The system extracts facial embeddings using InsightFace
  3. If multiple photos are provided, it averages the embeddings
  4. The face is aligned and cropped for better results
  5. IP-Adapter integrates the facial features into the Stable Diffusion generation process
  6. 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 기반 μ–Όκ΅΄ λ³€ν™˜ μ• ν”Œλ¦¬μΌ€μ΄μ…˜μž…λ‹ˆλ‹€. μ‚¬μš©μžκ°€ μ—…λ‘œλ“œν•œ 사진을 λ‹€μ–‘ν•œ 예술적 μŠ€νƒ€μΌμ΄λ‚˜ κ°€μƒμ˜ μΊλ¦­ν„°λ‘œ λ³€ν™˜ν•˜λ©΄μ„œλ„ μ–Όκ΅΄μ˜ 정체성을 μœ μ§€ν•©λ‹ˆλ‹€.

μ£Όμš” κΈ°λŠ₯

  1. μ–Όκ΅΄ 정체성 보쑴: InsightFaceλ₯Ό μ‚¬μš©ν•˜μ—¬ 얼꡴을 κ°μ§€ν•˜κ³  μž„λ² λ”©μ„ μΆ”μΆœν•˜μ—¬ μƒμ„±λœ 이미지가 μ‚¬μš©μžμ˜ μ–Όκ΅΄ νŠΉμ§•μ„ μœ μ§€ν•˜λ„λ‘ ν•©λ‹ˆλ‹€
  2. 닀쀑 이미지 지원: λ™μΌμΈμ˜ μ—¬λŸ¬ 사진을 μ²˜λ¦¬ν•˜μ—¬ 더 λ‚˜μ€ 평균 ν‘œν˜„μ„ 생성할 수 μžˆμŠ΅λ‹ˆλ‹€
  3. 사전 μ„€μ • μŠ€νƒ€μΌ: 10κ°€μ§€ 사전 κ΅¬μ„±λœ λ³€ν™˜ μŠ€νƒ€μΌ 제곡:
    • ν΄λž˜μ‹ μ•„νŠΈ μŠ€νƒ€μΌ (λͺ¨λ‚˜λ¦¬μž, 반 고흐)
    • 가상 캐릭터 (아이언 νžˆμ–΄λ‘œ, μŠ€νƒ€μ›Œμ¦ˆ μ œλ‹€μ΄, 맀트릭슀 νžˆμ–΄λ‘œ)
    • 역사적 인물 (μ΄μ§‘νŠΈ 파라였, 그리슀 μ‹ , 쀑세 기사)
    • λͺ¨ν—˜ ν…Œλ§ˆ (해적 μ„ μž₯, μ…œλ‘ ν™ˆμ¦ˆ)
  4. μ‚¬μš©μž μ •μ˜ ν”„λ‘¬ν”„νŠΈ: μ‚¬μš©μžκ°€ μ›ν•˜λŠ” λ³€ν™˜ μ„€λͺ…을 직접 μž‘μ„± κ°€λŠ₯
  5. 성별 선택: μ„ νƒλœ 성별에 따라 생성 μ΅œμ ν™”

기술적 κ΅¬μ„±μš”μ†Œ

  • κΈ°λ³Έ λͺ¨λΈ: Realistic_Vision_V4.0_noVAE
  • IP-μ–΄λŒ‘ν„°: μ–Όκ΅΄ νŠΉμ§• 보쑴을 μœ„ν•œ FaceID 및 FaceID Plus λͺ¨λΈ
  • μ–Όκ΅΄ 뢄석: InsightFace의 Buffalo_l λͺ¨λΈ
  • 생성 λ§€κ°œλ³€μˆ˜:
    • 512x768 해상도
    • 100 μΆ”λ‘  단계
    • μ–Όκ΅΄ 강도: 2.1
    • μœ μ‚¬λ„ 강도: 0.7

μž‘λ™ 방식

  1. μ‚¬μš©μžκ°€ ν•œ μž₯ μ΄μƒμ˜ μ–Όκ΅΄ 사진을 μ—…λ‘œλ“œ
  2. μ‹œμŠ€ν…œμ΄ InsightFaceλ₯Ό μ‚¬μš©ν•˜μ—¬ μ–Όκ΅΄ μž„λ² λ”© μΆ”μΆœ
  3. μ—¬λŸ¬ 사진이 제곡된 경우 μž„λ² λ”©μ˜ 평균값 계산
  4. 더 λ‚˜μ€ κ²°κ³Όλ₯Ό μœ„ν•΄ μ–Όκ΅΄ μ •λ ¬ 및 크둭
  5. IP-Adapterκ°€ μ–Όκ΅΄ νŠΉμ§•μ„ Stable Diffusion 생성 ν”„λ‘œμ„ΈμŠ€μ— 톡합
  6. μ§€μ •λœ μŠ€νƒ€μΌλ‘œ μ–Όκ΅΄ 정체성을 μœ μ§€ν•˜λ©΄μ„œ 단일 인물 μ΄ˆμƒν™” 생성

μ•ˆμ „ κΈ°λŠ₯

  • μƒμ„±λœ 이미지에 μ—¬λŸ¬ μ‚¬λžŒμ΄ λ‚˜νƒ€λ‚˜λŠ” 것을 λ°©μ§€ν•˜λŠ” λ„€κ±°ν‹°λΈŒ ν”„λ‘¬ν”„νŠΈ 포함
  • 단일 인물 μ΄ˆμƒν™”λ§Œ μƒμ„±λ˜λ„λ‘ 보μž₯
  • λΉ λ₯Έ 처리λ₯Ό μœ„ν•œ Spaces GPU 가속

이 μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ€ μ‚¬μš©μžμ˜ 얼꡴을 λ‹€μ–‘ν•œ 예술적 μŠ€νƒ€μΌλ‘œ λ³€ν™˜ν•˜λ©΄μ„œλ„ 본인의 μ–Όκ΅΄ νŠΉμ§•μ„ μœ μ§€ν•˜λŠ” ν˜μ‹ μ μΈ AI λ„κ΅¬μž…λ‹ˆλ‹€.