Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EchoFace

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.

Table of Contents

Project Overview

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.

Features

  • 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.json that 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.

Directory Structure

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

Installation

  1. Clone the repository:

    git clone https://github.com/Swathi-88/EchoFace.git
    cd EchoFace
  2. Install dependencies:

    pip install -r requirements.txt

    (Note: Ensure you have Python 3.8+ installed)

Usage

Follow these steps in order to process a new character.

Step 1: Image Analysis

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.py

Output: clean_identity_embeddings.npy, identity_profile/clean_image_mask.npy

Step 2: Build Identity Profile

Use the clean images to build the JSON identity profile.

python identity_profile/run_identity_profile.py

Output: identity_profile/identity_profile.json

Step 3: Generate Prompts

Generate a standard high-quality prompt based on the profile.

python prompt_engine/run_prompt_generation.py

To generate multiple creative variations (changing scene, outfit, mood) while keeping the identity locked:

python prompt_engine/run_prompt_variations.py

Modules

  • 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.

About

EchoFace is an advanced identity-consistency engine for Generative AI. It analyzes sets of reference photos to extract precise physical traits and builds a structured "Identity Profile prompts."

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages