AI Face Swap Showdown in ComfyUI: PuLID vs. InstantID vs. FaceID
Today, we will compare three AI face-swapping technologies: PuLID, InstantID, and IP-Adapter’s FaceID-V2, using a ComfyUI workflow. These technologies are built on a face analysis system called InsightFace, which is a deep face analysis library designed for face recognition, face detection, and face alignment. Note that InsightFace requires a commercial license.
IP-Adapter FaceID was the first of these technologies to be introduced, followed by InstantID, and most recently, PuLID.
Each of these programs requires a face reference image, so the effectiveness of the face swapping heavily depends on the quality and suitability of the reference image you provide.
We’ll compare the results of these three face-swapping methods using a ComfyUI workflow, which you can download from here.
First, I’ll demonstrate how to use this workflow. Then, we’ll use it to generate 4 sets of images and score them to evaluate their effectiveness.
For those who love diving into Stable Diffusion with video content, you’re invited to check out the engaging video tutorial that complements this article:
Setting Up the ComfyUI Workflow
1️⃣Download and Import Nodes:
- Ensure you have all necessary nodes. Missing nodes can be installed via ComfyUI Manager, followed by a restart of ComfyUI.
- Upgrade ComfyUI before installing nodes to avoid issues with missing nodes.
2️⃣Install Necessary Models:
The download addresses and storage paths for models are detailed on the GitHub homepages of each node.
- PuLID: GitHub Link
- InstantID: GitHub Link
- IP-Adapter: GitHub Link
For PuLID, for example, download the pre-trained models and place them in the ComfyUI/models/pulid/
folder. The first run will automatically download additional models.
Workflow Structure
1️⃣ Shared Nodes:
At the bottom, these nodes are common to PuLID, InstantID, and FaceID. They use identical dimensions for checkpoint, prompt, latent image, and fixed seed, facilitating easy comparison.
2️⃣ Model Node Groups:
Further up, there are three groups of nodes. From left to right: PuLID, InstantID, and IP-Adapter-FaceID. The authors have organized these intuitively.
3️⃣ Reference Image Node:
At the top, the “Face” node (a “Load Image” node) loads a reference photo used for all three technologies.
Running the Workflow and Comparing Results
Steps to Run
- Ensure all nodes and models are correctly installed and configured.
- Import the workflow and check the node connections and configurations.
- Load the reference image, verifying the image path and format.
- Run the workflow to generate effect images for the three technologies.
- Compare the generated images to evaluate the differences, advantages, and disadvantages of PuLID, InstantID, and IP-Adapter FaceID.
Evaluation Criteria
Generate four sets of images and score them based on the following dimensions (each scored 1-3):
- Prompt Fit: How well the image matches the prompt description.
- Face Luminosity: The naturalness of the light and shadow on the face.
- Face Similarity: The resemblance between the generated image and the reference image.
- Face Detail: The texture and detail richness of the face.
Comparative Analysis
First set of pictures:
PuLID | InstantID | FaceID | |
---|---|---|---|
Prompt Fit | 2 | 3 | 1 |
Face Luminosity | 1 | 3 | 2 |
Face Similarity | 1 | 2 | 3 |
Face Detail | 1 | 3 | 2 |
Second set of pictures:
PuLID | InstantID | FaceID | |
---|---|---|---|
Prompt Fit | 3 | 2 | 1 |
Face Luminosity | 1 | 3 | 2 |
Face Similarity | 1 | 3 | 2 |
Face Detail | 1 | 3 | 2 |
Third set of pictures:
PuLID | InstantID | FaceID | |
---|---|---|---|
Prompt Fit | 3 | 2 | 1 |
Face Luminosity | 1 | 2 | 3 |
Face Similarity | 1 | 2 | 3 |
Face Detail | 1 | 2 | 3 |
Fourth set of pictures:
PuLID | InstantID | FaceID | |
---|---|---|---|
Prompt Fit | 3 | 2 | 1 |
Face Luminosity | 1 | 3 | 2 |
Face Similarity | 1 | 3 | 2 |
Face Detail | 1 | 3 | 2 |
Finally, let’s calculate the total score:
PuLID | InstantID | FaceID | |
---|---|---|---|
Total | 25 | 38 | 30 |
From my observations:
- InstantID scores the highest overall, followed closely by FaceID.
- PuLID lags behind the other two.
Although InstantID delivers the best results, it is also the most resource-intensive. Ultimately, the best choice depends on your specific needs.
I encourage you to perform your own tests and share your findings in the comments section.