ComfyUI-ReActor
Run ComfyUI Easily with InstaSD
Skip the complex setup. InstaSD helps creative professionals build workflows and deploy them to the world:
- One-click deployment
- Any model, any node
- Powerful GPUs for rapid iteration
Available Nodes
Documentation
ComfyUI ReActor: Custom Nodes for Face Swapping
Overview
The ComfyUI ReActor repository provides a collection of custom nodes designed to enhance the capabilities of ComfyUI with advanced face-swapping features. This repository is intended to offer SFW-friendly face swap and restoration functionalities, enriching UI workflows by leveraging innovative models and tools while integrating safety features such as nudity detection to prevent misuse with inappropriate content.
Installation
Standalone (Portable) ComfyUI for Windows
To install these custom nodes for a Windows standalone version of ComfyUI, follow these steps:
-
Visual Studio Installation:
- Install Visual Studio 2022 or VS C++ Build Tools, selecting "Desktop Development with C++."
-
Node Installation via ComfyUI Manager:
- Open ComfyUI Manager, navigate to "Install Custom Nodes," then search for "ReActor" and click "Install."
-
Manual Installation:
- Go to
ComfyUI\custom_nodes, open the console, and run:git clone https://github.com/Gourieff/ComfyUI-ReActor
- Go to
-
Script Execution:
- Navigate to
ComfyUI\custom_nodes\ComfyUI-ReActorand runinstall.bat.
- Navigate to
-
Model Files:
- Download required models (e.g.,
face_yolov8m.pt) from Assets and place them in the appropriate ComfyUI directories (models/ultralytics/bbox,models/sams).
- Download required models (e.g.,
-
Run ComfyUI:
- Start ComfyUI and access the ReActor nodes from the
ReActormenu or by using the search function.
- Start ComfyUI and access the ReActor nodes from the
Repository Purpose
The primary purpose of this repository is to extend ComfyUI capabilities with specialized nodes for face swapping and restoration. These tools are engineered to handle complex tasks such as gender detection, face model building, and real-time face masking—transforming how users interact with and modify images.
Node Features and Capabilities
The ComfyUI ReActor repository provides the following nodes, each offering unique functionalities:
- ReActorFaceSwap: Main node for executing face swaps.
- ReActorFaceSwapOpt: Main node enhanced with additional configurable options.
- ReActorOptions: Provides options for face swapping operations.
- ReActorFaceBoost: Enhances the quality of swapped faces.
- ReActorMaskHelper: Assists in creating accurate face masks.
- ReActorSetWeight: Sets the intensity of face swap effects.
- ReActorSaveFaceModel: Saves face models for reuse.
- ReActorLoadFaceModel: Loads previously saved face models.
- ReActorBuildFaceModel: Constructs blended face models.
- ReActorMakeFaceModelBatch: Creates batches of face models.
- ReActorRestoreFace: Restores faces post-swapping.
- ReActorImageDublicator: Duplicates images to create frames.
- ImageRGBA2RGB: Converts images from RGBA to RGB format.
- ReActorUnload: Unloads models to free VRAM.
Special Features
- Face Restoration: Built-in support for multiple face restoration models.
- Face Model Management: Creation and management of lightweight, reusable face models.
- NSFW Detection: Protects against inappropriate content through integrated nudity detection algorithms.
- Enhanced Performance: Speed optimizations and efficient face detection operations, including gender-specific identification.
Usage in ComfyUI Workflows
By integrating these nodes into ComfyUI workflows, users can achieve advanced image manipulation tasks with greater precision and control. These capabilities include:
- Creating deepfake videos and images ethically and responsibly.
- Conducting detailed image analysis and face manipulation with ease.
- Building complex workflows that incorporate face swapping, masking, restoration, and enhancement, all within the ComfyUI ecosystem.
- Utilizing utility nodes like
ImageRGBA2RGBandReActorUnloadto ensure compatibility and efficient resource management.
The ReActor nodes are essential tools for developers and artists looking to expand the potential of their visual media work while maintaining ethical standards.