The implementation for PuLID-Flux, support TeaCache, no model pollution.
TeaCache
(Need use with ComfyUI_Patches_ll).Comfy-WaveSpeed
in commit-36ba3c8.First Block Cache
(Can use with ComfyUI_Patches_ll).Must uninstall or disable ComfyUI-PuLID-Flux
and other PuLID-Flux nodes before install this plugin. Due to certain reasons, I used the same node's name ApplyPulidFlux
.
Need upgrade ComfyUI Version>=0.3.7
ComfyUI/models/facexlib/
.ComfyUI/models/insightface/models/antelopev2/
.ComfyUI/models/clip/
.
cd custom_nodes
git clone https://github.com/lldacing/ComfyUI_PuLID_Flux_ll.git
cd ComfyUI_PuLID_Flux_ll
pip install -r requirements.txt
# restart ComfyUI
Tips:
ComfyUI_windows_portable
and encounter the following error, please see https://github.com/deepinsight/insightface/issues/2576insightface/thirdparty/face3d/mesh/cython/mesh_core_cython.cpp(36): fatal error C1083: 无法打开包括文件: “Python.h”: No such file or directory
error: command 'd:\\installed\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.42.34433\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for insightface
Failed to build insightface
ComfyUI/models/pulid/
.ComfyUI/models/clip/
.*.onnx
from AntelopeV2 => ComfyUI/models/insightface/models/antelopev2/
.ComfyUI/models/facexlib/
.attn_mask
~~may not work correctly (I have no idea how to apply it, I have tried multiple methods and the results have been not satisfactory)~~ works now.FluxForwardOverrider
and ApplyTeaCachePatch
.ApplyFBCacheOnModel
.ApplyPulidFlux
, and link node FluxForwardOverrider
and ApplyTeaCachePatch
after it.input_faces_order
- Sorting rule for detected bboxes.
left-right
: Sort the left boundary of bbox by column from left to right.right-left
: Reverse order of left-right
(Sort the left boundary of bbox by column from right to left).top-bottom
: Sort the top boundary of bbox by row from top to bottom.bottom-top
: Reverse order of top-bottom
(Sort the top boundary of bbox by row from bottom to top).small-large
: Sort the area of bbox from small to large.large-small
: Sort the area of bbox from large to small.input_faces_index
- The target index of the sorted bboxes.input_faces_align_mode
- Choose the detection method for aligning facial features.
0
: Old version method, When there is a face in an image, the selected facial embedding amount and alignment features maybe not consistent.1
: Keep the selected facial embedding amount and alignment features consistent.align_face
value of 1
resulting smaller area than the embed_face
value of 0
.ApplyPulidFlux
.input_faces_align_mode = 0
, the embed_face
and align_face
should be the same face, but they are generated by different detectors, and the number detected may be not consistent, so they may be not the same face.input_faces_align_mode = 1
, the embed_face
and align_face
are always the same face, they are generated by same detectors.face_bbox_image
- Draw the detected facial bounding box (the result of the embed_face
's detector).