BFS Best Face Swap

ProviderAlissonerdx
Categoryimage-to-image
Licensemit
Downloads2.6K
Stars36

Overview

BFS Best Face Swap is a specialized image-to-image model designed for high-fidelity facial replacement. Unlike general-purpose generative models, it focuses on preserving the identity of the source face while seamlessly blending it into the target image's lighting, skin tone, and perspective. For developers, this means a streamlined pipeline for creating personalized avatars, automating asset production for gaming, or building virtual try-on features. The model is released under the MIT license, offering maximum flexibility for commercial integration. It operates as a targeted transformation tool, reducing the need for complex prompting or extensive manual masking, making it an efficient choice for apps requiring consistent facial mapping across diverse environments.

Highlights

  • High-fidelity facial identity preservation across target images
  • Seamless blending of lighting, skin tone, and perspective
  • MIT license allows for unrestricted commercial deployment
  • Optimized for image-to-image pipelines and avatar generation
  • Reduced manual masking requirements for faster integration

Usage

Install
# Install Hugging Face transformers
pip install transformers torch
SDK Usage
# Load model with transformers
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("Alissonerdx/BFS-Best-Face-Swap")
tokenizer = AutoTokenizer.from_pretrained("Alissonerdx/BFS-Best-Face-Swap")

Hugging Face Download

We recommend downloading the model via the Hugging Face CLI or Hub SDK.

Guidance:Before downloading, install huggingface_hub with:

Guidance
pip install -U huggingface_hub

CLI Download

Download the full repository

Download the full repository
huggingface-cli download Alissonerdx/BFS-Best-Face-Swap

Download a single file to a local folder (e.g. config.json into ./dir)

Download a single file to a local folder (e.g. config.json into ./dir)
huggingface-cli download Alissonerdx/BFS-Best-Face-Swap config.json --local-dir ./dir

See the official docs for more CLI options

SDK Download

SDK Download
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('Alissonerdx/BFS-Best-Face-Swap')

Git Download

Make sure git-lfs is installed first

Git Download
git lfs install
git clone https://huggingface.co/Alissonerdx/BFS-Best-Face-Swap

To skip LFS large-file downloads, use:

Skip LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/Alissonerdx/BFS-Best-Face-Swap

Model files are hosted on the Hugging Face Hub — download directly via HF CLI / SDK / Git, not through this site.

PyTorch / Transformers Usage

Install Transformers

Install Transformers
pip install -U transformers torch

Load the model and run inference

Load the model and run inference
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained('Alissonerdx/BFS-Best-Face-Swap')
tokenizer = AutoTokenizer.from_pretrained('Alissonerdx/BFS-Best-Face-Swap')

Model Download

We recommend downloading the model via the ModelScope CLI or SDK.

Guidance:Before downloading, install ModelScope with:

Guidance
pip install modelscope

CLI Download

Download the full repository

Download the full repository
modelscope download --model Alissonerdx/BFS-Best-Face-Swap

Download a single file to a local folder (e.g. README.md into ./dir)

Download a single file to a local folder (e.g. README.md into ./dir)
modelscope download --model Alissonerdx/BFS-Best-Face-Swap README.md --local_dir ./dir

See the docs for more CLI options

SDK Download

SDK Download
# 模型下载
from modelscope import snapshot_download
model_dir = snapshot_download('Alissonerdx/BFS-Best-Face-Swap')

Git Download

Make sure git-lfs is installed first

Git Download
git lfs install
git clone https://www.modelscope.cn/Alissonerdx/BFS-Best-Face-Swap.git

To skip LFS large-file downloads, use:

Skip LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://www.modelscope.cn/Alissonerdx/BFS-Best-Face-Swap.git

ModelScope 模型页直接下载模型文件;无需将模型文件放在本站服务器。

Notebook Quickstart

Install the ModelScope library

Install the ModelScope library
pip install "modelscope[audio,cv,nlp,multi-modal,science]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html

Load the model and run inference

Load the model and run inference
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks

p = pipeline('text-generation', 'Alissonerdx/BFS-Best-Face-Swap')

Full Documentation

来源: HuggingFace

---
license: mit
base_model:

  • black-forest-labs/FLUX.2-klein-9B

  • black-forest-labs/FLUX.2-klein-4B

  • black-forest-labs/FLUX.2-klein-base-4B

  • black-forest-labs/FLUX.2-klein-base-9B

  • black-forest-labs/FLUX.2-klein-9b-fp8

  • black-forest-labs/FLUX.2-klein-4b-fp8

  • Qwen/Qwen-Image-Edit-2511

  • krea/Krea-2-Raw

pipeline_tag: image-to-image
tags:
  • lora

  • qwen-image-edit

  • face-swap

  • head-swap

  • body-swap

  • image-editing

  • ai-generated

  • comfyui

  • bfs

  • flux 2

  • flux

  • klein

  • krea2

language:
  • en

library_name: diffusers
---

🧬 BFS — Best Face Swap (Qwen Image Edit, Flux 2 Klein, Krea 2)

The BFS (Best Face Swap) LoRA series was created for Qwen Image Edit 2509/2511, Flux 2 Klein 4b/9b, and Krea 2, designed to perform high-fidelity face, head, and full-person swaps with natural tone blending and consistent lighting.

Each version focuses on a different level of replacement, from subtle face swaps to full head transfers.
Use each LoRA with its matching base model and workflow. Krea 2 head/body workflows are included in the workflows folder.

👉 Workflows for all BFS versions can be downloaded here:
Head/Face Swap Workflow — Qwen Image Edit 2509 (Civitai)

---

🔹 Versions Overview

| Version | File(s) | Description |
|---|---|---|
| BFS Face V1 – 2509 | bfs_face_v1_qwen_image_edit_2509.safetensors | Swaps only the face. Preserves target hair, lighting, and background. |
| BFS Head V1 – 2509 | bfs_head_v1_qwen_image_edit_2509.safetensors | Full head swap with natural blending between head/hair and target body. |
| BFS Head V2 – 2509 | bfs_head_v2_qwen_image_edit_2509.safetensors | Improved skin tone matching, pose alignment, and anatomical consistency. |
| BFS Head V3 – 2509 (Recommended) | bfs_head_v3_qwen_image_edit_2509.safetensors | Stable and accurate. Input order is inverted (body first, then face). |
| BFS Head V4 – 2509/2511 | bfs_head_v4_qwen_image_edit_2509.safetensors | Stronger expression transfer and robustness. Inverted input order. |
| BFS Head V5 – 2511 (Recommended) | bfs_head_v5_2511_original.safetensors<br>bfs_head_v5_2511_merged_version_rank_16_fp16.safetensors<br>bfs_head_v5_2511_merged_version_rank_32_fp32.safetensors | Latest release for 2511 workflows. Inverted input order. See details below. |
| BFS Head V1 – Flux 2 Klein 4/9b (Recommended) | bfs_head_v1_flux-klein_4b.safetensors<br>bfs_head_v1_flux-klein_9b_step3500_rank128.safetensors<br>bfs_head_v1_flux-klein_9b_step3750_rank64.safetensors | Inverted input order. See details below. |
| BFS Head Swap V1.1 – Krea 2 | bfs_head_swap_v1.1_krea2.safetensors | Updated Krea 2 head swap release. Replaces the previous V1 file. |
| BFS Body Swap V1 – Krea 2 (Experimental) | bfs_body_swap_v1_krea2.safetensors | Replaces the person with the reference person. Pose transfer may not always match exactly. |

---

🧠 BFS Head V5 details (2511)

This release includes multiple variants:

  • 100% original: direct result of training for 5,500+ steps on model 2511
  • Merged versions: a merge of BFS Head V4 (2509) into the 2511-trained original

In my evaluation, the merged version performs better, especially at reproducing a wider range of expressions.
It is not perfect yet, but it indicates we are moving in the right direction.

---

🧪 Krea 2 Head and Body Swap

BFS Head Swap V1.1

This is the updated Krea 2 head swap release and replaces bfs_head_swap_v1_krea2.safetensors.

Trigger prompt:

code
head_swap: replace the head with the reference head.

Workflow: workflows/Head Swap Krea 2 - V1 Simple Workflow.json

BFS Body Swap V1 (Experimental)

This is an experimental version. The pose will not always be copied exactly from the original image.

Trigger prompt:

code
body_swap: replace the person with the reference person.

To also change the background, append this below the trigger prompt:

code
BG: [describe the new background]

You can combine the body swap LoRA with the Krea 2 head swap LoRA to improve head identity. As a starting point, use both LoRAs at 0.5 strength, then adjust based on your own tests.

Workflow: workflows/Body Swap Krea 2 - V1 Simple Workflow.json

Feel free to experiment and post your results.

#### Body Swap examples

<p align="center">
<img src="images/bfs_body_swap_v1_krea2_example_yoga.png" width="49%" />
<img src="images/bfs_body_swap_v1_krea2_example_seated.png" width="49%" />
<img src="images/bfs_body_swap_v1_krea2_example_restaurant.png" width="49%" />
<img src="images/bfs_body_swap_v1_krea2_example_kitchen.png" width="49%" />
<img src="images/bfs_body_swap_v1_krea2_example_closeup.png" width="49%" />
<img src="images/bfs_body_swap_v1_krea2_example_outdoors.png" width="49%" />
</p>

---

🖼️ Input Structure (Control Images)

| Version | Image 1 | Image 2 | Notes |
|---|---|---|---|
| Face V1 | Face | Body | Standard order. Swaps face only. |
| Head V1 | Face | Body | Standard order. Full head swap with blending. |
| Head V2 | Face | Body | Standard order. Improved tone and alignment. |
| Head V3 | Body | Face | ⚠️ Inverted order — send body first, then face. |
| Head V4 | Body | Face | ⚠️ Inverted order — send body first, then face. |
| Head V5 | Body | Face | ⚠️ Inverted order — send body first, then face. |
| Head V1 Flux 2 Klein 4/9b | Body | Face | ⚠️ Inverted order — send body first, then face. |
| Krea 2 Head Swap V1.1 | Base image | Reference head | Use the included Krea 2 head workflow. |
| Krea 2 Body Swap V1 | Base image | Reference person | Experimental full-person replacement. |
---

💬 Prompts

🧠 BFS Face V1

Base prompt:

code
face swap face from Image 1 to Image 2.

Alternative:

code
face swap face from Image 1 to Image 2. swap only the face (not the hair), match the skin tone to Image 2, keep Image 2 pose and lighting.

---

🧩 BFS Head V1 – 2509 (Likely works with 2511)

Base prompt:

code
head swap from Image 1 to Image 2

Alternatives:

code
head swap from Image 1 to Image 2 with perfect skin match
Head swap from Image 1 to Image 2, keep all facial details and hair from Image 1, blend naturally with Image 2’s body.
head swap face from Image 1 to Image 2, keep all facial details and hair from Image 1, blend naturally with Image 2’s body, remove all hair of Image 2 and replace by hair from Image 1 and keep the same expression and head proportion as in Image 2

---

🧬 BFS Head V2 – 2509 (Likely works with 2511)

code
head swap, transfer head from Image 1 to Image 2

---

⚡ BFS Head V3 – 2509 (Recommended) (Likely works with 2511)

code
head_swap: start with Picture 1 as the base image, keeping its lighting, environment, and background. remove the head from Picture 1 completely and replace it with the head from Picture 2. ensure the head and body have correct anatomical proportions, and blend the skin tones, shadows, and lighting naturally so the final result appears as one coherent, realistic person.

---

⚡ BFS Head V4 – 2509 (Likely works with 2511)

code
h34d_sw4p: replace the head of Picture 1 by the head from Picture 2, strictly preserving the identity, facial features (eyes, nose, mouth), and skin texture of Picture 2. ensure the new head mimics the identical expression, angle, and rotation found in Picture 1.

---

⚡ BFS Head V5 – 2511 (Recommended)

code
head_swap: start with Picture 1 as the base image, keeping its lighting, environment, and background. remove the head from Picture 1 completely and replace it with the head from Picture 2, strictly preserving the hair, eye color, and nose structure of Picture 2. copy the eye direction, head rotation, and micro-expressions from Picture 1. high quality, sharp details, 4k

⚡ BFS Hea

Join our Telegram