RamAnanth1 commited on
Commit
d2677d3
1 Parent(s): aff3d3b

Create gradio_pose.py

Browse files
Files changed (1) hide show
  1. gradio_pose.py +23 -0
gradio_pose.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def create_demo(process):
4
+ block = gr.Blocks().queue()
5
+ with block:
6
+ with gr.Row():
7
+ with gr.Column():
8
+ input_img = gr.Image(source='upload', type="numpy")
9
+ prompt = gr.Textbox(label="Prompt")
10
+ neg_prompt = gr.Textbox(label="Negative Prompt",
11
+ value='ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, deformed, body out of frame, bad anatomy, watermark, signature, cut off, low contrast, underexposed, overexposed, bad art, beginner, amateur, distorted face')
12
+ run_button = gr.Button(label="Run")
13
+ with gr.Accordion("Advanced options", open=False):
14
+ con_strength = gr.Slider(label="Controling Strength (The guidance strength of the sketch to the result)", minimum=0, maximum=1, value=0.4, step=0.1)
15
+ scale = gr.Slider(label="Guidance Scale (Classifier free guidance)", minimum=0.1, maximum=30.0, value=7.5, step=0.1)
16
+ fix_sample = gr.inputs.Radio(['True', 'False'], type="value", default='False', label='Fix Sampling\n (Fix the random seed)')
17
+ base_model = gr.inputs.Radio(['sd-v1-4.ckpt', 'anything-v4.0-pruned.ckpt'], type="value", default='sd-v1-4.ckpt', label='The base model you want to use')
18
+ with gr.Column():
19
+ result = gr.Gallery(label='Output', show_label=False, elem_id="gallery").style(grid=2, height='auto')
20
+ ips = [input_img,prompt, neg_prompt, fix_sample, scale, con_strength, base_model]
21
+ run_button.click(fn=process, inputs=ips, outputs=[result])
22
+
23
+ return block