Skip to content

Lorakszak/avatar_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Avatar Image Generation Project

Originally created: October 23, 2024

AI avatar generation using one-shot identity preservation - generating stylized images from a single face photo.

Two diffusion-based approaches are compared: InstantID (higher fidelity) and IP-Adapter-FaceID-SDXL (higher flexibility).

Results

InstantID - No Separate ControlNet Guiding

Face image is used both for identity and as the ControlNet pose reference.

Lucy Liu (Film Noir):

Lucy Liu Film Noir

The Rock (Steampunk):

The Rock Steampunk

Gal Gadot (Anime):

Gal Gadot Anime

Eddie Murphy (Pixelart):

Eddie Murphy Pixelart

InstantID - With Separate ControlNet Guiding

Face image and pose/stance image are two separate inputs.

Eddie Murphy face with Elon controlnet in Pixelart style:

Eddie Murphy Elon Pixelart

The Rock face with DiCaprio stance in Photo-realism style:

The Rock DiCaprio Photo-realism

Gal Gadot face with female stance in mechanical/robotic style:

Gal Gadot Mechanical

Lucy Liu face with profile view stance in animation style:

Lucy Liu Animation

Some dude's face with DiCaprio controlnet in digital painting style:

Digital Painting

IP-Adapter-FaceID-SDXL

Uses only face embeddings, no ControlNet pose needed.

The Rock as pixelart:

The Rock Pixelart

Gal Gadot in red dress:

Gal Gadot Red Dress

Eddie Murphy as a muscular dude:

Eddie Murphy Muscular

Lucy Liu as WWII Soviet poster:

Lucy Liu Soviet Poster

Me in my 40s as a muscular dude:

Me Muscular

Models Compared

InstantID IP-Adapter-FaceID-SDXL
Input Face image + ControlNet pose image Face image only
Identity fidelity Higher Lower
Flexibility Limited by ControlNet pose High (text-driven composition)
Best for Inpainting, face swaps Text-to-image generation

How to Run

The project was built as a Google Colab notebook. To run it:

  1. Open Avatar_project_notebook.ipynb in Google Colab
  2. File > Save a copy in Drive
  3. Runtime > Change runtime type > set GPU to L4 or T4, enable High-RAM
  4. Run the Helper Functions section first
  5. Run the Installation and Initialization section for your chosen method (InstantID or IP-Adapter)
  6. Use the TRY IT YOURSELF cells to generate with your own face photo

Note: Some parts require more RAM/VRAM than the free Colab tier provides. L4 GPU with High-RAM is recommended.

Project Structure

Avatar_project_notebook.ipynb   # Main notebook with code, explanations, and results
images/                         # Extracted result images (referenced by the notebook)

License

GPL-3.0

About

One-shot identity-preserving avatar generation using InstantID and IP-Adapter-FaceID-SDXL (Oct 2024)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors