Instructions to use Alissonerdx/BFS-Best-Face-Swap with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Alissonerdx/BFS-Best-Face-Swap with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Qwen/Qwen-Image-2.1", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("Alissonerdx/BFS-Best-Face-Swap") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
Produces a bigger head
For a while now, using ComfyUI v0.37.0 with v1.53.6 ComfyUI_frontend, BFS produces a bigger head when swapping. It's more prominent on Python 3.13.12 and PyTorch v2.12.0+cu130 than on Python 3.12.10 and PyTorch v2.13.0+cu126 but it's there.
And I haven't found a way to prompt it to keep the head size the same as the original.
Any suggestions or ways to correct this?
Do you have any examples?
The workflow is custom, but pretty basic with custom sampler and added expression analysis and a face comparison check. Model is FLUX 2 klein 9b, only your LoRA active at 1.
But the thing is, it worked great weeks ago. For me, it almost looks like the way Comfy works now after the updates, changed something, that does this. I never had issues with big(ger) heads before.
Thought:
How is the size of the input images related to the swap? In your original wf, you scale both to 1MP, but that's not how I use it. In general, I have images in the size of 1024x1536, the headshots I use can be any size.
Could that be a reason, and if yes, how can it be solved?
