slower fix
Browse files
app.py
CHANGED
@@ -30,7 +30,6 @@ pipe = FluxFillPipeline.from_pretrained(
|
|
30 |
"black-forest-labs/FLUX.1-Fill-dev", torch_dtype=torch.bfloat16
|
31 |
).to("cuda")
|
32 |
|
33 |
-
simple_lama = SimpleLama()
|
34 |
|
35 |
def prepare_image_and_mask(
|
36 |
image,
|
@@ -149,11 +148,14 @@ def mask_generation(image=None, d=None):
|
|
149 |
|
150 |
return out
|
151 |
|
152 |
-
|
|
|
|
|
153 |
image = load_img(image)
|
154 |
mask = load_img(mask).convert("L")
|
155 |
return simple_lama(image, mask)
|
156 |
|
|
|
157 |
@spaces.GPU
|
158 |
def main(*args):
|
159 |
api_num = args[0]
|
@@ -166,7 +168,7 @@ def main(*args):
|
|
166 |
return inpaint(*args)
|
167 |
elif api_num == 4:
|
168 |
return mask_generation(*args)
|
169 |
-
elif api_num == 5
|
170 |
return erase(*args)
|
171 |
|
172 |
|
|
|
30 |
"black-forest-labs/FLUX.1-Fill-dev", torch_dtype=torch.bfloat16
|
31 |
).to("cuda")
|
32 |
|
|
|
33 |
|
34 |
def prepare_image_and_mask(
|
35 |
image,
|
|
|
148 |
|
149 |
return out
|
150 |
|
151 |
+
|
152 |
+
def erase(image=None, mask=None):
|
153 |
+
simple_lama = SimpleLama()
|
154 |
image = load_img(image)
|
155 |
mask = load_img(mask).convert("L")
|
156 |
return simple_lama(image, mask)
|
157 |
|
158 |
+
|
159 |
@spaces.GPU
|
160 |
def main(*args):
|
161 |
api_num = args[0]
|
|
|
168 |
return inpaint(*args)
|
169 |
elif api_num == 4:
|
170 |
return mask_generation(*args)
|
171 |
+
elif api_num == 5:
|
172 |
return erase(*args)
|
173 |
|
174 |
|