---
license: apache-2.0
base_model: black-forest-labs/FLUX.2-klein-base-9B
base_model_relation: adapter
tags:
- lora
- flux
- flux.2
- flux.2-klein
- character-swap
- face-swap
- occlusion-handling
- diffusers
- image-to-image
- photorealistic
language:
- en
pipeline_tag: image-to-image
library_name: diffusers
instance_prompt: jhuangswap
widget:
- text: "jhuangswap β cycle through: character source β target body β final output"
output:
url: examples/A3.jpg
---
# π Flux.2-Klein-9B-SmartCharcterswap
**A specialized LoRA adapter for FLUX.2 Klein 9B designed for high-end, highly accurate character and face swapping. It excels at handling complex occlusions (like hands, veils, and foreground objects) and seamlessly matching the color grading and lighting of the target image.**
Built specifically for practical, high-end portrait editing and commercial imaging workflows, ensuring photorealistic results without unwanted cartoon or stylized aesthetics.
---
## π΄ TUTORIALS COMING SOON β SUBSCRIBE NOW
**I'll be dropping in-depth tutorials on AI models, ComfyUI workflows, image & video generation, 3D tools and more.**
[](https://www.youtube.com/@JettHuangAI)
**[@JettHuangAI](https://www.youtube.com/@JettHuangAI) β Hit π so you don't miss it!**
---
### β Support My Work
If this LoRA helps your projects, please consider supporting continued development and new model releases.
[](https://paypal.me/nhathoangfoto)
**β [paypal.me/nhathoangfoto](https://paypal.me/nhathoangfoto) β**
*Every contribution directly funds training compute, dataset curation, and the release of new open-source LoRAs.*
---
For custom LoRA training, advanced ComfyUI workflow development, or collaboration:
π Website: [jetthuang.com](https://jetthuang.com)
π± WhatsApp: +84947397868
π¬ Telegram/Discord: nhathoangfoto
π¦ X: https://x.com/NhatPhoto
π Facebook: https://www.facebook.com/nhathoangfoto
Powerful local hardware, ready for any complex project: π **RTX 5090** | **RTX Pro 6000** π οΈ
---
## πΌοΈ Examples
### Case 1 β B&W Color Matching & Hand Occlusion
| Character Source (Identity) | Target Body (Base Image) | β Final Output |
|:---:|:---:|:---:|
|  |  |  |
### Case 2 β Complex Occlusion Handling (Veil)
| Character Source (Identity) | Target Body (Base Image) | β Final Output |
|:---:|:---:|:---:|
|  |  |  |
*Left: Character reference (identity). Middle: Target body/scene. Right: Final output β the character seamlessly integrated with perfect occlusion and lighting matching.*
---
## β¨ What this LoRA does
- **Masterful Occlusion Handling:** Unlike standard swap tools that break when hands, hair, or objects cover the face, this LoRA understands depth and seamlessly integrates the new identity *behind* occluding elements.
- **Perfect Lighting & Color Sync:** Automatically adapts the source identity to the target's environment. If the target is a dramatic B&W portrait, the swapped face will perfectly match the B&W tones, contrast, and directional shadows.
- **Strictly High-End Realism:** Finely tuned for practical photography and portrait retouching. It aggressively preserves realistic skin textures and structural anatomy while completely avoiding cartoonish or overly-smoothed AI artifacts.
- **Identity Preservation:** Maintains the bone structure, distinct facial features, and unique characteristics of the source subject across diverse angles and expressions.
## π― Why use it
Standard face-swap methods often fail in professional environments because they:
- Paste faces *over* foreground objects (like hands or microphones).
- Fail to adjust skin tone and lighting to match the background.
- Introduce an uncanny, plastic, or illustrative look.
**SmartCharcterswap LoRA solves this** by acting as a highly intelligent compositor, making it an essential tool for commercial photography, automated AI photobooths, and advanced ComfyUI pipelines.
---
## π Complete Workflow
This LoRA is optimized for node-based workflows in ComfyUI, providing maximum stability and near-perfect accuracy after rigorous testing.
### π Example Workflow

*Screenshot of the highly efficient ComfyUI workflow utilized for testing and executing the Smart Character Swap.*
---
> [!IMPORTANT]
> ## π‘ Get the Most Out of This LoRA
>
> This LoRA performs at its **absolute best** when paired with a **custom workflow tailored to your specific use case**, combined with additional control LoRAs for precise, production-ready results.
>
> A generic workflow will only scratch the surface of what this model can do. For commercial shoots, AI photobooths, or advanced portrait pipelines β a purpose-built workflow makes all the difference.
>
> **π© For a custom workflow, please contact me directly:**
> - π± WhatsApp: **+84947397868**
> - π¬ Telegram/Discord: **nhathoangfoto**
> - π [jetthuang.com](https://jetthuang.com)
---
## π― Trigger Word
```
jhuangswap
```
Place this trigger at the beginning of your positive prompt to activate the character swapping behavior effectively.
### Example Prompt Structure
```
jhuangswap, masterpiece, high-end photography, realistic portrait of a young man, matching target lighting, highly detailed skin texture, 8k resolution
```
---
## π‘ Tips & Prompting Guide
### 1. Focus on Photographic Quality
To maintain the high-end practical feel, always use prompts that steer the base model toward realism.
**Good:** `jhuangswap, editorial photography, studio lighting, raw photo, realistic skin...`
**Avoid:** Prompts containing words like `illustration, 3d render, anime, stylized...`
### 2. Let the Target Image Dictate the Scene
You do not need to heavily describe the pose or the background if you are using an image-to-image/ControlNet workflow. Let the Target Body image drive the composition, and use the prompt to reinforce the identity and photographic quality.
### 3. Recommended Settings
- **LoRA Strength**: `0.75 β 1.0` (Adjust based on how aggressively the target image deviates from the source identity).
- **Inference Steps**: 20β30 steps for Base Model.
- **Guidance Scale**: `2.0 β 4.0`
---
## π Usage
### ComfyUI
```
1. Download the .safetensors file.
2. Place it in: ComfyUI/models/loras/
3. Build your image-to-image or character swap workflow (refer to the Screenshot.jpg).
4. Use the trigger word "jhuangswap" in your positive prompt.
```
### Diffusers (Python)
```python
from diffusers import Flux2Pipeline
import torch
pipe = Flux2Pipeline.from_pretrained(
"black-forest-labs/FLUX.2-klein-base-9B",
torch_dtype=torch.bfloat16
).to("cuda")
pipe.load_lora_weights(
"nhathoangfoto/Flux.2-Klein-9B-SmartCharcterswap",
adapter_name="smartcharswap"
)
pipe.set_adapters(["smartcharswap"], adapter_weights=[0.85])
# Example usage (integration with image-to-image pipelines required for full swap functionality)
```
---
## β οΈ Limitations
- **Extreme Angles:** While highly robust, extreme profile shots (full 90-degree side profiles) may still experience slight identity degradation depending on the source image quality.
- **Resolution:** Designed for high-end outputs; providing extremely low-resolution source images will limit the detail recovery in the final output.
---
## π License
Released under **Apache 2.0**. You are free to use this LoRA for personal, research, and commercial purposes.
The base model (FLUX.2 Klein Base 9B) has its own license β please review the [FLUX.2 Klein Base 9B license terms](https://huggingface.co/black-forest-labs/FLUX.2-klein-base-9B) for base-model usage conditions.
---
## π Credits
- **Base Model**: [FLUX.2 Klein Base 9B](https://huggingface.co/black-forest-labs/FLUX.2-klein-base-9B) by Black Forest Labs
- **Author**: Jett Huang (NhαΊt HoΓ ng) β [NhαΊt HoΓ ng AI / jetthuang.com](https://jetthuang.com)
- *Workflow developer ComfyUI, Automation Workflow AI.*
---
## β Enjoying this LoRA?
Your support keeps new models coming. Even a small tip makes a real difference for independent open-source AI work.
### [**π Donate via PayPal**](https://paypal.me/nhathoangfoto)
[](https://paypal.me/nhathoangfoto)
*Thank you for supporting independent AI research! π*
---
**If you find this LoRA useful, please β€οΈ like the model and share your creations in the Community tab!**