ironjr commited on
Commit
a65a019
1 Parent(s): 3dd5d26

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -82,7 +82,7 @@ parser.add_argument('-H', '--height', type=int, default=768)
82
  parser.add_argument('-W', '--width', type=int, default=768)
83
  parser.add_argument('--model', type=str, default=None, help='Hugging face model repository or local path for a SD1.5 model checkpoint to run.')
84
  parser.add_argument('--bootstrap_steps', type=int, default=1)
85
- parser.add_argument('--bootstrap_mix_steps', type=int, default=0)
86
  parser.add_argument('--guidance_scale', type=float, default=1.0) # 1.2
87
  parser.add_argument('--run_time', type=float, default=60)
88
  parser.add_argument('--seed', type=int, default=-1)
@@ -132,7 +132,7 @@ prompt_suggestions = [
132
  opt.max_palettes = 3
133
  opt.default_prompt_strength = 1.0
134
  opt.default_mask_strength = 1.0
135
- opt.default_mask_std = 0.0
136
  opt.default_negative_prompt = (
137
  'nsfw, worst quality, bad quality, normal quality, cropped, framed'
138
  )
@@ -336,6 +336,9 @@ def register(state, drawpad, model):
336
  inpainting_mode = np.asarray(background).sum() != 0
337
  if not inpainting_mode:
338
  background = Image.new(size=(opt.width, opt.height), mode='RGB', color=(255, 255, 255))
 
 
 
339
  print('Inpainting mode: ', inpainting_mode)
340
 
341
  user_input = np.asarray(drawpad['layers'][0]) # (H, W, 4)
@@ -372,7 +375,7 @@ def register(state, drawpad, model):
372
 
373
  model.update_background(
374
  background.convert('RGB'),
375
- prompt=None,
376
  negative_prompt=None,
377
  )
378
  state.prompts[0] = model.background.prompt
 
82
  parser.add_argument('-W', '--width', type=int, default=768)
83
  parser.add_argument('--model', type=str, default=None, help='Hugging face model repository or local path for a SD1.5 model checkpoint to run.')
84
  parser.add_argument('--bootstrap_steps', type=int, default=1)
85
+ parser.add_argument('--bootstrap_mix_steps', type=int, default=1)
86
  parser.add_argument('--guidance_scale', type=float, default=1.0) # 1.2
87
  parser.add_argument('--run_time', type=float, default=60)
88
  parser.add_argument('--seed', type=int, default=-1)
 
132
  opt.max_palettes = 3
133
  opt.default_prompt_strength = 1.0
134
  opt.default_mask_strength = 1.0
135
+ opt.default_mask_std = 8.0
136
  opt.default_negative_prompt = (
137
  'nsfw, worst quality, bad quality, normal quality, cropped, framed'
138
  )
 
336
  inpainting_mode = np.asarray(background).sum() != 0
337
  if not inpainting_mode:
338
  background = Image.new(size=(opt.width, opt.height), mode='RGB', color=(255, 255, 255))
339
+ background_prompt = "Simple white background"
340
+ else:
341
+ background_prompt = None
342
  print('Inpainting mode: ', inpainting_mode)
343
 
344
  user_input = np.asarray(drawpad['layers'][0]) # (H, W, 4)
 
375
 
376
  model.update_background(
377
  background.convert('RGB'),
378
+ prompt=background_prompt,
379
  negative_prompt=None,
380
  )
381
  state.prompts[0] = model.background.prompt