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).
Face image is used both for identity and as the ControlNet pose reference.
Lucy Liu (Film Noir):
The Rock (Steampunk):
Gal Gadot (Anime):
Eddie Murphy (Pixelart):
Face image and pose/stance image are two separate inputs.
Eddie Murphy face with Elon controlnet in Pixelart style:
The Rock face with DiCaprio stance in Photo-realism style:
Gal Gadot face with female stance in mechanical/robotic style:
Lucy Liu face with profile view stance in animation style:
Some dude's face with DiCaprio controlnet in digital painting style:
Uses only face embeddings, no ControlNet pose needed.
The Rock as pixelart:
Gal Gadot in red dress:
Eddie Murphy as a muscular dude:
Lucy Liu as WWII Soviet poster:
Me in my 40s as a muscular dude:
| 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 |
The project was built as a Google Colab notebook. To run it:
- Open
Avatar_project_notebook.ipynbin Google Colab File>Save a copy in DriveRuntime>Change runtime type> set GPU to L4 or T4, enable High-RAM- Run the Helper Functions section first
- Run the Installation and Initialization section for your chosen method (InstantID or IP-Adapter)
- 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.
Avatar_project_notebook.ipynb # Main notebook with code, explanations, and results
images/ # Extracted result images (referenced by the notebook)
GPL-3.0