Install this extension via the ComfyUI Manager by searching
for ComfyUI InstantID Faceswapper
1. Click the Manager button in the main menu
2. Select Custom Nodes Manager button
3. Enter ComfyUI InstantID Faceswapper in the search bar
After installation, click the Restart button to
restart ComfyUI. Then, manually
refresh your browser to clear the cache and access
the updated list of nodes.
Visit
ComfyUI Online
for ready-to-use ComfyUI environment
ComfyUI InstantID Faceswapper integrates InstantID's faceswap technology into ComfyUI, enabling efficient face-swapping using LCM Lora for high-quality results in minimal steps. It is compatible exclusively with SDXL checkpoints.
ComfyUI InstantID Faceswapper Introduction
The comfyui-instantId-faceswap extension is a powerful tool designed to facilitate face-swapping in images using the ComfyUI interface. This extension leverages the capabilities of the InstantID framework to provide high-quality, identity-preserving face swaps with minimal effort. It is particularly useful for AI artists who want to create realistic or stylized face swaps without needing extensive technical knowledge.
Key features include:
High-Quality Face Swaps: Achieve realistic and identity-preserving face swaps.
Ease of Use: Designed to be user-friendly, making it accessible to AI artists with varying levels of technical expertise.
Compatibility: Works exclusively with SDXL checkpoints, ensuring high-quality outputs.
Efficiency: Utilizes LCM Lora for faster generation with fewer steps.
How ComfyUI InstantID Faceswapper Works
The comfyui-instantId-faceswap extension operates by integrating several advanced models and techniques to perform face-swapping. Here’s a simplified breakdown of how it works:
Face Detection and Embedding: The extension first detects faces in the input image using pre-trained models. It then extracts facial features and creates an embedding, which is a numerical representation of the face.
Face Swap Generation: Using the extracted face embedding, the extension generates a new face that matches the identity of the target face while preserving the original image's context and style.
Image Composition: The newly generated face is then blended into the original image, ensuring that the final output looks natural and seamless.
By using advanced models like ControlNet and IP-Adapter, the extension ensures that the face swaps are not only accurate but also visually appealing.
ComfyUI InstantID Faceswapper Features
Faceswap LCM Lora
lcm_lora: Path to your LCM Lora inside the folder with Loras. This feature allows you to use LCM Lora models to enhance the quality and speed of face swaps.
Faceswap Setup
checkpoint: Your SDXL checkpoint (do not use checkpoints for inpainting).
controlnet: Folder where your ControlNetModel is located.
controlnet_name: Name of the ControlNetModel folder.
ipadapter: Path to the IP adapter from the instructions.
Faceswap Face Embed
face_image: Input image from which to extract embed data.
face_embed: Face embeddings to improve results.
Faceswap Generate
padding: Adjusts the region around the face for better detection.
ip_adapter_scale: Controls the strength of the IP adapter.
controlnet_conditioning_scale: Adjusts the strength of ControlNet.
guidance_scale: Encourages the model to generate images closely linked to the text prompt.
steps: Number of steps for the generation process.
resize: Maximum value to which the cut region of the image will be scaled.
mask_strength: Strength of the mask used in the face swap.
blur_mask: Amount of blur added to the mask before composing it into the result picture.
rotate_face: Option to rotate the image to keep the face straight.
offload: Helps manage memory usage during the decoding process.
seed: Seed value for the generation pipeline.
control_after_generate: Determines what to do with the seed after generation.
positive: Positive prompts for the generation.
negative: Negative prompts to avoid certain features.
negative2: Additional negative prompts.
ComfyUI InstantID Faceswapper Models
The extension uses several models to achieve its functionality:
Antelopev2 Models: Used for face detection and embedding.
IP-Adapter: Enhances the identity preservation in face swaps.
ControlNet: Provides control over the generation process.
LCM Lora: Optional but recommended for faster and higher-quality results.
Each model plays a crucial role in ensuring that the face swaps are accurate and visually appealing.
What's New with ComfyUI InstantID Faceswapper
Version 0.0.5 (25.02.2024)
Fixed the mask_strength parameter.
Fixed the ip_adapter_scale parameter.
Changed the method of processing face embeddings.
Added the rotate_face parameter.
Version 0.0.4 (14.02.2024)
Added memory-saving options.
Merged resize and resize_to options.
Added manual offload mechanism.
Adjusted mask_strength parameter range.
Version 0.0.3 (07.02.2024)
Fixed an error with face embeddings.
Version 0.0.2 (05.02.2024)
Introduced workflow generator script.
Updated dependency diffusers to version 0.26.x.
Version 0.0.1 (01.02.2024)
Added progress bar and latent preview for the generation node.
Troubleshooting ComfyUI InstantID Faceswapper
Common Issues and Solutions
Artifacts Instead of Faces: Try using the resize option with a high value or reduce the padding parameter.
Color Mismatch: Reduce the number of steps or the ip_adapter_scale value.
No Face Detected Error: Increase the padding parameter.
Frequently Asked Questions
Why is my face swap not working?
Ensure that all required models are correctly placed in their respective folders and that the paths are correctly set in the configuration.
How can I improve the quality of the face swap?
Use the LCM Lora model and adjust the guidance_scale and steps parameters for better results.
Learn More about ComfyUI InstantID Faceswapper
For additional resources, tutorials, and community support, you can visit the following links:
InstantID Technical Report
These resources provide comprehensive information and support to help you get the most out of the comfyui-instantId-faceswap extension.