Duplicate from fal/flux-2-klein-4B-outpaint-lora
Browse filesCo-authored-by: ilkerizgi <ilkerzgi@users.noreply.huggingface.co>
- .gitattributes +46 -0
- LyNiaZ53Tudg0J6sT8Xbx_pytorch_lora_weights_comfy_converted.safetensors +3 -0
- README.md +230 -0
- examples/example1_input.jpg +3 -0
- examples/example1_output.jpg +3 -0
- examples/example2_input.jpg +3 -0
- examples/example2_output.jpg +3 -0
- examples/example3_input.jpg +3 -0
- examples/example3_output.jpg +3 -0
- examples/example4_input.jpg +3 -0
- examples/example4_output.jpg +3 -0
- flux-outpaint-lora.safetensors +3 -0
- images/banner.jpg +3 -0
- images/example_input.jpg +3 -0
- images/example_output.jpg +3 -0
.gitattributes
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
examples/example1_input.jpg filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
examples/example1_output.jpg filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
examples/example2_input.jpg filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
examples/example2_output.jpg filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
examples/example3_input.jpg filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
examples/example3_output.jpg filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
examples/example4_input.jpg filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
examples/example4_output.jpg filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
images/banner.jpg filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
images/example_input.jpg filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
images/example_output.jpg filter=lfs diff=lfs merge=lfs -text
|
LyNiaZ53Tudg0J6sT8Xbx_pytorch_lora_weights_comfy_converted.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b8a5142b40f2e24aa1f5cfd0710323188836f49ea70b15b5f85b1e364316bc5b
|
| 3 |
+
size 76038936
|
README.md
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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ux-2-klein
|
| 8 |
+
- flux-lora
|
| 9 |
+
- lora
|
| 10 |
+
- outpainting
|
| 11 |
+
- image-extension
|
| 12 |
+
- green-screen
|
| 13 |
+
- inpainting
|
| 14 |
+
- image-to-image
|
| 15 |
+
- fal-ai
|
| 16 |
+
- template:diffusion-lora
|
| 17 |
+
pipeline_tag: image-to-image
|
| 18 |
+
widget:
|
| 19 |
+
- text: Fill the green spaces according to the image
|
| 20 |
+
output:
|
| 21 |
+
url: examples/example1_output.jpg
|
| 22 |
+
- src: examples/example1_input.jpg
|
| 23 |
+
prompt: Fill the green spaces according to the image
|
| 24 |
+
output:
|
| 25 |
+
url: examples/example1_output.jpg
|
| 26 |
+
- text: Fill the green spaces according to the image
|
| 27 |
+
output:
|
| 28 |
+
url: examples/example2_output.jpg
|
| 29 |
+
- src: examples/example2_input.jpg
|
| 30 |
+
prompt: Fill the green spaces according to the image
|
| 31 |
+
output:
|
| 32 |
+
url: examples/example2_output.jpg
|
| 33 |
+
- text: Fill the green spaces according to the image
|
| 34 |
+
output:
|
| 35 |
+
url: examples/example3_output.jpg
|
| 36 |
+
- src: examples/example3_input.jpg
|
| 37 |
+
prompt: Fill the green spaces according to the image
|
| 38 |
+
output:
|
| 39 |
+
url: examples/example3_output.jpg
|
| 40 |
+
- text: Fill the green spaces according to the image
|
| 41 |
+
output:
|
| 42 |
+
url: examples/example4_output.jpg
|
| 43 |
+
- src: examples/example4_input.jpg
|
| 44 |
+
prompt: Fill the green spaces according to the image
|
| 45 |
+
output:
|
| 46 |
+
url: examples/example4_output.jpg
|
| 47 |
+
base_model: black-forest-labs/FLUX.2-klein-4B
|
| 48 |
+
instance_prompt: Fill the green spaces according to the image
|
| 49 |
+
---
|
| 50 |
+
|
| 51 |
+
<Gallery />
|
| 52 |
+
|
| 53 |
+
<div align="center">
|
| 54 |
+
|
| 55 |
+
# 🖼️ Flux Green Screen Outpainting LoRA
|
| 56 |
+
|
| 57 |
+
### Extend images by filling green border areas with AI-generated content
|
| 58 |
+
|
| 59 |
+
[](https://fal.ai/models/fal-ai/flux-2/klein/4b/base/edit/lora)
|
| 60 |
+
[](https://opensource.org/licenses/Apache-2.0)
|
| 61 |
+
|
| 62 |
+
<img src="images/banner.jpg" alt="Outpaint LoRA Banner" width="100%">
|
| 63 |
+
|
| 64 |
+
</div>
|
| 65 |
+
|
| 66 |
+
---
|
| 67 |
+
|
| 68 |
+
## 🎯 What does this model do?
|
| 69 |
+
|
| 70 |
+
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.
|
| 71 |
+
```
|
| 72 |
+
┌─────────────────────────────────────┐
|
| 73 |
+
│ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ Green areas
|
| 74 |
+
│ ░░░┌───────────────────────┐░░░░░░░ │ get filled
|
| 75 |
+
│ ░░░│ │░░░░░░░ │ with matching
|
| 76 |
+
│ ░░░│ Original Image │░░░░░░░ │ content
|
| 77 |
+
│ ░░░│ │░░░░░░░ │
|
| 78 |
+
│ ░░░└───────────────────────┘░░░░░░░ │
|
| 79 |
+
│ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │
|
| 80 |
+
└─────────────────────────────────────┘
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
Perfect for **extending photos**, **creating wider compositions**, and **generating seamless backgrounds**.
|
| 84 |
+
|
| 85 |
+
---
|
| 86 |
+
|
| 87 |
+
## 🖼️ Examples
|
| 88 |
+
|
| 89 |
+
<table>
|
| 90 |
+
<tr>
|
| 91 |
+
<th>Input (with green border)</th>
|
| 92 |
+
<th>Output (extended image)</th>
|
| 93 |
+
</tr>
|
| 94 |
+
<tr>
|
| 95 |
+
<td><img src="examples/example1_input.jpg" width="300"></td>
|
| 96 |
+
<td><img src="examples/example1_output.jpg" width="300"></td>
|
| 97 |
+
</tr>
|
| 98 |
+
<tr>
|
| 99 |
+
<td><img src="examples/example2_input.jpg" width="300"></td>
|
| 100 |
+
<td><img src="examples/example2_output.jpg" width="300"></td>
|
| 101 |
+
</tr>
|
| 102 |
+
<tr>
|
| 103 |
+
<td><img src="examples/example3_input.jpg" width="300"></td>
|
| 104 |
+
<td><img src="examples/example3_output.jpg" width="300"></td>
|
| 105 |
+
</tr>
|
| 106 |
+
<tr>
|
| 107 |
+
<td><img src="examples/example4_input.jpg" width="300"></td>
|
| 108 |
+
<td><img src="examples/example4_output.jpg" width="300"></td>
|
| 109 |
+
</tr>
|
| 110 |
+
</table>
|
| 111 |
+
|
| 112 |
+
---
|
| 113 |
+
|
| 114 |
+
## 🚀 Quick Start
|
| 115 |
+
|
| 116 |
+
### Prompt
|
| 117 |
+
```
|
| 118 |
+
Fill the green spaces according to the image
|
| 119 |
+
```
|
| 120 |
+
|
| 121 |
+
### Green Border Requirements
|
| 122 |
+
- Use pure green: RGB(0, 255, 0) or #00FF00
|
| 123 |
+
- Border can be any thickness (5%-25% of image dimension works well)
|
| 124 |
+
- Each side can have different border widths
|
| 125 |
+
|
| 126 |
+
---
|
| 127 |
+
|
| 128 |
+
## 💻 Usage
|
| 129 |
+
|
| 130 |
+
### Try it Live on fal.ai
|
| 131 |
+
|
| 132 |
+
▶️ **[Open Playground](https://fal.ai/models/fal-ai/flux-2-klein/4b/base/edit/lora?share=528658ce-ed9c-46be-8e2b-815fbc4d14a6)**
|
| 133 |
+
|
| 134 |
+
### With fal.ai SDK
|
| 135 |
+
```python
|
| 136 |
+
import fal_client
|
| 137 |
+
|
| 138 |
+
def on_queue_update(update):
|
| 139 |
+
if isinstance(update, fal_client.InProgress):
|
| 140 |
+
for log in update.logs:
|
| 141 |
+
print(log["message"])
|
| 142 |
+
|
| 143 |
+
result = fal_client.subscribe(
|
| 144 |
+
"fal-ai/flux-2/klein/4b/base/edit/lora",
|
| 145 |
+
arguments={
|
| 146 |
+
"prompt": "Fill the green spaces according to the image",
|
| 147 |
+
"model_name": None,
|
| 148 |
+
"loras": [{
|
| 149 |
+
"path": "https://huggingface.co/fal/flux-2-klein-4B-outpaint-lora/resolve/main/flux-outpaint-lora.safetensors",
|
| 150 |
+
"scale": 1.1
|
| 151 |
+
}],
|
| 152 |
+
"embeddings": [],
|
| 153 |
+
"image_urls": ["https://your-image-with-green-border.png"]
|
| 154 |
+
},
|
| 155 |
+
with_logs=True,
|
| 156 |
+
on_queue_update=on_queue_update,
|
| 157 |
+
)
|
| 158 |
+
print(result)
|
| 159 |
+
```
|
| 160 |
+
|
| 161 |
+
---
|
| 162 |
+
|
| 163 |
+
## 📦 Model Files
|
| 164 |
+
|
| 165 |
+
| File | Use Case |
|
| 166 |
+
|------|----------|
|
| 167 |
+
| `flux-outpaint-lora.safetensors` | fal.ai |
|
| 168 |
+
| `LyNiaZ53Tudg0J6sT8Xbx_pytorch_lora_weights_comfy_converted.safetensors` | ComfyUI |
|
| 169 |
+
|
| 170 |
+
---
|
| 171 |
+
|
| 172 |
+
## 🎓 Training Details
|
| 173 |
+
|
| 174 |
+
<details>
|
| 175 |
+
<summary>Click to expand</summary>
|
| 176 |
+
|
| 177 |
+
### Dataset
|
| 178 |
+
- **Size**: 1000 image pairs
|
| 179 |
+
- **Content**: Diverse subjects including:
|
| 180 |
+
- **Landscapes**: mountains, beaches, forests, deserts, cities
|
| 181 |
+
- **People**: portraits, groups, activities
|
| 182 |
+
- **Animals**: pets, wildlife, birds
|
| 183 |
+
- **Food**: dishes, ingredients, table settings
|
| 184 |
+
- **Architecture**: buildings, interiors, landmarks
|
| 185 |
+
- **Art styles**: paintings, illustrations, abstract
|
| 186 |
+
- **Objects**: vehicles, electronics, furniture
|
| 187 |
+
- **Nature**: weather, space, underwater
|
| 188 |
+
- **Border variation**: Random green borders (5%-25% of each side)
|
| 189 |
+
- **Aspect ratios**: Various (1:1, 16:9, 9:16, 4:3, 3:4, etc.)
|
| 190 |
+
|
| 191 |
+
### Training
|
| 192 |
+
- **Base Model**: FLUX.2-Klein 4B
|
| 193 |
+
- **Platform**: [fal.ai](https://fal.ai)
|
| 194 |
+
- **Method**: LoRA training
|
| 195 |
+
|
| 196 |
+
</details>
|
| 197 |
+
|
| 198 |
+
---
|
| 199 |
+
|
| 200 |
+
## 🎮 Use Cases
|
| 201 |
+
|
| 202 |
+
- **Photo Extension**: Expand cropped photos to wider compositions
|
| 203 |
+
- **Background Generation**: Create seamless backgrounds for subjects
|
| 204 |
+
- **Aspect Ratio Conversion**: Convert portrait to landscape or vice versa
|
| 205 |
+
- **Creative Composition**: Add environmental context to isolated subjects
|
| 206 |
+
|
| 207 |
+
---
|
| 208 |
+
|
| 209 |
+
## ⚠️ Limitations
|
| 210 |
+
|
| 211 |
+
- Works best with pure green (#00FF00) borders
|
| 212 |
+
- Complex scenes may require multiple passes
|
| 213 |
+
- Very large border areas may produce less coherent results
|
| 214 |
+
|
| 215 |
+
---
|
| 216 |
+
|
| 217 |
+
## 📄 License
|
| 218 |
+
|
| 219 |
+
[Apache 2.0](https://opensource.org/licenses/Apache-2.0)
|
| 220 |
+
|
| 221 |
+
---
|
| 222 |
+
|
| 223 |
+
<div align="center">
|
| 224 |
+
|
| 225 |
+
### Created by [@ilkerzgi](https://huggingface.co/ilkerzgi) • Trained with [fal.ai](https://fal.ai)
|
| 226 |
+
|
| 227 |
+
|
| 228 |
+
[](https://fal.ai/models/fal-ai/flux-2/klein/4b/base/edit/lora/)
|
| 229 |
+
|
| 230 |
+
</div>
|
examples/example1_input.jpg
ADDED
|
Git LFS Details
|
examples/example1_output.jpg
ADDED
|
Git LFS Details
|
examples/example2_input.jpg
ADDED
|
Git LFS Details
|
examples/example2_output.jpg
ADDED
|
Git LFS Details
|
examples/example3_input.jpg
ADDED
|
Git LFS Details
|
examples/example3_output.jpg
ADDED
|
Git LFS Details
|
examples/example4_input.jpg
ADDED
|
Git LFS Details
|
examples/example4_output.jpg
ADDED
|
Git LFS Details
|
flux-outpaint-lora.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9623927f2471613e0c9d7810da3c39f0b277a448193b223ea3cee67d5750974a
|
| 3 |
+
size 76039072
|
images/banner.jpg
ADDED
|
Git LFS Details
|
images/example_input.jpg
ADDED
|
Git LFS Details
|
images/example_output.jpg
ADDED
|
Git LFS Details
|