Spaces:
Running
Running
yizhangliu
commited on
Commit
•
9400c80
1
Parent(s):
e9e2ff1
Update app.py
Browse files
app.py
CHANGED
@@ -229,9 +229,9 @@ def model_process(input): #image, mask):
|
|
229 |
original_shape = image.shape
|
230 |
interpolation = cv2.INTER_CUBIC
|
231 |
|
232 |
-
form = request.form
|
233 |
-
print(f'size_limit_1_ = ', form["sizeLimit"], type(input["image"]))
|
234 |
-
size_limit
|
235 |
print(f'size_limit_2_ = {size_limit}')
|
236 |
if size_limit == "Original":
|
237 |
size_limit = max(image.shape)
|
@@ -240,29 +240,29 @@ def model_process(input): #image, mask):
|
|
240 |
print(f'size_limit_3_ = {size_limit}')
|
241 |
|
242 |
config = Config(
|
243 |
-
ldm_steps=
|
244 |
-
ldm_sampler=
|
245 |
-
|
246 |
-
|
247 |
-
hd_strategy_crop_margin=
|
248 |
-
hd_strategy_crop_trigger_size=
|
249 |
-
hd_strategy_resize_limit=
|
250 |
-
prompt=
|
251 |
-
use_croper=
|
252 |
-
croper_x=
|
253 |
-
croper_y=
|
254 |
-
croper_height=
|
255 |
-
croper_width=
|
256 |
-
sd_mask_blur=
|
257 |
-
sd_strength=
|
258 |
-
sd_steps=
|
259 |
-
sd_guidance_scale=
|
260 |
-
sd_sampler=
|
261 |
-
sd_seed=
|
262 |
-
cv2_flag=
|
263 |
-
cv2_radius=
|
264 |
)
|
265 |
-
|
266 |
print(f'config/alpha_channel/size_limit = {config} / {alpha_channel} / {size_limit}')
|
267 |
if config.sd_seed == -1:
|
268 |
config.sd_seed = random.randint(1, 999999999)
|
|
|
229 |
original_shape = image.shape
|
230 |
interpolation = cv2.INTER_CUBIC
|
231 |
|
232 |
+
# form = request.form
|
233 |
+
# print(f'size_limit_1_ = ', form["sizeLimit"], type(input["image"]))
|
234 |
+
size_limit = "Original" #: Union[int, str] = form.get("sizeLimit", "1080")
|
235 |
print(f'size_limit_2_ = {size_limit}')
|
236 |
if size_limit == "Original":
|
237 |
size_limit = max(image.shape)
|
|
|
240 |
print(f'size_limit_3_ = {size_limit}')
|
241 |
|
242 |
config = Config(
|
243 |
+
ldm_steps=25,
|
244 |
+
ldm_sampler='plms',
|
245 |
+
zits_wireframe=True,
|
246 |
+
hd_strategy='Original',
|
247 |
+
hd_strategy_crop_margin=196,
|
248 |
+
hd_strategy_crop_trigger_size=1280,
|
249 |
+
hd_strategy_resize_limit=2048,
|
250 |
+
prompt='',
|
251 |
+
use_croper=False,
|
252 |
+
croper_x=0,
|
253 |
+
croper_y=0,
|
254 |
+
croper_height=512,
|
255 |
+
croper_width=512,
|
256 |
+
sd_mask_blur=5,
|
257 |
+
sd_strength=0.75,
|
258 |
+
sd_steps=50,
|
259 |
+
sd_guidance_scale=7.5,
|
260 |
+
sd_sampler='ddim',
|
261 |
+
sd_seed=42,
|
262 |
+
cv2_flag='INPAINT_NS',
|
263 |
+
cv2_radius=5,
|
264 |
)
|
265 |
+
|
266 |
print(f'config/alpha_channel/size_limit = {config} / {alpha_channel} / {size_limit}')
|
267 |
if config.sd_seed == -1:
|
268 |
config.sd_seed = random.randint(1, 999999999)
|