---
license: apache-2.0
language:
- en
tags:
- flux
- flux-2-klein
- flux-lora
- lora
- outpainting
- image-extension
- green-screen
- inpainting
- image-to-image
- fal-ai
- template:diffusion-lora
pipeline_tag: image-to-image
widget:
- text: Fill the green spaces according to the image
output:
url: examples/example1_output.jpg
- src: examples/example1_input.jpg
prompt: Fill the green spaces according to the image
output:
url: examples/example1_output.jpg
- text: Fill the green spaces according to the image
output:
url: examples/example2_output.jpg
- src: examples/example2_input.jpg
prompt: Fill the green spaces according to the image
output:
url: examples/example2_output.jpg
- text: Fill the green spaces according to the image
output:
url: examples/example3_output.jpg
- src: examples/example3_input.jpg
prompt: Fill the green spaces according to the image
output:
url: examples/example3_output.jpg
- text: Fill the green spaces according to the image
output:
url: examples/example4_output.jpg
- src: examples/example4_input.jpg
prompt: Fill the green spaces according to the image
output:
url: examples/example4_output.jpg
base_model: black-forest-labs/FLUX.2-klein-4B
instance_prompt: Fill the green spaces according to the image
---
# 🖼️ Flux Green Screen Outpainting LoRA
### Extend images by filling green border areas with AI-generated content
[](https://fal.ai/models/fal-ai/flux-2/klein/4b/base/edit/lora)
[](https://opensource.org/licenses/Apache-2.0)
---
## 🎯 What does this model do?
This LoRA fills **green border areas** around an image with contextually appropriate AI-generated content. Simply add a green border to any image, and the model will extend the scene naturally.
```
┌─────────────────────────────────────┐
│ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ Green areas
│ ░░░┌───────────────────────┐░░░░░░░ │ get filled
│ ░░░│ │░░░░░░░ │ with matching
│ ░░░│ Original Image │░░░░░░░ │ content
│ ░░░│ │░░░░░░░ │
│ ░░░└───────────────────────┘░░░░░░░ │
│ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │
└─────────────────────────────────────┘
```
Perfect for **extending photos**, **creating wider compositions**, and **generating seamless backgrounds**.
---
## 🖼️ Examples
| Input (with green border) |
Output (extended image) |
 |
 |
 |
 |
 |
 |
 |
 |
---
## 🚀 Quick Start
### Prompt
```
Fill the green spaces according to the image
```
### Green Border Requirements
- Use pure green: RGB(0, 255, 0) or #00FF00
- Border can be any thickness (5%-25% of image dimension works well)
- Each side can have different border widths
---
## 💻 Usage
### Try it Live on fal.ai
▶️ **[Open Playground](https://fal.ai/models/fal-ai/flux-2-klein/4b/base/edit/lora?share=528658ce-ed9c-46be-8e2b-815fbc4d14a6)**
### With fal.ai SDK
```python
import fal_client
def on_queue_update(update):
if isinstance(update, fal_client.InProgress):
for log in update.logs:
print(log["message"])
result = fal_client.subscribe(
"fal-ai/flux-2/klein/4b/base/edit/lora",
arguments={
"prompt": "Fill the green spaces according to the image",
"model_name": None,
"loras": [{
"path": "https://huggingface.co/fal/flux-2-klein-4B-outpaint-lora/resolve/main/flux-outpaint-lora.safetensors",
"scale": 1.1
}],
"embeddings": [],
"image_urls": ["https://your-image-with-green-border.png"]
},
with_logs=True,
on_queue_update=on_queue_update,
)
print(result)
```
---
## 📦 Model Files
| File | Use Case |
|------|----------|
| `flux-outpaint-lora.safetensors` | fal.ai |
| `LyNiaZ53Tudg0J6sT8Xbx_pytorch_lora_weights_comfy_converted.safetensors` | ComfyUI |
---
## 🎓 Training Details
Click to expand
### Dataset
- **Size**: 1000 image pairs
- **Content**: Diverse subjects including:
- **Landscapes**: mountains, beaches, forests, deserts, cities
- **People**: portraits, groups, activities
- **Animals**: pets, wildlife, birds
- **Food**: dishes, ingredients, table settings
- **Architecture**: buildings, interiors, landmarks
- **Art styles**: paintings, illustrations, abstract
- **Objects**: vehicles, electronics, furniture
- **Nature**: weather, space, underwater
- **Border variation**: Random green borders (5%-25% of each side)
- **Aspect ratios**: Various (1:1, 16:9, 9:16, 4:3, 3:4, etc.)
### Training
- **Base Model**: FLUX.2-Klein 4B
- **Platform**: [fal.ai](https://fal.ai)
- **Method**: LoRA training
---
## 🎮 Use Cases
- **Photo Extension**: Expand cropped photos to wider compositions
- **Background Generation**: Create seamless backgrounds for subjects
- **Aspect Ratio Conversion**: Convert portrait to landscape or vice versa
- **Creative Composition**: Add environmental context to isolated subjects
---
## ⚠️ Limitations
- Works best with pure green (#00FF00) borders
- Complex scenes may require multiple passes
- Very large border areas may produce less coherent results
---
## 📄 License
[Apache 2.0](https://opensource.org/licenses/Apache-2.0)
---
### Created by [@ilkerzgi](https://huggingface.co/ilkerzgi) • Trained with [fal.ai](https://fal.ai)
[](https://fal.ai/models/fal-ai/flux-2/klein/4b/base/edit/lora/)