Watch Video Tutorial:
Flux PuLID Face Swap Inpainting ComfyUI Tutorial:
This summarizes the key points from the provided excerpt of "Flux PuLID Face Swap Inpainting ComfyUI Workflow":
Core Theme: The tutorial demonstrates a step-by-step process for performing face swaps in images using the Flux PuLID workflow in ComfyUI. This workflow ensures facial consistency across multiple images, making it ideal for character-based AI art.
Important Concepts:
Flux PuLID: A method allowing image generation based on a single input image, preserving facial features while enabling modifications to other image aspects (clothing, background, style).
Consistent Character Workflow: Utilizing Flux PuLID to maintain recognizable facial features across various images of the same character.
Masking: A crucial technique for isolating the facial area to be swapped, ensuring precise application of the face swap.
Denoise Level: A parameter influencing the degree of resemblance between the swapped face and the reference image. Higher denoise values increase resemblance but can sometimes lead to distorted results.
Key Facts and Steps:
Prerequisites: Install Flux PuLID nodes locally before using the workflow (installation tutorial linked in the original source).
Workflow Download: Download the "Flux PuLID Face Swap Inpainting Consistent Character Workflow" from Civit AI (search "AI Motion Studio").
Image Input: Upload the target image for face swap and the reference image containing the desired face.
Masking: Utilize the Mask Editor to precisely define the facial area for the swap.
Denoise Adjustment: Experiment with different denoise levels to achieve the desired resemblance between the swapped face and the reference image.
Troubleshooting: For distorted results or disproportionate faces, reduce the denoise level. For stronger resemblance, increase the denoise level, but be cautious of potential issues. Avoid masking hair when using a high denoise value for better results.
Node Issues: If any nodes malfunction, use ComfyUI Manager to install missing nodes and update all nodes before restarting ComfyUI.
Notables:
"PuliD is a method that lets us generate images based on a single input image, preserving key facial features while allowing for changes in other aspects, like clothing, background, or style."
"If you encounter weird results or the generated face seems disproportionate to the body, simply lowering the denoise setting should resolve the issue."
"For a stronger facial resemblance, increase the denoise and avoid masking the hair."
Overall, the tutorial offers a practical guide to achieving consistent and believable face swaps in images using the Flux PuLID workflow. By understanding the key concepts, steps, and potential troubleshooting techniques, users can effectively utilize this method for their creative projects.
Description
Version 2.0 Florence2 Automatic Applying Mask
FAQ
Comments (28)
Thanks for the workflow. I am getting an error at the very end of the workflow:
forward_orig() got an unexpected keyword argument 'attn_mask'
Fix TypeError: forward_orig() got an unexpected keyword argument 'attn_mask' CMD into Path E:\pinokio\api\comfy.git\app git fetch origin git checkout v0.3.4 pip install -r requirements.txt
For those of us not using Pinokio, is this effectively saying we need to downgrade ComfyUI to v.03.4 to use PulID?
@andymsings781 Yes Exactly
use ComfyUI-PuLID-Flux-Enhanced instead of ComfyUI-PuLID-Flux : First, DELETE the ComfyUI-PuLID-Flux in custom_node, Then clone the https://github.com/XmYx/ComfyUI-PuLID-Flux-Enhanced/
Pulid was broken on the last update, here's a fix: https://civitai.com/models/914970/pulid-simple-workflow-flux-or-upscale-or-lora-or-gguf-or-civitai-metadata
@SkycladsquirrelArt GREAT!!!!
I FIXED the insightface loader error
OK This is not my idea. I got it from this closed topic
What I had in my ComfyUI is this path:
D:\ComfyUI\models\insightface\models\antelopev2
Inside the 'antelopev2 folder was 5 onnx files.
I COPIED those and pasted them directly into the models folder.
Ran the workflow, everything worked.
Nice workflow.
The only thing is that the Sam2Segmentation node masking is poor. Can be improved by including the Mask Fix node from comfyui_essentials after the mask output of the Sam2Segmentation node and before the attn_mask input of the Apply PuLID Flux node. I find that these settings of the Mask Fix node work well :
erode_dilate 30, fill_holes 15, remove_isolated_pixels 5, smooth 150 and blur 10
Hey i tried to use your v2.0 but each time i import your worflow my comfyui freezing. Someone already had this issue ? is only witht this worflow i've got this problem
same problem
facing a similar problem
I thought I was the only one with this problem. Everything used to work, but now every workflow I've tested from here freezes my browser. I have to remove it, or rather, load another (working) one, and restart comfyUI. If I leave it there, it crashes again immediately after restarting. Maybe it's due to a recent comfyUI update. A complete reinstall doesn't help, but an old comfyUI installation was still loading it until I accidentally updated it. I liked the workflows from here.
+1
If you're experiencing a freezing Canvas when running version 2 of this workflow, the issue is likely due to a conflict between the "ComfyUI-segment-anything-2" custom node and the latest ComfyUI updates. It's unclear exactly which ComfyUI version introduced this issue.
Solution:
In my case, rolling back ComfyUI to v0.3.13 resolved the freezing problem, allowing the workflow to function as expected.
@saharat721 I will test it, thanks for the tip.
@saharat721 I tested it and can confirm that it works with an older ComfyUI version (in my case, v0.3.14-30 v. 2025-02-16). Thank you very much.
@H0uZe Thank you for letting me know your test result. Have a good day!
@saharat721 Hi, just for your information: I did an update last night and afterward, not a single workflow worked anymore. Or rather, an error message pops up when loading a workflow, they won't save, and when restarting, a built-in one loads, which also gives the same error message (something to do with Graph...). Generally, they still work, but without being able to save, it's very annoying. I was able to "fix" it by writing the "venv" folder back from an old backup. So, be sure to back up the "embedded" or "venv" folder beforeh updating.Luckily, it's not that big., the custom nodes folder or others are not affected. I've tested it (only briefly) on various portable devices, and every time, ComfyUI shows the Error after loading a Workflow. Maybe it doesn't always happen and not for everyone, but I wanted to at least post a small warning here, since I haven't found anything about the error and it happened 100% of the time to my Installations. Good luck & Happy Easstern.
@H0uZe Hi, thank you very much for your kind warning. I will definitely keep your advice in mind before updating ComfyUI.
Lately, I haven't updated ComfyUI very often either because I'm also worried about potential conflicts with custom nodes.
I will make sure to back up the "venv" folder beforehand from now on. Thanks again for taking the time to share your experience!
I have this error:
Florence2toCoordinates
list index out of range
and stop the workflow...
Any idea why? I installed everything, follow every tutorial, but still without find a solution
Solution:
The "index" field of the Florence2toCoordinates node is empty by default. Setting it to "0" fixes this.
For me, it just stops when I open the workflow. I can't move, zoom out or click, even exit the workflow. I had to erase the json file to make comfyui work. Any solution?
Oh, you've noticed it 2weeks ago? Shall I wait for update?
If you're experiencing a freezing Canvas when running version 2 of this workflow, the issue is likely due to a conflict between the "ComfyUI-segment-anything-2" custom node and the latest ComfyUI updates. It's unclear exactly which ComfyUI version introduced this issue.
Solution:
In my case, rolling back ComfyUI to v0.3.13 resolved the freezing problem, allowing the workflow to function as expected.
ApplyPulidFlux
'GGUFModelPatcher' object has no attribute 'get_additional_models_with_key'
it gave error
AttributeError: 'PulidFluxModel' object has no attribute 'id_adapter'
I hane this error:
Florence2ForConditionalGeneration.__init__() got an unexpected keyword argument 'dtype'


