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.
![timeline](https://myaiforce.com/wp-content/uploads/2024/05/timeline-1716432482.jpg)
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.
![workflow](https://myaiforce.com/wp-content/uploads/2024/05/workflow-1716425647.jpg)
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.
![install missing nodes in comfyui manager](https://myaiforce.com/wp-content/uploads/2024/05/install20missing20nodes20in20comfyui20manager-1716425985.jpg)
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.
![workflow part 1](https://myaiforce.com/wp-content/uploads/2024/05/workflow20part201-1716426399.jpg)
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.
![workflow part 2](https://myaiforce.com/wp-content/uploads/2024/05/workflow20part202-1716426458.jpg)
3️⃣ Reference Image Node:
At the top, the “Face” node (a “Load Image” node) loads a reference photo used for all three technologies.
![workflow part 3](https://myaiforce.com/wp-content/uploads/2024/05/workflow20part203-1716426537.jpg)
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:
![reference image](https://myaiforce.com/wp-content/uploads/2024/05/reference20image201-en-1716432228.jpg)
![comparison 1](https://myaiforce.com/wp-content/uploads/2024/05/comparison201-1716427833.jpg)
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:
![](https://myaiforce.com/wp-content/uploads/2024/05/image-1-1024x575.png)
![comparison](https://myaiforce.com/wp-content/uploads/2024/05/comparison202-1716428630.jpg)
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:
![reference image](https://myaiforce.com/wp-content/uploads/2024/05/reference20image203-en-1716432418.jpg)
![comparison](https://myaiforce.com/wp-content/uploads/2024/05/comparison203-1716428760.jpg)
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:
![reference image](https://myaiforce.com/wp-content/uploads/2024/05/reference20image204-en-1716432398.jpg)
![comparison](https://myaiforce.com/wp-content/uploads/2024/05/comparison204-1716428914.jpg)
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.