WildanJR commited on
Commit
ded857c
·
verified ·
1 Parent(s): 72268ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -13
app.py CHANGED
@@ -62,20 +62,17 @@ This model has been trained on a carefully selected dataset, which includes: gen
62
  ''')
63
  with gr.Row():
64
  with gr.Column():
65
- input_image = gr.Image(sources='upload', type="pil", label="Upload", elem_id="image_upload", height=600)
66
- prompt = gr.Textbox(label="Prompt for Background")
67
- run_button = gr.Button(value="Generate Background")
68
-
69
- with gr.Column():
70
- result_gallery = gr.Image(label='Output', type="pil", show_label=True, elem_id="output-img")
71
-
72
- # Define default values for hidden parameters
73
- negative_prompt = "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"
74
- num_steps = 30
75
- controlnet_conditioning_scale = 1.0
76
- seed = 309005275 # None for random seed, or specify a fixed integer
77
 
78
-
 
 
79
  # result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery", columns=[1], height=600)
80
  ips = [input_image, prompt, negative_prompt, num_steps, controlnet_conditioning_scale, seed]
81
  run_button.click(fn=process, inputs=ips, outputs=[result_gallery])
 
62
  ''')
63
  with gr.Row():
64
  with gr.Column():
65
+ input_image = gr.Image(sources='upload', type="pil", label="Upload", elem_id="image_upload", height=600) # None for upload, ctrl+v and webcam
66
+ prompt = gr.Textbox(label="Prompt")
67
+ negative_prompt = gr.Textbox(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")
68
+ num_steps = gr.Slider(label="Number of steps", minimum=10, maximum=100, value=30, step=1)
69
+ controlnet_conditioning_scale = gr.Slider(label="ControlNet conditioning scale", minimum=0.1, maximum=2.0, value=1.0, step=0.05)
70
+ seed = gr.Slider(label="Seed", minimum=0, maximum=2147483647, step=1, randomize=True,)
71
+ run_button = gr.Button(value="Generate")
 
 
 
 
 
72
 
73
+
74
+ with gr.Column():
75
+ result_gallery = gr.Image(label='Output', type="pil", show_label=True, elem_id="output-img")
76
  # result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery", columns=[1], height=600)
77
  ips = [input_image, prompt, negative_prompt, num_steps, controlnet_conditioning_scale, seed]
78
  run_button.click(fn=process, inputs=ips, outputs=[result_gallery])