Ming3D ilkerzgi commited on
Commit
c0c6e97
·
0 Parent(s):

Duplicate from fal/flux-2-klein-4B-outpaint-lora

Browse files

Co-authored-by: ilkerizgi <ilkerzgi@users.noreply.huggingface.co>

.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 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ tags:
6
+ - flux
7
+ - flux-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
+ [![Try on fal.ai](https://img.shields.io/badge/🚀_Try_it_Live-fal.ai-FF6B35?style=for-the-badge)](https://fal.ai/models/fal-ai/flux-2/klein/4b/base/edit/lora)
60
+ [![License](https://img.shields.io/badge/License-Apache_2.0-green?style=for-the-badge)](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
+ [![Try on fal.ai](https://img.shields.io/badge/🚀_Try_it_Live-fal.ai-FF6B35?style=for-the-badge)](https://fal.ai/models/fal-ai/flux-2/klein/4b/base/edit/lora/)
229
+
230
+ </div>
examples/example1_input.jpg ADDED

Git LFS Details

  • SHA256: 263a2902d9cd5c00c3e03c2bd28ffd5876fb5e531c4cdd3a8ec764d53d923930
  • Pointer size: 131 Bytes
  • Size of remote file: 224 kB
examples/example1_output.jpg ADDED

Git LFS Details

  • SHA256: d70ff2cfac028f61777d640eb9f3074a37ce1b4e9153e74d5a6b558d54789021
  • Pointer size: 131 Bytes
  • Size of remote file: 458 kB
examples/example2_input.jpg ADDED

Git LFS Details

  • SHA256: 02f02c17d8dd27fc8aa6d73f60da746fb2224327af6e7fd665f5817103483996
  • Pointer size: 131 Bytes
  • Size of remote file: 193 kB
examples/example2_output.jpg ADDED

Git LFS Details

  • SHA256: 85d216e0c0a4929b3e8044afedabffc4534084886f6aae6948ccb151cfba8582
  • Pointer size: 131 Bytes
  • Size of remote file: 304 kB
examples/example3_input.jpg ADDED

Git LFS Details

  • SHA256: 4b1acb8993c1086330d98a3d08741f9f2a6ccba67a89b40c6def66c93d7cc590
  • Pointer size: 131 Bytes
  • Size of remote file: 248 kB
examples/example3_output.jpg ADDED

Git LFS Details

  • SHA256: f503220820fe5c21f1a621b7f32748b5ead398319e1dfb67b2e4e59bfb066788
  • Pointer size: 131 Bytes
  • Size of remote file: 340 kB
examples/example4_input.jpg ADDED

Git LFS Details

  • SHA256: a1a4f597656ebd004005d6e109bb77176eb00b41657b3f38042da7785a8ac783
  • Pointer size: 131 Bytes
  • Size of remote file: 253 kB
examples/example4_output.jpg ADDED

Git LFS Details

  • SHA256: 54d4e6a4a83f0a5aa9fbdd9a6dbfa36542bffd2a76110e127158f3e50c6a33ef
  • Pointer size: 131 Bytes
  • Size of remote file: 296 kB
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

  • SHA256: d70ff2cfac028f61777d640eb9f3074a37ce1b4e9153e74d5a6b558d54789021
  • Pointer size: 131 Bytes
  • Size of remote file: 458 kB
images/example_input.jpg ADDED

Git LFS Details

  • SHA256: 263a2902d9cd5c00c3e03c2bd28ffd5876fb5e531c4cdd3a8ec764d53d923930
  • Pointer size: 131 Bytes
  • Size of remote file: 224 kB
images/example_output.jpg ADDED

Git LFS Details

  • SHA256: d70ff2cfac028f61777d640eb9f3074a37ce1b4e9153e74d5a6b558d54789021
  • Pointer size: 131 Bytes
  • Size of remote file: 458 kB