ComfyUI 的社区实现可在此处获取:
感谢 @judian17 为此所做的贡献。
PixelSmile 推理快速入门。
克隆仓库并进入项目目录:
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-preview | 预览版 | 真人 | Hugging Face |
✨ 更稳定的版本即将发布,该版本将提升真人表情编辑性能,并支持动漫表情编辑。
训练需额外的预训练权重及辅助模型。
| 模型 | 数据类型 | 下载链接 |
|---|---|---|
| clip-vit-large-patch14 | 真人 | Hugging Face |
| DanbooruCLIP | 动漫 | Hugging Face |
训练过程中,我们使用 ArcFace 进行身份嵌入。
./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 中配置您的训练文件。
example.yaml 已默认使用 ./weights/... 目录下的模型布局。model.pretrained_path: ./weights/Qwen-Image-Edit-2511model.insightface_detector_path: ./weights/antelopev2/scrfd_10g_bnkps.onnxmodel.insightface_recognition_path: ./weights/antelopev2/glintr100.pthmodel.clip_path: ./weights/clip-vit-large-patch14model.clip_path: ./weights/DanbooruCLIPdataset.pathdataset.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: 8training.num_epochs: 1training.batch_size: 1training.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}
}