geyongtao commited on
Commit
d777936
·
verified ·
1 Parent(s): e7c5601

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -73,7 +73,7 @@ def generate_(prompt, negative_prompt, normal_image, num_steps, controlnet_condi
73
  image=normal_image,
74
  num_inference_steps=num_steps,
75
  controlnet_conditioning_scale=float(controlnet_conditioning_scale),
76
- num_images_per_prompt=4,
77
  generator=generator,
78
  ).images
79
  return images
@@ -85,7 +85,7 @@ def process(normal_image, prompt, negative_prompt, num_steps, controlnet_conditi
85
  # depth_image = get_depth_map(input_image)
86
  images = generate_(prompt, negative_prompt, normal_image, num_steps, controlnet_conditioning_scale, seed)
87
 
88
- return [images[0], images[1], images[2], images[3]]
89
 
90
 
91
  def run_demo():
@@ -115,13 +115,13 @@ def run_demo():
115
 
116
  prompt = gr.Textbox(label="Prompt")
117
  negative_prompt = gr.Textbox(visible=False, label="Negative prompt", value="Logo,Watermark,Text,Ugly,Morbid,Extra fingers,Poorly drawn hands,Mutation,Blurry,Extra limbs,Gross proportions,Missing arms,Mutated hands,Long neck,Duplicate,Mutilated,Mutilated hands,Poorly drawn face,Deformed,Bad anatomy,Cloned face,Malformed limbs,Missing legs,Too many fingers")
118
- num_steps = gr.Slider(label="Number of steps", minimum=25, maximum=100, value=50, step=1)
119
  controlnet_conditioning_scale = gr.Slider(label="ControlNet conditioning scale", minimum=0.1, maximum=1.0, value=0.95, step=0.05)
120
  seed = gr.Slider(label="Seed", minimum=0, maximum=2147483647, step=1, randomize=True,)
121
  run_button = gr.Button(value="Run")
122
 
123
  with gr.Column():
124
- result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery", columns=[2], rows=[2], height='auto')
125
  ips = [input_image, prompt, negative_prompt, num_steps, controlnet_conditioning_scale, seed]
126
 
127
  run_button.click(fn=process, inputs=ips, outputs=[result_gallery])
 
73
  image=normal_image,
74
  num_inference_steps=num_steps,
75
  controlnet_conditioning_scale=float(controlnet_conditioning_scale),
76
+ num_images_per_prompt=2,
77
  generator=generator,
78
  ).images
79
  return images
 
85
  # depth_image = get_depth_map(input_image)
86
  images = generate_(prompt, negative_prompt, normal_image, num_steps, controlnet_conditioning_scale, seed)
87
 
88
+ return [images[0], images[1]]
89
 
90
 
91
  def run_demo():
 
115
 
116
  prompt = gr.Textbox(label="Prompt")
117
  negative_prompt = gr.Textbox(visible=False, label="Negative prompt", value="Logo,Watermark,Text,Ugly,Morbid,Extra fingers,Poorly drawn hands,Mutation,Blurry,Extra limbs,Gross proportions,Missing arms,Mutated hands,Long neck,Duplicate,Mutilated,Mutilated hands,Poorly drawn face,Deformed,Bad anatomy,Cloned face,Malformed limbs,Missing legs,Too many fingers")
118
+ num_steps = gr.Slider(label="Number of steps", minimum=25, maximum=50, value=30, step=1)
119
  controlnet_conditioning_scale = gr.Slider(label="ControlNet conditioning scale", minimum=0.1, maximum=1.0, value=0.95, step=0.05)
120
  seed = gr.Slider(label="Seed", minimum=0, maximum=2147483647, step=1, randomize=True,)
121
  run_button = gr.Button(value="Run")
122
 
123
  with gr.Column():
124
+ result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery", columns=[2], height='auto')
125
  ips = [input_image, prompt, negative_prompt, num_steps, controlnet_conditioning_scale, seed]
126
 
127
  run_button.click(fn=process, inputs=ips, outputs=[result_gallery])