Instructions to use Thytu/FLUX.1-Kontext-dev-cage-ify with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Thytu/FLUX.1-Kontext-dev-cage-ify 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("black-forest-labs/FLUX.1-Kontext-dev", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("Thytu/FLUX.1-Kontext-dev-cage-ify") prompt = "Replace the face with Nicolas Cage's face" 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] - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
File size: 4,199 Bytes
6c642e9 2c73909 6c642e9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | ---
tags:
- image-to-image
- lora
- diffusers
- template:diffusion-lora
widget:
- output:
url: images/_ki-bY_sewZCIApJgDYQv.png
text: Replace the face with Nicolas Cage's face
- output:
url: images/8VjJQRIuk6hOKdVSRQHaN.png
text: Replace the face with Nicolas Cage's face
- output:
url: images/cO-qVnU-o79Zo94LMyF2w.png
text: Replace the face with Nicolas Cage's face
- output:
url: images/HBefBm8iIFcH--IMcipi0.png
text: Replace the face with Nicolas Cage's face
- output:
url: images/leLq1_DkeopjjKybaqKY2.png
text: Replace the face with Nicolas Cage's face
base_model: black-forest-labs/FLUX.1-Kontext-dev
instance_prompt: null
license: mit
---
# FLUX.1-Kontext-dev-cage-ify
<Gallery />
## Model description
# ๐ญ Cage-ify
[](https://fal.ai/models/fal-ai/image-editing/cage-ify)
[](https://opensource.org/licenses/MIT)
[](https://twitter.com/ThytuVDM)
> Transform any face into Nicolas Cage's face while maintaining the original expression, lighting, and pose.
## ๐ฏ What is Cage-ify?
Cage-ify is a custom LoRA fine-tune of FLUX.1 Kontext that can replace any human face with Nicolas Cage's face while preserving the original facial expression, lighting conditions, and head positioning.
### โจ Key Features
- **๐ญ Perfect Face Replacement**: Seamlessly swaps any face with Nicolas Cage
- **๐จ Expression Matching**: Maintains original facial expressions
- **๐ก Lighting Preservation**: Keeps original lighting and shadows
- **๐ Pose Retention**: Preserves head position and angle
- **๐ Universal Compatibility**: Works on any photo with a visible face
## ๐ Quick Start
### Try Online (Recommended)
[**๐ฎ Try Cage-ify Live โ**](https://fal.ai/models/fal-ai/image-editing/cage-ify)
### API Usage
```python
import fal_client
def cage_ify_image(image_url):
result = fal_client.submit(
"fal-ai/flux-kontext-lora",
arguments={
"image_url": image_url,
"prompt": "Transform the face into Nicolas Cage's face",
"lora_path": "your-lora-path-here"
}
)
return result
```
## ๐ ๏ธ How It Works
### Training Process
1. **Data Collection**: Gathered 100+ high-quality Nicolas Cage images
2. **Reverse Engineering**: Used FLUX.1 Kontext to transform Cage faces into diverse other faces
3. **Dataset Creation**: Flipped the pairs to create "other face โ Cage" training data
4. **LoRA Training**: Fine-tuned FLUX.1 Kontext [dev] using the dataset
## ๐จ Use Cases
If you really need a reason to why we should Cage-ify everything, here are some:
- **๐ฌ Movie Poster Parodies**: Cage-ify your favorite films
- **๐จโ๐ฉโ๐งโ๐ฆ Family Photos**: Make everyone in your family look like Nicolas Cage
- **๐จ Art Projects**: Creative digital art and collages
- **๐ Our True Leader**: Spray the words
## ๐ Acknowledgments
- **Black Forest Labs** for creating FLUX.1 Kontext
- **fal.ai** for providing training and inference infrastructure
- **Nicolas Cage** for being the One True God of faces
- **The Internet** for existing
## ๐ Contact
- **Twitter**: [@ThytuVDM](https://twitter.com/ThytuVDM)
- **Issues**: [GitHub Issues](https://github.com/Thytu/cage-ify/issues)
---
<div align="center">
**โญ Star this repo if Cage-ify brought joy to your life! โญ**
*"I'm gonna steal the Declaration of Independence... and every face on the internet."* - Nicolas Cage (probably)
</div>
## Download model
[Download](/Thytu/FLUX.1-Kontext-dev-cage-ify/tree/main) them in the Files & versions tab.
|