HuggingFace镜像/PixelSmile
模型介绍文件和版本分析
下载使用量0

PixelSmile: 迈向精细化面部表情编辑

论文      项目页面      GitHub 代码      基准测试集      演示

PixelSmile 演示图

📢 更新

  • [2026年4月14日] 🔥 训练代码 现已发布。
  • [2026年3月29日] 🔥 ComfyUI 支持(社区贡献)已上线。
  • [2026年3月27日] 🔥 arXiv 论文 现已可获取。
  • [2026年3月26日] 🔥 在线演示 已启动,欢迎体验 🎮
  • [2026年3月25日] 🔥 推理代码 和 基准测试数据 已发布。
  • [2026年3月24日] 🔥 项目页面 和 模型权重(预览版) 已发布。

🧩 社区贡献

ComfyUI 的社区实现可在此处获取:

  • ComfyUI-PixelSmile-Conditioning-Interpolation

感谢 @judian17 为此所做的贡献。

⚡ 快速开始

PixelSmile 推理快速入门。

  1. 在 安装 部分安装环境。
  2. 在 模型下载 部分下载基础模型和 PixelSmile 权重。
  3. 在 推理 部分运行推理。

🔧 安装

推理环境

克隆仓库并进入项目目录:

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

创建并激活一个干净的 conda 环境:

conda create -n pixelsmile python=3.10
conda activate pixelsmile

安装推理依赖项:

pip install -r requirements.txt

⚠️ 重要提示!请为 Qwen 图像编辑 bug 修补当前的 diffusers 安装:

bash scripts/patch_qwen_diffusers.sh

训练说明

若要训练 PixelSmile,需在推理环境基础上安装额外的训练依赖项:

pip install -r requirements-train.txt

🤗 模型下载

建议将所有模型下载至 ./weights 目录。

推理用模型

基础模型

PixelSmile 以 Qwen-Image-Edit-2511 作为基础模型,您可从 Hugging Face 下载。

PixelSmile 模型

模型版本数据类型下载链接
PixelSmile-preview预览版真人Hugging Face

✨ 更稳定的版本即将发布,该版本将提升真人表情编辑性能,并支持动漫表情编辑。

训练用模型

训练需额外的预训练权重及辅助模型。

CLIP 编码器

模型数据类型下载链接
clip-vit-large-patch14真人Hugging Face
DanbooruCLIP动漫Hugging Face

InsightFace 模型

训练过程中,我们使用 ArcFace 进行身份嵌入。

  • 下载 antelopev2.zip 并解压至模型目录(默认路径:./weights/antelopev2)。
  • 使用 onnx2torch 将 glintr100.onnx 转换为 glintr100.pth。

📦 一键下载

# 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

🎨 推理

以下命令是推理示例,模型路径使用我们的默认目录:./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

🧠 训练

本仓库包含位于 pixelsmile/train.py 的训练入口脚本。

准备配置

以 pixelsmile/configs/example.yaml 为参考,在 pixelsmile/configs/config.yaml 中配置您的训练文件。

  1. 配置模型路径。
  • example.yaml 已默认使用 ./weights/... 目录下的模型布局。
  • 若您的模型位于相同位置,保留以下默认值:
  • model.pretrained_path: ./weights/Qwen-Image-Edit-2511
  • model.insightface_detector_path: ./weights/antelopev2/scrfd_10g_bnkps.onnx
  • model.insightface_recognition_path: ./weights/antelopev2/glintr100.pth
  1. 根据数据类型配置 CLIP 路径。
  • 真人数据:model.clip_path: ./weights/clip-vit-large-patch14
  • 动漫数据:model.clip_path: ./weights/DanbooruCLIP
  1. 配置数据集字段。
  • dataset.path
  • dataset.data_type

运行训练

单 GPU:

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

多 GPU(建议通过 accelerate):

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

训练输出保存在 exps/<timestamp>/ 目录下(包含检查点、日志、配置文件)。

冒烟测试(推荐)

在进行完整训练前,建议先通过临时设置以下参数进行一次小型运行:

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

如果冒烟测试正常运行,请切换回完整的训练配置。

📖 引用

如果您在研究或应用中发现 PixelSmile 有用,请考虑引用我们的工作。

@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}
}