comfyui-faceless-node

comfyui-faceless-node
★ 61

人脸替换人像编辑视频处理ComfyUI节点
为 ComfyUI 提供面部替换与恢复的自定义节点,可对图像或视频进行人脸交换与还原,便于无缝人像编辑。
💡 在 ComfyUI 流程中批量替换或恢复图像/视频中的人脸。
🍴 13 Forks💻 Python🔄 2025-04-07
📦
网盘下载
复制链接后前往夸克网盘下载
https://pan.quark.cn/s/8b0992d318c3
📦 requirements.txt
filetype==1.2.0
opencv-python==4.9.0.80
ufile==3.2.9
Image Face Swap And Face Restore
Video Face Swap And Face Restore
Preview Video Frames
📄 README

Faceless Node for ComfyUI

Next generation face toolkit for ComfyUI.

This project is under development. There may be compatibility issues in future upgrades. If you encounter any problems, please create an issue, thanks.

Installation

Install custom node

Install custom node in directory ComfyUI/custom_nodes.

git clone https://github.com/jeffy5/comfyui-faceless-node
pip install -r requirements.txt

Setup conda

# Install conda
curl -LO https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh

# Setup conda env
conda init --all
conda create --name facefusion python=3.10
conda activate facefusion

# Setup cuda
conda install conda-forge::cuda-runtime=12.4.1 cudnn=8.9.2.26 conda-forge::gputil=1.4.0

Download model

All models is same as facefusion which can be found in facefusion assets.

Now it will use the following models by default. In the future, dynamic model selection will be supported. Please download the model based on the directory structure.

Put all into directory CmofyUI/models/faceless.

|-- face_detector
|   `-- yoloface_8n.onnx
|-- face_landmarker
|   |-- 2dfan4.onnx
|   `-- face_landmarker_68_5.onnx
|-- face_recognizer
|   `-- arcface_w600k_r50.onnx
├── face_restoration
│   └── gfpgan_1.4.onnx
|-- face_swapper
|   └── inswapper_128.onnx
|-- gender_age.onnx
`-- rmbg.pth

You can download models by running download_models.py script under directory CmofyUI/custom_nodes/comfyui-faceless-node.

# Install default required models
python download_models.py

# Install all models
python download_models.py --all

Example workflows

You can find same example workflows in directory examples.

Image face swap and face restore

image_face_swap_and_restore.json

Video face swap and face restore

video_face_swap_and_restore.json

Preview video frames

preview_video_frames.json

It doesn’t support preview video for now. All video will be save in directory output/faceless.

Thanks

Thanks to Facefusion. This project is based on facefusion to implenment a special version for ComfyUI.