MCPcopy Index your code
hub / github.com/Ammmob/PixelSmile

github.com/Ammmob/PixelSmile @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
67 symbols 234 edges 9 files 26 documented · 39%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

PixelSmile: Toward Fine-Grained Facial Expression Editing

Paper      Project Page      Model      Coming soon      Demo

PixelSmile Demo

PixelSmile Teaser

📢 Updates

🚀 Release Plan

  • [x] Project Page
  • [x] Model Weight (Preview)
  • [x] Inference Code
  • [x] Benchmark Data
  • [x] Online Demo
  • [x] Training Code
  • [ ] Benchmark Code
  • [ ] Model Weight (Stable)

🧩 Community Contributions

A community implementation for ComfyUI is available here: - ComfyUI-PixelSmile-Conditioning-Interpolation

Thanks to @judian17 for making this possible.

⚡ Quick Start

Quick start for PixelSmile inference.

  1. Install the environment in Installation.
  2. Download the base model and PixelSmile weights in Model Download.
  3. Run inference in Inference.

🔧 Installation

For Inference

Clone the repository and enter the project directory:

git clone https://github.com/Ammmob/PixelSmile.git
cd PixelSmile

Create and activate a clean conda environment:

conda create -n pixelsmile python=3.10
conda activate pixelsmile

Install the inference dependencies:

pip install -r requirements.txt

⚠️ Important! Patch the current diffusers installation for the Qwen image edit bug:

bash scripts/patch_qwen_diffusers.sh

For Training

If you want to train PixelSmile, install the additional training dependencies on top of the inference environment:

pip install -r requirements-train.txt

🤗 Model Download

We recommend downloading all models to ./weights

For Inference

Base Model

PixelSmile uses Qwen-Image-Edit-2511 as the base model, you can download from Hugging Face.

PixelSmile

Model Version Data Type Download
PixelSmile-preview Preview Human Hugging Face

✨ A more stable version is coming soon, with improved human expression editing performance and support for anime expression editing.

For Training

Training requires additional pretrained weights and auxiliary models.

CLIP Encoder

Model Data Type Download
clip-vit-large-patch14 Human Hugging Face
DanbooruCLIP Anime Hugging Face

InsightFace Model

We use ArcFace for identity embedding during training.

  • Download and unzip antelopev2.zip to your model directory (default: ./weights/antelopev2).
  • Convert glintr100.onnx to glintr100.pth using onnx2torch.

📦 One-Click Download

# Inference models: Qwen base model + PixelSmile LoRA
bash scripts/download_infer_models.sh

# Training CLIP models: clip-vit-large-patch14 (human) + DanbooruCLIP (anime)
bash scripts/download_train_clip_models.sh

# Training InsightFace models: download antelopev2 and convert glintr100.onnx -> glintr100.pth
bash scripts/download_train_insightface.sh

🎨 Inference

The command below is an example for inference, model paths use our default directory: ./weights.

python pixelsmile/infer.py \
  --image-path /path/to/input.jpg \
  --output-dir /path/to/output \
  --model-path ./weights/Qwen-Image-Edit-2511 \
  --lora-path ./weights/PixelSmile-preview.safetensors \
  --expression happy \
  --data-type human \
  --scales 0 0.5 1.0 1.5 \
  --seed 42

🧠 Training

This repository includes the training entry script at pixelsmile/train.py.

Prepare config

Use pixelsmile/configs/example.yaml as reference and configure your training file at pixelsmile/configs/config.yaml.

  1. Configure model paths.
  2. example.yaml already uses our default model directory layout under ./weights/....
  3. If your models are in the same location, keep these defaults:
  4. model.pretrained_path: ./weights/Qwen-Image-Edit-2511
  5. model.insightface_detector_path: ./weights/antelopev2/scrfd_10g_bnkps.onnx
  6. model.insightface_recognition_path: ./weights/antelopev2/glintr100.pth

  7. Configure CLIP path by data type.

  8. Human data: model.clip_path: ./weights/clip-vit-large-patch14
  9. Anime data: model.clip_path: ./weights/DanbooruCLIP

  10. Configure dataset fields.

  11. dataset.path
  12. dataset.data_type

Run training

Single GPU:

python pixelsmile/train.py --config pixelsmile/configs/config.yaml

Multi-GPU (recommended via accelerate):

accelerate launch pixelsmile/train.py --config pixelsmile/configs/config.yaml

Training outputs are saved under exps/<timestamp>/ (ckpts, logs, configs).

Smoke Test (Recommended)

Before full training, start with a tiny run by temporarily setting:

  • dataset.max_samples: 8
  • training.num_epochs: 1
  • training.batch_size: 1
  • training.gradient_accumulation_steps: 1

If the smoke test works, switch back to your full training config.

📖 Citation

If you find PixelSmile useful in your research or applications, please consider citing our work.

@article{hua2026pixelsmile,
  title={PixelSmile: Toward Fine-Grained Facial Expression Editing},
  author={Hua, Jiabin and Xu, Hengyuan and Li, Aojie and Cheng, Wei and Yu, Gang and Ma, Xingjun and Jiang, Yu-Gang},
  journal={arXiv preprint arXiv:2603.25728},
  year={2026}
}

Core symbols most depended-on inside this repo

extract_clip_image_features
called by 4
pixelsmile/train.py
vae_decode
called by 4
pixelsmile/train.py
resize
called by 4
pixelsmile/utils/image.py
get_arcface_embeddings
called by 4
pixelsmile/losses/identity.py
compute_text_embeddings
called by 3
pixelsmile/linear_conditioning.py
encode_vae
called by 3
pixelsmile/precompute.py
compute_single_branch
called by 2
pixelsmile/train.py
_pad_prompt_batch
called by 2
pixelsmile/data/dataset.py

Shape

Function 44
Method 19
Class 4

Languages

Python100%

Modules by API surface

pixelsmile/losses/identity.py20 symbols
pixelsmile/train.py11 symbols
pixelsmile/linear_conditioning.py7 symbols
pixelsmile/infer.py7 symbols
pixelsmile/utils/image.py6 symbols
pixelsmile/losses/contrast.py6 symbols
pixelsmile/data/dataset.py6 symbols
pixelsmile/utils/lora_utils.py2 symbols
pixelsmile/precompute.py2 symbols

For agents

$ claude mcp add PixelSmile \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact