ilkerzgi commited on
Commit
d05aa1b
·
verified ·
1 Parent(s): a928c74

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,11 @@ saved_model/**/* 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
 
 
 
 
 
 
 
 
 
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/example3_input.jpg filter=lfs diff=lfs merge=lfs -text
40
+ examples/example4_input.jpg filter=lfs diff=lfs merge=lfs -text
41
+ images/banner.jpg filter=lfs diff=lfs merge=lfs -text
42
+ images/example_input.jpg filter=lfs diff=lfs merge=lfs -text
43
+ images/example_output.jpg filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,3 +1,222 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ tags:
6
+ - flux
7
+ - flux-2-klein
8
+ - flux-lora
9
+ - lora
10
+ - background-removal
11
+ - subject-isolation
12
+ - image-editing
13
+ - image-to-image
14
+ - fal-ai
15
+ - template:diffusion-lora
16
+ pipeline_tag: image-to-image
17
+ widget:
18
+ - text: Remove the background from the image
19
+ output:
20
+ url: examples/example1_output.jpg
21
+ - src: examples/example1_input.jpg
22
+ prompt: Remove the background from the image
23
+ output:
24
+ url: examples/example1_output.jpg
25
+ - text: Remove the background from the image
26
+ output:
27
+ url: examples/example2_output.jpg
28
+ - src: examples/example2_input.jpg
29
+ prompt: Remove the background from the image
30
+ output:
31
+ url: examples/example2_output.jpg
32
+ - text: Remove the background from the image
33
+ output:
34
+ url: examples/example3_output.jpg
35
+ - src: examples/example3_input.jpg
36
+ prompt: Remove the background from the image
37
+ output:
38
+ url: examples/example3_output.jpg
39
+ - text: Remove the background from the image
40
+ output:
41
+ url: examples/example4_output.jpg
42
+ - src: examples/example4_input.jpg
43
+ prompt: Remove the background from the image
44
+ output:
45
+ url: examples/example4_output.jpg
46
+ base_model: black-forest-labs/FLUX.2-klein-4B
47
+ instance_prompt: Remove the background from the image
48
+ ---
49
+
50
+ <Gallery />
51
+
52
+ <div align="center">
53
+
54
+ # ✂️ Flux Background Remove LoRA
55
+
56
+ ### Remove backgrounds and isolate subjects with AI
57
+
58
+ [![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)
59
+ [![License](https://img.shields.io/badge/License-Apache_2.0-green?style=for-the-badge)](https://opensource.org/licenses/Apache-2.0)
60
+
61
+ <img src="images/banner.jpg" alt="Background Remove LoRA Banner" width="100%">
62
+
63
+ </div>
64
+
65
+ ---
66
+
67
+ ## 🎯 What does this model do?
68
+
69
+ This LoRA removes the **background** from images and isolates the main subject. Simply provide an image, and the model will extract the subject with a clean background removal.
70
+
71
+ ```
72
+ ┌─────────────────────────────────────┐
73
+ │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │
74
+ │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ Background
75
+ │ ░░░░░░░░░ [Subject] ░░░░░░░░░░░░░ │ gets removed
76
+ │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ cleanly
77
+ │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │
78
+ └─────────────────────────────────────┘
79
+ ```
80
+
81
+ Perfect for **product photography**, **subject isolation**, and **creative compositions**.
82
+
83
+ ---
84
+
85
+ ## 🖼️ Examples
86
+
87
+ <table>
88
+ <tr>
89
+ <th>Input</th>
90
+ <th>Output (background removed)</th>
91
+ </tr>
92
+ <tr>
93
+ <td><img src="examples/example1_input.jpg" width="300"></td>
94
+ <td><img src="examples/example1_output.jpg" width="300"></td>
95
+ </tr>
96
+ <tr>
97
+ <td><img src="examples/example2_input.jpg" width="300"></td>
98
+ <td><img src="examples/example2_output.jpg" width="300"></td>
99
+ </tr>
100
+ <tr>
101
+ <td><img src="examples/example3_input.jpg" width="300"></td>
102
+ <td><img src="examples/example3_output.jpg" width="300"></td>
103
+ </tr>
104
+ <tr>
105
+ <td><img src="examples/example4_input.jpg" width="300"></td>
106
+ <td><img src="examples/example4_output.jpg" width="300"></td>
107
+ </tr>
108
+ </table>
109
+
110
+ ---
111
+
112
+ ## 🚀 Quick Start
113
+
114
+ ### Prompt
115
+
116
+ ```
117
+ Remove the background from the image
118
+ ```
119
+
120
+ ---
121
+
122
+ ## 💻 Usage
123
+
124
+ ### Try it Live on fal.ai
125
+
126
+ ▶️ **[Open Playground](https://fal.ai/models/fal-ai/flux-2/klein/4b/base/edit/lora)**
127
+
128
+ ### With fal.ai SDK
129
+
130
+ ```python
131
+ import fal_client
132
+
133
+ def on_queue_update(update):
134
+ if isinstance(update, fal_client.InProgress):
135
+ for log in update.logs:
136
+ print(log["message"])
137
+
138
+ result = fal_client.subscribe(
139
+ "fal-ai/flux-2/klein/4b/base/edit/lora",
140
+ arguments={
141
+ "prompt": "Remove the background from the image",
142
+ "model_name": None,
143
+ "loras": [{
144
+ "path": "https://huggingface.co/ilkerzgi/flux-background-remove-lora/resolve/main/flux-background-remove-lora.safetensors",
145
+ "scale": 1.1
146
+ }],
147
+ "embeddings": [],
148
+ "image_urls": ["https://your-image.png"]
149
+ },
150
+ with_logs=True,
151
+ on_queue_update=on_queue_update,
152
+ )
153
+ print(result)
154
+ ```
155
+
156
+ ---
157
+
158
+ ## 📦 Model Files
159
+
160
+ | File | Use Case |
161
+ |------|----------|
162
+ | `flux-background-remove-lora.safetensors` | fal.ai |
163
+
164
+ ---
165
+
166
+ ## 🎓 Training Details
167
+
168
+ <details>
169
+ <summary>Click to expand</summary>
170
+
171
+ ### Dataset
172
+ - **Size**: 100 image pairs
173
+ - **Content**: Diverse subjects with background removal including:
174
+ - **People**: portraits, full body shots
175
+ - **Products**: electronics, furniture, accessories
176
+ - **Animals**: pets, wildlife
177
+ - **Objects**: vehicles, art pieces, everyday items
178
+ - **Output**: Clean subject isolation
179
+ - **Aspect ratios**: Various (1:1, 16:9, 9:16, 4:3, 3:4, etc.)
180
+
181
+ ### Training
182
+ - **Base Model**: FLUX.2-Klein 4B
183
+ - **Platform**: [fal.ai](https://fal.ai)
184
+ - **Method**: LoRA training
185
+ - **Steps**: 4000
186
+ - **Learning Rate**: 0.00005
187
+
188
+ </details>
189
+
190
+ ---
191
+
192
+ ## 🎮 Use Cases
193
+
194
+ - **Product Photography**: Isolate products for e-commerce listings
195
+ - **Portrait Editing**: Remove backgrounds from portraits
196
+ - **Creative Compositing**: Extract subjects for new compositions
197
+ - **Marketing Materials**: Create clean cutouts for designs
198
+
199
+ ---
200
+
201
+ ## ⚠️ Limitations
202
+
203
+ - Works best with clear subject-background separation
204
+ - Complex subjects with fine details (hair, fur) may have artifacts at edges
205
+ - Semi-transparent objects may not be perfectly isolated
206
+
207
+ ---
208
+
209
+ ## 📄 License
210
+
211
+ [Apache 2.0](https://opensource.org/licenses/Apache-2.0)
212
+
213
+ ---
214
+
215
+ <div align="center">
216
+
217
+ ### Created by [@ilkerzgi](https://huggingface.co/ilkerzgi) • Trained with [fal.ai](https://fal.ai)
218
+
219
+
220
+ [![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)
221
+
222
+ </div>
examples/example1_input.jpg ADDED

Git LFS Details

  • SHA256: 59ea5befa814cedecb6a0c44426b55f205f76825581af1013ad82926da231ff5
  • Pointer size: 131 Bytes
  • Size of remote file: 292 kB
examples/example1_output.jpg ADDED

Git LFS Details

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

Git LFS Details

  • SHA256: e426f374375055e59ed3a280b5dc446500895516d7eddfa160893934c5abc0e5
  • Pointer size: 131 Bytes
  • Size of remote file: 241 kB
examples/example2_output.jpg ADDED
examples/example3_input.jpg ADDED

Git LFS Details

  • SHA256: 623724ff1862e1ac6e8b40eec660015ab437b97a25e993bd9b74f8777d7f4862
  • Pointer size: 131 Bytes
  • Size of remote file: 232 kB
examples/example3_output.jpg ADDED
examples/example4_input.jpg ADDED

Git LFS Details

  • SHA256: 1ec82a71ad7204f2e632df9cd038d4ef58465b15a327fdec51f300444e8834fd
  • Pointer size: 131 Bytes
  • Size of remote file: 187 kB
examples/example4_output.jpg ADDED
flux-background-remove-lora.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:79d8cd4a5ea67c196b173aeb7c751bcfffc79823993b2a033107d4a8db68bcea
3
+ size 76039072
images/banner.jpg ADDED

Git LFS Details

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

Git LFS Details

  • SHA256: 59ea5befa814cedecb6a0c44426b55f205f76825581af1013ad82926da231ff5
  • Pointer size: 131 Bytes
  • Size of remote file: 292 kB
images/example_output.jpg ADDED

Git LFS Details

  • SHA256: b79cde0bbf2bc2c450ab462325a431f437f95af667a12e3ba47bce784ae35fe0
  • Pointer size: 131 Bytes
  • Size of remote file: 142 kB