MCPcopy Index your code
hub / github.com/cubiq/PuLID_ComfyUI

github.com/cubiq/PuLID_ComfyUI @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
265 symbols 681 edges 20 files 29 documented · 11%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

PuLID ComfyUI

PuLID ComfyUI native implementation.

basic workflow

[!IMPORTANT]
2025.04.14 - I do not use ComfyUI as my main way to interact with Gen AI anymore as a result I'm setting the repository in "maintenance only" mode. If there are crucial updates or PRs I might still consider merging them but I do not plan any consistent work on this repo.

Notes

The code can be considered beta, things may change in the coming days. In the examples directory you'll find some basic workflows.

The original implementation makes use of a 4-step lighting UNet. I made a few comparisons with the official Gradio demo using the same model in ComfyUI and I can't see any noticeable difference, meaning that this code should be faithful to the orignal. The Lightning lora doesn't work as well.

Testing other models though I noticed some quality degradation. You may need to experiment with CFG and various samplers/schedulers (try sgm_uniform).

The quality of the reference image is very important. Maybe this is because of the Eva CLIP that gets more details. Be sure to use a clean and sharp picture!

For IPAdapter compatibility you need to update the IPAdapter extension!

The 'method' parameter

method applies the weights in different ways. Fidelity is closer to the reference ID, Style leaves more freedom to the checkpoint. Sometimes the difference is minimal. I've added neutral that doesn't do any normalization, if you use this option with the standard Apply node be sure to lower the weight. With the Advanced node you can simply increase the fidelity value.

The Advanced node has a fidelity slider and a projection option. ortho_v2 with fidelity: 8 is the same as fidelity method in the standard node. Projection ortho and fidelity: 16 is the same as method style.

Lower fidelity values grant higher resemblance to the reference image.

Installation

  • PuLID pre-trained model goes in ComfyUI/models/pulid/ (thanks to Chenlei Hu for converting them into IPAdapter format)
  • The EVA CLIP is EVA02-CLIP-L-14-336, but should be downloaded automatically (will be located in the huggingface directory).
  • facexlib dependency needs to be installed, the models are downloaded at first use
  • Finally you need InsightFace with AntelopeV2, the unzipped models should be placed in ComfyUI/models/insightface/models/antelopev2.

Core symbols most depended-on inside this repo

_pcfg
called by 51
eva_clip/pretrained.py
_ntuple
called by 5
eva_clip/utils.py
image_transform
called by 5
eva_clip/transform.py
load_state_dict
called by 5
eva_clip/factory.py
_make_layer
called by 4
eva_clip/modified_resnet.py
_clean_tag
called by 4
eva_clip/pretrained.py
get_pretrained_cfg
called by 4
eva_clip/pretrained.py
set_model_patch_replace
called by 3
pulid.py

Shape

Method 141
Function 73
Class 51

Languages

Python100%

Modules by API surface

eva_clip/transformer.py51 symbols
eva_clip/eva_vit_model.py36 symbols
pulid.py30 symbols
eva_clip/model.py27 symbols
eva_clip/hf_model.py20 symbols
eva_clip/utils.py16 symbols
eva_clip/factory.py16 symbols
eva_clip/tokenizer.py14 symbols
eva_clip/modified_resnet.py14 symbols
eva_clip/pretrained.py12 symbols
eva_clip/rope.py8 symbols
eva_clip/transform.py5 symbols

For agents

$ claude mcp add PuLID_ComfyUI \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact