EchoFace is an advanced identity-consistency tool for generative AI. It analyzes a set of reference photos to build a comprehensive "Identity Profile" and uses this profile to generate consistent, high-quality prompts for Stable Diffusion or other image generators.
EchoFace solves the problem of "identity drift" in AI character generation. Instead of guessing prompts, it purely analyzes your input images to extract physical traits (face shape, skin tone, hair texture, etc.) and constructs a structured JSON profile. This profile is then used to programmatically build prompts that guarantee the character looks the same across different scenes and styles.
- Automated Curation: Detects and removes outlier images that don't match the person's identity.
- Trait Extraction: Analyzes face shape, skin tone, hair color/texture, and expression bias.
- Profile Generation: Creates a
identity_profile.jsonthat serves as the "source of truth" for the character. - Dynamic Prompting: Generates base prompts and infinite stylistic variations (lighting, mood, outfit) while locking the identity.
EchoFace/
├── image_analysis/ # Step 1: Image loading, embedding, and filtering
│ ├── run_module1.py # Main script for analysis
│ └── ...
├── identity_profile/ # Step 2: Trait extraction and profile building
│ ├── run_identity_profile.py
│ └── ...
├── prompt_engine/ # Step 3: Prompt generation logic
│ ├── run_prompt_generation.py
│ ├── run_prompt_variations.py
│ └── ...
└── requirements.txt
-
Clone the repository:
git clone https://github.com/Swathi-88/EchoFace.git cd EchoFace -
Install dependencies:
pip install -r requirements.txt
(Note: Ensure you have Python 3.8+ installed)
Follow these steps in order to process a new character.
Place your reference photos in image_analysis/test_images. Then run the analysis script to filter bad images and generate embeddings.
python image_analysis/run_module1.pyOutput: clean_identity_embeddings.npy, identity_profile/clean_image_mask.npy
Use the clean images to build the JSON identity profile.
python identity_profile/run_identity_profile.pyOutput: identity_profile/identity_profile.json
Generate a standard high-quality prompt based on the profile.
python prompt_engine/run_prompt_generation.pyTo generate multiple creative variations (changing scene, outfit, mood) while keeping the identity locked:
python prompt_engine/run_prompt_variations.py- Image Analysis: Uses deep learning embeddings to mathematically verify face similarity.
- Identity Profile: Aggregates traits to find the "average" look of the person.
- Prompt Engine: A flexible template system that inserts identity tokens into various stylistic contexts.