If you've used the IP-adapter or other face-swapping plugins before, installing InstantID will be a breeze. If you haven't, you'll need to install insightface first. You can find how to install insightface in my previous article.

Detailed Guide: Learn how to install and configure Insightface on the ComfyUI platform (chinaz.com)

Installation Process

First, upgrade ComfyUI to the latest version!

Use git clone to download this repository into the ComfyUI/custom_nodes/ directory or use the manager. Here, I use the manager to search for and download InstantID, making sure to download the one by the author Cubiq. Don't get it wrong.

image.png

The InsightFace model is antelopev2 (not the classic buffalo_l). Download the model (for example, from here or here), unzip it, and place it in the ComfyUI/models/insightface/models/antelopev2 directory.

image.png

The main model can be downloaded from this website: https://huggingface.co/InstantX/InstantID/resolve/main/ip-adapter.bin?download=true

Place it in the ComfyUI/models/instantid directory.

(Please note, the model is called ip_adapter because it is based on IPAdapter).

image.png

You also need to download a ControlNet model: https://huggingface.co/InstantX/InstantID/resolve/main/ControlNetModel/diffusion_pytorch_model.safetensors?download=true

Download and place it in the ComfyUI Controlnet directory.

Remember, InstantID currently only works with SDXL. So you'll also need to prepare a large SDXL model.

Usage Process

image.png

To achieve InstantID face-swapping, we also need to install this node package, which provides the FaceDetailer node. Users familiar with WebUI should recognize this as the ADetailer facial repair plugin in WebUI. The principle of face-swapping is to use FaceDetailer to identify the facial area of a character, and then use InstantID to redraw the face.

image.png

I won't go into detail about the node linking process. You can get the workflow by joining our communication group. The workflow is simple and you should be able to understand it by looking at it. Here, I mainly want to remind you of a few parameters for FaceDetailer. The steps and CFG are set according to your SDXL large model. The denoising below is the redrawing intensity. Feathering affects the blending degree of the redrawing edges. So a few parameters need to be manually adjusted according to your situation.

image.png

------------------------------------------------------------------------------------------

The AI tutorial of Zhanzhangsucai is the AI drawing tutorial platform under Chinaz.com

A wealth of free AI tutorials, continuously updated dry content

For more in-depth AI drawing tutorials, please visit the Zhanzhangsucai AI tutorial website:

https://aisc.chinaz.com/jiaocheng/