yizhangliu commited on
Commit
9400c80
1 Parent(s): e9e2ff1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -25
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: 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,29 +240,29 @@ def model_process(input): #image, mask):
240
  print(f'size_limit_3_ = {size_limit}')
241
 
242
  config = Config(
243
- ldm_steps=form["ldmSteps"],
244
- ldm_sampler=form["ldmSampler"],
245
- hd_strategy=form["hdStrategy"],
246
- zits_wireframe=form["zitsWireframe"],
247
- hd_strategy_crop_margin=form["hdStrategyCropMargin"],
248
- hd_strategy_crop_trigger_size=form["hdStrategyCropTrigerSize"],
249
- hd_strategy_resize_limit=form["hdStrategyResizeLimit"],
250
- prompt=form["prompt"],
251
- use_croper=form["useCroper"],
252
- croper_x=form["croperX"],
253
- croper_y=form["croperY"],
254
- croper_height=form["croperHeight"],
255
- croper_width=form["croperWidth"],
256
- sd_mask_blur=form["sdMaskBlur"],
257
- sd_strength=form["sdStrength"],
258
- sd_steps=form["sdSteps"],
259
- sd_guidance_scale=form["sdGuidanceScale"],
260
- sd_sampler=form["sdSampler"],
261
- sd_seed=form["sdSeed"],
262
- cv2_flag=form["cv2Flag"],
263
- cv2_radius=form['cv2Radius']
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)