Run this model with HF Jobs
Run douple/BFS-Best-Face-Swap-Video on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/douple/BFS-Best-Face-Swap-Video. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/douple/BFS-Best-Face-Swap-Video on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use douple/BFS-Best-Face-Swap-Video with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use douple/BFS-Best-Face-Swap-Video with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image, export_to_video # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Lightricks/LTX-2.3", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("douple/BFS-Best-Face-Swap-Video") prompt = "A man with short gray hair plays a red electric guitar." input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/guitar-man.png") output = pipe(image=input_image, prompt=prompt).frames[0] export_to_video(output, "output.mp4") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
Commit ·
4aa070b
0
Parent(s):
Duplicate from Alissonerdx/BFS-Best-Face-Swap-Video
Browse filesCo-authored-by: Alisson Pereira Anjos <Alissonerdx@users.noreply.huggingface.co>
Files changed (26)
- .gitattributesAdded+87
- README.mdAdded+501
- examples/1.mp4Added+3
- examples/2.mp4Added+3
- examples/3.mp4Added+3
- examples/4.mp4Added+3
- examples/5.mp4Added+3
- examples/6.mp4Added+3
- examples/7.mp4Added+3
- examples/8.mp4Added+3
- examples/head_bernini_00030-audio_1.mp4Added+3
- examples/head_bernini_00033-audio_2.mp4Added+3
- ltx-2.3/head_swap_v3_rank_64.safetensorsAdded+3
- ltx-2.3/head_swap_v3_rank_adaptive_fro_098.safetensorsAdded+3
- ltx-2/download-models-head-swap-ltx2-windows.ps1Added+57
- ltx-2/download-models-head-swap-ltx2.shAdded+129
- ltx-2/head_swap_v1_13500_first_frame.safetensorsAdded+3
- ltx-2/head_swap_v1_8750_first_and_last_frame.safetensorsAdded+3
- ltx-2/head_swap_v2_multimodes.safetensorsAdded+3
- wan22/headswap_bernini_r64_73f640_step3000_high_noise.safetensorsAdded+3
- wan22/headswap_bernini_r64_73f640_step3000_low_noise.safetensorsAdded+3
- workflows/workflow_ltx2_head_swap_drag_and_drop.jsonAdded
- workflows/workflow_ltx2_head_swap_drag_and_drop_v1.1.jsonAdded
- workflows/workflow_ltx2_head_swap_drag_and_drop_v2.0.jsonAdded
- workflows/workflow_ltx2_head_swap_drag_and_drop_v3.0.jsonAdded
- workflows/workflow_wan22_bernini_head_swap_drag_and_drop_v1.0.jsonAdded
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687<<<<<<< HEAD*.7z filter=lfs diff=lfs merge=lfs -text*.arrow filter=lfs diff=lfs merge=lfs -text*.bin filter=lfs diff=lfs merge=lfs -text*.bz2 filter=lfs diff=lfs merge=lfs -text*.ckpt filter=lfs diff=lfs merge=lfs -text*.ftz filter=lfs diff=lfs merge=lfs -text*.gz filter=lfs diff=lfs merge=lfs -text*.h5 filter=lfs diff=lfs merge=lfs -text*.joblib filter=lfs diff=lfs merge=lfs -text*.lfs.* filter=lfs diff=lfs merge=lfs -text*.mlmodel filter=lfs diff=lfs merge=lfs -text*.model filter=lfs diff=lfs merge=lfs -text*.msgpack filter=lfs diff=lfs merge=lfs -text*.npy filter=lfs diff=lfs merge=lfs -text*.npz filter=lfs diff=lfs merge=lfs -text*.onnx filter=lfs diff=lfs merge=lfs -text*.ot filter=lfs diff=lfs merge=lfs -text*.parquet filter=lfs diff=lfs merge=lfs -text*.pb filter=lfs diff=lfs merge=lfs -text*.pickle filter=lfs diff=lfs merge=lfs -text*.pkl filter=lfs diff=lfs merge=lfs -text*.pt filter=lfs diff=lfs merge=lfs -text*.pth filter=lfs diff=lfs merge=lfs -text*.rar filter=lfs diff=lfs merge=lfs -text*.safetensors filter=lfs diff=lfs merge=lfs -textsaved_model/**/* filter=lfs diff=lfs merge=lfs -text*.tar.* filter=lfs diff=lfs merge=lfs -text*.tar filter=lfs diff=lfs merge=lfs -text*.tflite filter=lfs diff=lfs merge=lfs -text*.tgz filter=lfs diff=lfs merge=lfs -text*.wasm filter=lfs diff=lfs merge=lfs -text*.xz filter=lfs diff=lfs merge=lfs -text*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textltx-2/ filter=lfs diff=lfs merge=lfs -text=======*.7z filter=lfs diff=lfs merge=lfs -text*.arrow filter=lfs diff=lfs merge=lfs -text*.bin filter=lfs diff=lfs merge=lfs -text*.bz2 filter=lfs diff=lfs merge=lfs -text*.ckpt filter=lfs diff=lfs merge=lfs -text*.ftz filter=lfs diff=lfs merge=lfs -text*.gz filter=lfs diff=lfs merge=lfs -text*.h5 filter=lfs diff=lfs merge=lfs -text*.joblib filter=lfs diff=lfs merge=lfs -text*.lfs.* filter=lfs diff=lfs merge=lfs -text*.mlmodel filter=lfs diff=lfs merge=lfs -text*.model filter=lfs diff=lfs merge=lfs -text*.msgpack filter=lfs diff=lfs merge=lfs -text*.npy filter=lfs diff=lfs merge=lfs -text*.npz filter=lfs diff=lfs merge=lfs -text*.onnx filter=lfs diff=lfs merge=lfs -text*.ot filter=lfs diff=lfs merge=lfs -text*.parquet filter=lfs diff=lfs merge=lfs -text*.pb filter=lfs diff=lfs merge=lfs -text*.pickle filter=lfs diff=lfs merge=lfs -text*.pkl filter=lfs diff=lfs merge=lfs -text*.pt filter=lfs diff=lfs merge=lfs -text*.pth filter=lfs diff=lfs merge=lfs -text*.rar filter=lfs diff=lfs merge=lfs -text*.safetensors filter=lfs diff=lfs merge=lfs -textsaved_model/**/* filter=lfs diff=lfs merge=lfs -text*.tar.* filter=lfs diff=lfs merge=lfs -text*.tar filter=lfs diff=lfs merge=lfs -text*.tflite filter=lfs diff=lfs merge=lfs -text*.tgz filter=lfs diff=lfs merge=lfs -text*.wasm filter=lfs diff=lfs merge=lfs -text*.xz filter=lfs diff=lfs merge=lfs -text*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textltx-2/ filter=lfs diff=lfs merge=lfs -text>>>>>>> 47487e3e7ace468206bad3d0247ed81b792bf222examples/ filter=lfs diff=lfs merge=lfs -textworkflows/workflow_head_swap_drag_and_drop.png filter=lfs diff=lfs merge=lfs -textexamples/1.mp4 filter=lfs diff=lfs merge=lfs -textexamples/2.mp4 filter=lfs diff=lfs merge=lfs -textexamples/3.mp4 filter=lfs diff=lfs merge=lfs -textexamples/4.mp4 filter=lfs diff=lfs merge=lfs -textexamples/5.mp4 filter=lfs diff=lfs merge=lfs -textexamples/6.mp4 filter=lfs diff=lfs merge=lfs -textexamples/7.mp4 filter=lfs diff=lfs merge=lfs -textexamples/8.mp4 filter=lfs diff=lfs merge=lfs -textexamples/head_bernini_00030-audio_1.mp4 filter=lfs diff=lfs merge=lfs -textexamples/head_bernini_00033-audio_2.mp4 filter=lfs diff=lfs merge=lfs -text123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501---license: otherlicense_name: ltx-2-community-license-agreementtags:- ltx-2- ic-lora- head-swap- video-to-video- image-to-video- bfs- lorabase_model:- Lightricks/LTX-2.3- ByteDance/Bernini-Rlibrary_name: diffuserspipeline_tag: image-to-video---
## ⚠️ Ethical Use & Disclaimer
This model is a technical tool designed for **Digital Identity Research, Professional VFX Workflows, and Cinematic Prototyping**.
By downloading or using this LoRA, you acknowledge and agree to the following:
* **Intended Use:** Designed for filmmakers, VFX artists, and researchers exploring high-fidelity video identity transformation.* **Consent & Rights:** You must possess explicit legal consent and all necessary rights from any individual whose likeness is being processed.* **Legal Compliance:** You are fully responsible for complying with all local and international laws regarding synthetic media.* **Liability Waiver:** This model is provided *"as is."* **As the creator (Alissonerdx), I assume no responsibility for misuse.** Any legal, ethical, or social consequences are solely the responsibility of the end user.
---
# 📺 Video Examples
## V1 Examples
Generated using the **Frame 0 Anchoring Technique**.All examples follow the guide video motion while preserving the identity provided in the first frame.
| Example 1 | Example 2 || ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ || <video src="https://huggingface.co/Alissonerdx/BFS-Best-Face-Swap-Video/resolve/main/examples/1.mp4" controls autoplay loop muted></video> | <video src="https://huggingface.co/Alissonerdx/BFS-Best-Face-Swap-Video/resolve/main/examples/2.mp4" controls autoplay loop muted></video> |
| Example 3 | Example 4 || ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ || <video src="https://huggingface.co/Alissonerdx/BFS-Best-Face-Swap-Video/resolve/main/examples/3.mp4" controls autoplay loop muted></video> | <video src="https://huggingface.co/Alissonerdx/BFS-Best-Face-Swap-Video/resolve/main/examples/4.mp4" controls autoplay loop muted></video> |
| Example 5 || ------------------------------------------------------------------------------------------------------------------------------------------ || <video src="https://huggingface.co/Alissonerdx/BFS-Best-Face-Swap-Video/resolve/main/examples/5.mp4" controls autoplay loop muted></video> |
## V3 Examples
If you want to see the full setup in practice, watch here:
[https://www.youtube.com/watch?v=HBp03iu7wLA](https://www.youtube.com/watch?v=HBp03iu7wLA)
The following examples demonstrate the new **persistent-template workflow** used in V3:
| Example 6 | Example 7 || ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ || <video src="https://huggingface.co/Alissonerdx/BFS-Best-Face-Swap-Video/resolve/main/examples/6.mp4" controls autoplay loop muted></video> | <video src="https://huggingface.co/Alissonerdx/BFS-Best-Face-Swap-Video/resolve/main/examples/7.mp4" controls autoplay loop muted></video> |
| Example 8 || ------------------------------------------------------------------------------------------------------------------------------------------ || <video src="https://huggingface.co/Alissonerdx/BFS-Best-Face-Swap-Video/resolve/main/examples/8.mp4" controls autoplay loop muted></video> |
The image references for the versions are stored under:
```txtltx-2.3/...```
---
# 🛠 Technical Background (V1)
To achieve this level of identity transfer, I **heavily modified the official LTX-2 training scripts**.
### Key Improvements
* **Novel Conditioning Injection:** Custom latent injection methods for reference identity stabilization.* **Noise Distribution Overhaul:** Implemented a **custom High-Noise Power Law timestep distribution**, forcing the model to prioritize target identity reconstruction over guide-video context.* **Training Compute:** 60+ hours of training on **NVIDIA RTX PRO 6000 Blackwell GPUs**, iterating through 300GB+ of experimental checkpoints.
---
# 📊 Dataset Specifications
## V1 Dataset
* **300 high-quality head swap video pairs*** Trained on **512x512 buckets*** Primarily **landscape format*** Optimized for **close-up framing**
Wide shots may reduce identity fidelity.
---
# 💡 Inference Guide (V1)
## 🔴 CRITICAL — Frame 0 Requirement
This version was trained to use **Frame 0 as the identity anchor**.
You must prepare the first frame correctly.
### Recommended Workflow
1. Perform a high-quality head swap on Frame 0.2. Use that processed frame as conditioning input.3. Run the full video generation.
For best results, prepare Frame 0 using my previous **BFS Image Models**.
---
## Optimization
### LoRA Strength
* **1.0** → Best motion fidelity* **>1.0** → Stronger identity and hair capture, but may distort original motion
### Multi-Pass Workflows
You can experiment with multiple passes using different strengths.
### Prompting
Detailed prompts currently have **no effect**.
Trigger remains:
```txthead swap```
---
# ⚠️ Known Issues (V1 – Alpha)
* **Identity Leakage:** Hair from the guide video may reappear.* **Hard Cuts:** Jump cuts can reset identity.* **Portrait Format:** Performance is significantly better in landscape.
---
# 🚀 Version 2 – Major Update
V2 introduces a **complete redesign of conditioning strategy and masking logic**, significantly improving identity robustness and reducing leakage.
---
## 🔹 Multiple Conditioning Modes (Using First Frame)
V2 supports multiple identity injection approaches:
### 1️⃣ Direct Photo Conditioning
Use a clean photo of the new face as reference input.
This method works and can produce strong results. However, because the model must internally reconcile lighting, perspective, depth, and occlusion differences, it may need to fight to correctly integrate the new identity into the guide video. In some cases, this can reduce stability or identity consistency.
### 2️⃣ First-Frame Head Swap (Recommended)
Applying a proper head swap on Frame 0 still produces **extremely strong and reliable results**.
Because the first frame is already structurally correct — pose, lighting, depth, and occlusions — the model has significantly less work to do. Instead of forcing alignment from a static photo, it simply propagates and stabilizes the identity through time.
This approach generally:
* Produces higher identity fidelity* Reduces deformation* Minimizes integration artifacts* Improves overall temporal stability
### 3️⃣ Automatic Magazine-Style Overlay
The new face is automatically cut and positioned over the guide face using mask alignment.This simulates a magazine-cutout-style overlay, but performed automatically based on mask positioning.
### 4️⃣ Manual Overlay
Advanced users may manually composite the new face over Frame 0 before running inference.
---
## 🔹 Facial Motion Behavior (Important Change)
Unlike V1:
**V2 does not follow the original guide face’s facial micro-movements.**
The guide face is fully masked to prevent identity leakage.
This makes masking quality critical.
### Mask Requirements
* The guide face must be completely covered.* Mask color must be a **magenta tone**.* Any visible guide identity may leak into the final output.
---
## 🔹 Mask Types
Users may alternate between:
### ▪ Square Masks
* More stable identity* Better consistency* Often produce stronger overall results* May generate slightly oversized heads due to spatial padding
In most scenarios, square masks tend to perform better because they provide additional spatial context for the model to reconstruct structure and hair.
### ▪ Tight / Adjusted Masks
* More natural head proportions* May deform if guide head shape differs significantly* Sensitive to long-hair mismatches
If the original guide has long hair and the new identity does not, deformation risk increases.
---
## 🔹 Dataset & Training Improvements (V2)
* **800+ video pairs*** Trained at **768 resolution*** **768** is the recommended inference resolution* Improved hair stability* Reduced identity leakage compared to V1* More robust identity transfer under motion
---
## 🔹 First Pass vs Second Pass
You may:
* Run a single pass at 768 (recommended)* Or run a downscaled first pass plus a second upscale pass
⚠️ Important:
A second pass may alter identity from the first pass and reduce consistency in some cases.
---
## 🔹 Trigger
Trigger remains:
```txthead swap```
---
# 🚀 Version 3 – Persistent Template Workflow
V3 introduces a new **persistent-template conditioning workflow**.
Unlike previous versions, which relied primarily on the identity being established from **Frame 0 only**, V3 uses a **custom guide-video construction step** that keeps the new face visible throughout the entire guide sequence.
This results in a much stronger and more persistent identity signal during inference.
# 🙏 Acknowledgements
Special thanks to **facy.ai** for sponsoring the GPU used to train this model.
If you want to check their platform, you can use my referral link:
[https://facy.ai/a/headswap](https://facy.ai/a/headswap)
---
## 🔹 How V3 Works
V3 uses a custom node from **ComfyUI-BFSNodes** to prepare the guide video before inference.
Repository:
```txthttps://github.com/alisson-anjos/ComfyUI-BFSNodes```
Workflow file:
```txtworkflows/workflow_ltx2_head_swap_drag_and_drop_v3.0```
The guide-video preparation process works like this:
1. Start from the original guide video2. Add a **vertical green chroma-key strip** on the side3. Place the **reference face image** inside that strip4. Apply this composition to **every frame** of the original video5. Use this new composite video as the actual inference guide
This means the new identity remains **fully visible during all frames** of the guide video, instead of appearing only in Frame 0 like in previous versions.
That is the main reason V3 can achieve better consistency than earlier versions.
---
## 🔹 Why V3 Is Different
Because the identity reference stays visible during the full guide sequence, V3 gives the model a much more stable conditioning signal across time.
In practice, this can improve:
* Identity consistency* Temporal stability* Resistance to identity drift* Facial motion continuity* Lip sync behavior* Expressive facial movement preservation
This version is especially useful for shots where the face remains visible for longer periods, or where dialogue, mouth movement, and facial acting matter more.
V3 is not just a refinement of the first-frame method. It changes the conditioning logic by giving the model access to a persistent identity template across the entire inference sequence.
---
## 🔹 Final Output Behavior
Even though the guide video used during inference contains the **vertical chroma-key side strip**, the **final generated result does not include that strip**.
The generated video is returned in the **original resolution and framing** of the source guide video.
So in practice:
* The green side strip exists only in the internal guide/template video* It is used only to improve inference conditioning* It does not appear in the final output
---
## 🔹 Prompting for V3
For V3, users can also pass the composite guide video into a vision-capable model to extract a structured prompt.
This is useful because the composite video contains two different information sources:
* the **reference identity** inside the side strip* the **performance and scene information** in the main video area
This helps keep identity and action description separated more cleanly.
### Recommended Prompt Template
```txtAnalyze this composite video.
The video contains:1. a side chroma-key panel with a reference face image2. a main performance video showing the body, clothing, movement, hand actions, objects, framing, and environment
Your task is to extract:- the target face identity from the side panel- the performance/action from the main video
Critical rules:- The side-panel face is the only valid source for identity traits and head-level accessories.- Ignore the visible face and head appearance in the main video completely.- Do not describe any face, hair, hairstyle, hair color, eye color, makeup, facial features, facial expression, attractiveness, headwear, hood, hat, or accessories from the main video.- In the ACTION section, describe the performer only as "a person" and focus only on body movement, clothing, hand actions, objects, framing, and environment.- Do not mention the chroma panel, green background, split layout, or editing structure.- Be factual and non-creative.- Do not guess uncertain details. If a detail is not clearly visible, omit it.
Return exactly in this format:head_swap:
FACE:A brief but detailed objective identity description from the side-panel face only. Include, when clearly visible: apparent gender, apparent ethnicity, skin tone or complexion, approximate age range, head shape, hair or baldness pattern, hair color, eye color, facial hair, visible skin details, headwear or head covering, visible facial accessories, and any especially distinctive facial trait. Prioritize the eyes when they are a strong defining feature.
ACTION:A concise performance description from the main video. Include only: visible clothing, body position, movement, hand actions, objects being shown or handled, camera-facing behavior, framing, and environment. Do not include any face or head appearance from the main video.
Good example:FACE:Female, fair skin, approximately 20-30 years old, oval head shape, long wavy vivid blue-violet hair, bright golden-amber eyes with dark defined pupils, no facial hair, smooth skin, and pink flower hair accessories as a distinctive head adornment.
ACTION:A person in a dark top faces the camera indoors, holds a package of false eyelashes close to the lens, peels one lash from the backing, brings it near the eye area, and examines it while making small hand movements.
Bad example:ACTION:A person with long curly blonde braids holds a pair of false eyelashes...```
### How to Use
1. Generate the V3 composite guide video using the node2. Pass that composite video into a vision-capable model3. Extract the structured **FACE** and **ACTION** prompt4. Use that output as the base prompt for the V3 workflow
---
## 🔹 Captions / Descriptions for V3
If you want automatic captions or prompt extraction from video, you can also use my Ollama nodes.
Repository:
```txthttps://github.com/alisson-anjos/ComfyUI-Ollama-Describer```
A useful node for this workflow is:
**Ollama Video Describer**
This can help generate structured descriptions from the composite guide video and make it easier to build the final prompt for V3.
---
## 🔹 V3 Trigger
Trigger remains:
```txthead_swap:FACE:....
ACTION:....```
---
# 🔴 Critical Success Factor (V2 / V3)
Mask and preparation quality still matter enormously.
Even with improved conditioning, final quality depends on:
* Proper face coverage* Clean compositing* Strong alignment* Good source and reference quality
If any portion of the original guide identity remains visible where it should not, the model may still reintroduce unwanted traits.
Take time to refine your inputs. Better preparation consistently produces better output than simply increasing LoRA strength.
---
## 🔧 Advanced Technique: Combine with LTX-2 Inpainting
Advanced users can experiment with combining this LoRA with the native **LTX-2 inpainting workflow**.
This can help:
* Refine problematic areas* Correct small deformation zones* Improve edge blending* Recover detail in hair or jaw regions
When properly combined, inpainting can significantly enhance final output quality, especially in challenging frames.
---
## 🔹 Recommendation
I strongly recommend testing **both LoRAs** and comparing the final behavior.
Depending on the guide clip, framing, facial motion, and the kind of result you want, some users may prefer the look or motion style of one version over the other.
In general:
* **V2** may still be preferred for some first-frame-driven workflows* **V3** is better when you want a stronger persistent identity signal, better consistency, and better facial/lip motion continuity
The best version will often depend on the shot and on personal preference.
---
# 💙 Support
Maintaining R&D and renting Blackwell GPUs is expensive.
If this project helps you, consider supporting the development of:
* V3 improvements* Advanced conditioning pipelines* SAM 3 integration* Full reference-photo-only workflows
Support here:
[https://buymeacoffee.com/nrdx](https://buymeacoffee.com/nrdx)123version https://git-lfs.github.com/spec/v1oid sha256:bb5008a5750697b2ba6a105813455861c8f84949762a9a919c4f423b60bfc124size 30056875123version https://git-lfs.github.com/spec/v1oid sha256:fd30caefa2bbefe1bdc8927855bf472dce67bdb83e25eaa46255f073f4f79885size 31230709123version https://git-lfs.github.com/spec/v1oid sha256:545e6962243768f4a448f92e8ae72037d3f36a5d26eb2684595e79b045dbe500size 66240119123version https://git-lfs.github.com/spec/v1oid sha256:1166856da2aee972247473feca89a3d2f31a90d8bbeeb882de3c5664f07fa1e2size 38867419123version https://git-lfs.github.com/spec/v1oid sha256:7437dfd7d03ec41af05d1fa71b2d3b1fe107f4fa87b8e38ebc66b573ec16c66dsize 38173397123version https://git-lfs.github.com/spec/v1oid sha256:55b9eef31500f4a392e1f203f098e9408fe7e47887f6a39ebee03b722d44ab7bsize 1688996123version https://git-lfs.github.com/spec/v1oid sha256:7a00b82f46b13fcf1eaa632a922c1b221316b3593387eb151ffe10e9613fe86fsize 1750633123version https://git-lfs.github.com/spec/v1oid sha256:adee6e86236ce5c5c2e1d3f12811488875b2b0232658cb7e1d5cd90ffc53f270size 3308271123version https://git-lfs.github.com/spec/v1oid sha256:a1a754b5ef3a954db0117bbf3bfb88e926af30e712d3f9937dcb5d4a5c6ef215size 528062123version https://git-lfs.github.com/spec/v1oid sha256:7064a883ccaef8e6d99782ab7eab05f8023d407d119574e4fd81936ba0be42dbsize 490982123version https://git-lfs.github.com/spec/v1oid sha256:a25d4fd9622d9d81f897744d1d7d7b99a17812eeb41905e68aacf5c375892608size 654443424123version https://git-lfs.github.com/spec/v1oid sha256:78083ede0004c500ac0ae7b8fee43d28a1c3b503bac4a21edfeba7c60da8460dsize 1358465856123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657# ============================================================
# CONFIGURATION
# ============================================================
$COMFYUI_ROOT = "C:\ComfyUI_windows_portable\ComfyUI" # Update this path!
$MODELS_BASE = "$COMFYUI_ROOT\models"
# Use your HF Token if models are gated
$HF_TOKEN = ""
# ============================================================
# DOWNLOAD FUNCTION
# ============================================================
function Download-Model {
param ([string]$url, [string]$dest)
if (Test-Path $dest) {
Write-Host ">>> Skipping: $dest (Already exists)" -ForegroundColor Cyan
} else {
Write-Host ">>> Downloading to: $dest" -ForegroundColor Yellow
$parent = Split-Path -Parent $dest
if (-not (Test-Path $parent)) { New-Item -ItemType Directory -Path $parent -Force }
$headers = @{}
if ($HF_TOKEN) { $headers["Authorization"] = "Bearer $HF_TOKEN" }
Invoke-WebRequest -Uri $url -OutFile $dest -Headers $headers -MaximumRetryCount 3
}
}
# ============================================================
# MODELS LIST
# ============================================================
# --- FLUX.2 KLEIN ---
Download-Model "https://huggingface.co/black-forest-labs/FLUX.2-klein-9b-fp8/resolve/main/flux-2-klein-9b-fp8.safetensors" "$MODELS_BASE\diffusion_models\flux-2-klein-9b-fp8.safetensors"
Download-Model "https://huggingface.co/Comfy-Org/flux2-klein-9B/resolve/main/split_files/text_encoders/qwen_3_8b_fp8mixed.safetensors" "$MODELS_BASE\text_encoders\qwen_3_8b_fp8mixed.safetensors"
Download-Model "https://huggingface.co/Comfy-Org/flux2-dev/resolve/main/split_files/vae/flux2-vae.safetensors" "$MODELS_BASE\vae\flux2-vae.safetensors"
Download-Model "https://huggingface.co/Alissonerdx/BFS-Best-Face-Swap/resolve/main/bfs_head_v1_flux-klein_9b_step3500_rank128.safetensors" "$MODELS_BASE\loras\bfs_head_v1_flux-klein_9b_step3500_rank128.safetensors"
Download-Model "https://huggingface.co/Alissonerdx/BFS-Best-Face-Swap/resolve/main/bfs_head_v1_flux-klein_9b_step3750_rank64.safetensors" "$MODELS_BASE\loras\bfs_head_v1_flux-klein_9b_step3750_rank64.safetensors"
# --- LTX-VIDEO 2 (DEV RECOMMENDED) ---
Download-Model "https://huggingface.co/Kijai/LTXV2_comfy/resolve/main/diffusion_models/ltx-2-19b-dev-fp8_transformer_only.safetensors" "$MODELS_BASE\diffusion_models\ltx-2-19b-dev-fp8_transformer_only.safetensors"
Download-Model "https://huggingface.co/Comfy-Org/ltx-2/resolve/main/split_files/text_encoders/gemma_3_12B_it_fp8_scaled.safetensors" "$MODELS_BASE\text_encoders\gemma_3_12B_it_fp8_scaled.safetensors"
Download-Model "https://huggingface.co/Kijai/LTXV2_comfy/resolve/main/text_encoders/ltx-2-19b-embeddings_connector_dev_bf16.safetensors" "$MODELS_BASE\text_encoders\ltx-2-19b-embeddings_connector_dev_bf16.safetensors"
Download-Model "https://huggingface.co/Kijai/LTXV2_comfy/resolve/main/VAE/LTX2_video_vae_bf16.safetensors" "$MODELS_BASE\vae\LTX2_video_vae_bf16.safetensors"
Download-Model "https://huggingface.co/Kijai/LTXV2_comfy/resolve/main/VAE/LTX2_audio_vae_bf16.safetensors" "$MODELS_BASE\vae\LTX2_audio_vae_bf16.safetensors"
# --- BFS VIDEO LORAS ---
Download-Model "https://huggingface.co/Alissonerdx/BFS-Best-Face-Swap-Video/resolve/main/ltx-2/head_swap_v1_13500_first_frame.safetensors" "$MODELS_BASE\loras\head_swap_v1_13500_first_frame.safetensors"
Download-Model "https://huggingface.co/Alissonerdx/BFS-Best-Face-Swap-Video/resolve/main/ltx-2/head_swap_v1_8750_first_and_last_frame.safetensors" "$MODELS_BASE\loras\head_swap_v1_8750_first_and_last_frame.safetensors"
# --- EXTRAS ---
Download-Model "https://huggingface.co/Lightricks/LTX-2/resolve/main/ltx-2-spatial-upscaler-x2-1.0.safetensors" "$MODELS_BASE\latent_upscale_models\ltx-2-spatial-upscaler-x2-1.0.safetensors"
Download-Model "https://huggingface.co/Kijai/MelBandRoFormer_comfy/resolve/main/MelBandRoformer_fp32.safetensors" "$MODELS_BASE\diffusion_models\MelBandRoformer_fp32.safetensors"
Write-Host "--- ALL DOWNLOADS FINISHED ---" -ForegroundColor Green
pause123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129#!/usr/bin/env bashset -e
# ============================================================# CONFIGURATION# ============================================================# By default, it uses the current directory. # Change this if your ComfyUI is located elsewhere.COMFYUI_ROOT=$(pwd)COMFYUI_MODELS="${COMFYUI_ROOT}/models"
# Optional: Add your HF Token here if you encounter permission issues# export HF_TOKEN="your_token_here"
# ============================================================# HELPER FUNCTION# ============================================================download_model() { local url="$1" local dest="$2" if [ -f "$dest" ]; then echo -e "\e[36m>>> Skipping: $dest (Already exists)\e[0m" else echo -e "\e[33m>>> Downloading: $dest\e[0m" mkdir -p "$(dirname "$dest")" local auth_header="" if [ -n "$HF_TOKEN" ]; then auth_header="Authorization: Bearer $HF_TOKEN" fi
if [ -n "$auth_header" ]; then wget -q --show-progress --header "$auth_header" -O "$dest" "$url" else wget -q --show-progress -O "$dest" "$url" fi fi}
echo -e "\e[32mStarting downloads to: ${COMFYUI_MODELS}\e[0m"echo "--------------------------------------------------"
# ============================================================# 1. FLUX.2 KLEIN 9B# ============================================================echo "--- FLUX.2 KLEIN ---"
# Transformerdownload_model \ "https://huggingface.co/black-forest-labs/FLUX.2-klein-9b-fp8/resolve/main/flux-2-klein-9b-fp8.safetensors" \ "${COMFYUI_MODELS}/diffusion_models/flux-2-klein-9b-fp8.safetensors"
# Text Encoderdownload_model \ "https://huggingface.co/Comfy-Org/flux2-klein-9B/resolve/main/split_files/text_encoders/qwen_3_8b_fp8mixed.safetensors" \ "${COMFYUI_MODELS}/text_encoders/qwen_3_8b_fp8mixed.safetensors"
# VAEdownload_model \ "https://huggingface.co/Comfy-Org/flux2-dev/resolve/main/split_files/vae/flux2-vae.safetensors" \ "${COMFYUI_MODELS}/vae/flux2-vae.safetensors"
# LoRAsdownload_model \ "https://huggingface.co/Alissonerdx/BFS-Best-Face-Swap/resolve/main/bfs_head_v1_flux-klein_9b_step3500_rank128.safetensors" \ "${COMFYUI_MODELS}/loras/bfs_head_v1_flux-klein_9b_step3500_rank128.safetensors"
download_model \ "https://huggingface.co/Alissonerdx/BFS-Best-Face-Swap/resolve/main/bfs_head_v1_flux-klein_9b_step3750_rank64.safetensors" \ "${COMFYUI_MODELS}/loras/bfs_head_v1_flux-klein_9b_step3750_rank64.safetensors"
# ============================================================# 2. LTX-VIDEO 2 (LTXV-2)# ============================================================echo "--- LTX-VIDEO 2 ---"
# Transformer (DEV is Recommended)download_model \ "https://huggingface.co/Kijai/LTXV2_comfy/resolve/main/diffusion_models/ltx-2-19b-dev-fp8_transformer_only.safetensors" \ "${COMFYUI_MODELS}/diffusion_models/ltx-2-19b-dev-fp8_transformer_only.safetensors"
# Text Encoders & Connectordownload_model \ "https://huggingface.co/Comfy-Org/ltx-2/resolve/main/split_files/text_encoders/gemma_3_12B_it_fp8_scaled.safetensors" \ "${COMFYUI_MODELS}/text_encoders/gemma_3_12B_it_fp8_scaled.safetensors"
download_model \ "https://huggingface.co/Kijai/LTXV2_comfy/resolve/main/text_encoders/ltx-2-19b-embeddings_connector_dev_bf16.safetensors" \ "${COMFYUI_MODELS}/text_encoders/ltx-2-19b-embeddings_connector_dev_bf16.safetensors"
# VAEsdownload_model \ "https://huggingface.co/Kijai/LTXV2_comfy/resolve/main/VAE/LTX2_video_vae_bf16.safetensors" \ "${COMFYUI_MODELS}/vae/LTX2_video_vae_bf16.safetensors"
download_model \ "https://huggingface.co/Kijai/LTXV2_comfy/resolve/main/VAE/LTX2_audio_vae_bf16.safetensors" \ "${COMFYUI_MODELS}/vae/LTX2_audio_vae_bf16.safetensors"
# Video LoRAsdownload_model \ "https://huggingface.co/Alissonerdx/BFS-Best-Face-Swap-Video/resolve/main/ltx-2/head_swap_v1_13500_first_frame.safetensors" \ "${COMFYUI_MODELS}/loras/head_swap_v1_13500_first_frame.safetensors"
download_model \ "https://huggingface.co/Alissonerdx/BFS-Best-Face-Swap-Video/resolve/main/ltx-2/head_swap_v1_8750_first_and_last_frame.safetensors" \ "${COMFYUI_MODELS}/loras/head_swap_v1_8750_first_and_last_frame.safetensors"
# ============================================================# 3. UPSCALER & EXTRAS# ============================================================echo "--- UPSCALER & EXTRAS ---"
download_model \ "https://huggingface.co/Lightricks/LTX-2/resolve/main/ltx-2-spatial-upscaler-x2-1.0.safetensors" \ "${COMFYUI_MODELS}/latent_upscale_models/ltx-2-spatial-upscaler-x2-1.0.safetensors"
download_model \ "https://huggingface.co/Kijai/MelBandRoFormer_comfy/resolve/main/MelBandRoformer_fp32.safetensors" \ "${COMFYUI_MODELS}/diffusion_models/MelBandRoformer_fp32.safetensors"
# ============================================================# DONE# ============================================================echo "--------------------------------------------------"echo -e "\e[32mAll models downloaded successfully!\e[0m"123version https://git-lfs.github.com/spec/v1oid sha256:056373cf73418dac449fecf34a5b749deeb802a1a4a4a9fc1677cd46c2d48864size 1308756368123version https://git-lfs.github.com/spec/v1oid sha256:48d16179c82629385fb5a812ed33182952e7755a60464ffe645d3417f5d48a71size 1308756368123version https://git-lfs.github.com/spec/v1oid sha256:f459e03568447dcc5d6ea7c02466fece5eee3409bb23f07dfc2ecab24ac7a2fasize 1316096704123version https://git-lfs.github.com/spec/v1oid sha256:d7e541b7913c31625fb9808ae7d58803b10ec3dd512ba64cfde987c62ad74f50size 613551752123version https://git-lfs.github.com/spec/v1oid sha256:b2d142a3bd97331f73bc06a95f0a1ed0b9d83461d0191c95d5c931edd5665b90size 613551752.gitattributesAdded+87
README.mdAdded+501
examples/1.mp4Added+3
examples/2.mp4Added+3
examples/3.mp4Added+3
examples/4.mp4Added+3
examples/5.mp4Added+3
examples/6.mp4Added+3
examples/7.mp4Added+3
examples/8.mp4Added+3
examples/head_bernini_00030-audio_1.mp4Added+3
examples/head_bernini_00033-audio_2.mp4Added+3
ltx-2.3/head_swap_v3_rank_64.safetensorsAdded+3
ltx-2.3/head_swap_v3_rank_adaptive_fro_098.safetensorsAdded+3
ltx-2/download-models-head-swap-ltx2-windows.ps1Added+57
ltx-2/download-models-head-swap-ltx2.shAdded+129
ltx-2/head_swap_v1_13500_first_frame.safetensorsAdded+3
ltx-2/head_swap_v1_8750_first_and_last_frame.safetensorsAdded+3
ltx-2/head_swap_v2_multimodes.safetensorsAdded+3
wan22/headswap_bernini_r64_73f640_step3000_high_noise.safetensorsAdded+3
wan22/headswap_bernini_r64_73f640_step3000_low_noise.safetensorsAdded+3
workflows/workflow_ltx2_head_swap_drag_and_drop.jsonAdded
workflows/workflow_ltx2_head_swap_drag_and_drop_v1.1.jsonAdded
workflows/workflow_ltx2_head_swap_drag_and_drop_v2.0.jsonAdded
workflows/workflow_ltx2_head_swap_drag_and_drop_v3.0.jsonAdded
workflows/workflow_wan22_bernini_head_swap_drag_and_drop_v1.0.jsonAdded