cocktailpeanut commited on
Commit
1b6dbf0
1 Parent(s): 76e1dc2
Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -86,7 +86,8 @@ def process(input_image,
86
  seed,
87
  randomize_seed,
88
  guidance_scale,
89
- num_inference_steps):
 
90
  if original_image is None:
91
  raise gr.Error('Please upload the input image')
92
  if (original_mask is None or len(selected_points)==0) and input_mask is None:
@@ -116,14 +117,14 @@ def process(input_image,
116
  generator = torch.Generator(DEVICE).manual_seed(random.randint(0,2147483647) if randomize_seed else seed)
117
 
118
  image = pipe(
119
- [prompt]*2,
120
  init_image,
121
  mask_image,
122
  num_inference_steps=num_inference_steps,
123
  guidance_scale=guidance_scale,
124
  generator=generator,
125
  brushnet_conditioning_scale=float(control_strength),
126
- negative_prompt=[negative_prompt]*2,
127
  ).images
128
 
129
  if blended:
@@ -196,6 +197,13 @@ with block:
196
  placeholder="Please input your negative prompt",
197
  value='ugly, low quality',lines=1
198
  )
 
 
 
 
 
 
 
199
  with gr.Group():
200
  with gr.Row():
201
  blending = gr.Checkbox(label="Blurred Blending", value=False)
@@ -339,7 +347,7 @@ with block:
339
  [input_image, original_mask]
340
  )
341
 
342
- ips=[input_image, original_image, original_mask, input_mask, selected_points, prompt, negative_prompt, blending, invert_mask, control_strength, seed, randomize_seed, guidance_scale, num_inference_steps]
343
  run_button.click(fn=process, inputs=ips, outputs=[result_gallery])
344
 
345
 
 
86
  seed,
87
  randomize_seed,
88
  guidance_scale,
89
+ num_inference_steps,
90
+ count):
91
  if original_image is None:
92
  raise gr.Error('Please upload the input image')
93
  if (original_mask is None or len(selected_points)==0) and input_mask is None:
 
117
  generator = torch.Generator(DEVICE).manual_seed(random.randint(0,2147483647) if randomize_seed else seed)
118
 
119
  image = pipe(
120
+ [prompt]*count,
121
  init_image,
122
  mask_image,
123
  num_inference_steps=num_inference_steps,
124
  guidance_scale=guidance_scale,
125
  generator=generator,
126
  brushnet_conditioning_scale=float(control_strength),
127
+ negative_prompt=[negative_prompt]*count,
128
  ).images
129
 
130
  if blended:
 
197
  placeholder="Please input your negative prompt",
198
  value='ugly, low quality',lines=1
199
  )
200
+ count = gr.Number(
201
+ label="Number of Images",
202
+ minimun=1,
203
+ value=2,
204
+ precision=0,
205
+ step=1
206
+ )
207
  with gr.Group():
208
  with gr.Row():
209
  blending = gr.Checkbox(label="Blurred Blending", value=False)
 
347
  [input_image, original_mask]
348
  )
349
 
350
+ ips=[input_image, original_image, original_mask, input_mask, selected_points, prompt, negative_prompt, blending, invert_mask, control_strength, seed, randomize_seed, guidance_scale, num_inference_steps, count]
351
  run_button.click(fn=process, inputs=ips, outputs=[result_gallery])
352
 
353