2MaxM commited on
Commit
c56ad3c
1 Parent(s): c54371d

changes for demo

Browse files
Files changed (1) hide show
  1. app.py +24 -24
app.py CHANGED
@@ -25,31 +25,31 @@ theme = gr.themes.Soft(
25
 
26
  with gr.Blocks(theme=theme) as GenDemo:
27
  gen_image_var = gr.State()
28
- with gr.Tab("Image to Image Generator"):
29
- with gr.Row(variant="panel"):
30
- with gr.Column():
31
- prompt = gr.Textbox(label="Enter a discription of a shoe")
32
- image = gr.Image(label="Enter an image of a shoe, that you want to use as a reference", type='pil')
33
- strength = gr.Slider(label="Strength", minimum=0.1, maximum=1.0, value=0.5, step=0.1)
34
- gr.Examples(
35
- examples=[
36
- os.path.join("examples", img_name) for img_name in sorted(os.listdir("examples"))
37
- ],
38
- inputs=[image],
39
- label="Examples",
40
- cache_examples=False,
41
- )
42
- with gr.Column():
43
- button_img = gr.Button("Generate Image", elem_id="generateIm", variant="primary")
44
- gen_image = gr.Image(label="Generated Image", image_mode="RGBA", type='pil', show_download_button=True, show_label=False)
45
 
46
- button_img.click(check_prompt, inputs=[prompt]).success(generate_imgtoimg, inputs=[prompt, image, strength], outputs=[gen_image]).success(update_image, inputs=[gen_image], outputs=[gen_image_var])
47
 
48
  with gr.Tab("Text to Image Generator"):
49
  with gr.Row(variant="panel"):
50
  with gr.Column():
51
  prompt = gr.Textbox(label="Enter a discription of a shoe")
52
- select = gr.Dropdown(label="Select a model", choices=["Depth","Normal"])
53
  controlNet_image = gr.Image(label="Enter an image of a shoe, that you want to use as a reference", type='pil')
54
  gr.Examples(
55
  examples=[
@@ -114,16 +114,16 @@ with gr.Blocks(theme=theme) as GenDemo:
114
  )
115
 
116
  with gr.Row():
117
- with gr.Tab("glb"):
118
- output_model_glb = gr.Model3D(
119
- label="Output Model (GLB Format)",
120
- interactive=False,
121
- )
122
  with gr.Tab("obj"):
123
  output_model_obj = gr.Model3D(
124
  label="Output Model (OBJ Format)",
125
  interactive=False,
126
  )
 
 
 
 
 
127
 
128
  with gr.Row():
129
  gr.Markdown('''Try a different <b>seed value</b> if the result is unsatisfying (Default: 42).''')
 
25
 
26
  with gr.Blocks(theme=theme) as GenDemo:
27
  gen_image_var = gr.State()
28
+ # with gr.Tab("Image to Image Generator"):
29
+ # with gr.Row(variant="panel"):
30
+ # with gr.Column():
31
+ # prompt = gr.Textbox(label="Enter a discription of a shoe")
32
+ # image = gr.Image(label="Enter an image of a shoe, that you want to use as a reference", type='pil')
33
+ # strength = gr.Slider(label="Strength", minimum=0.1, maximum=1.0, value=0.5, step=0.1)
34
+ # gr.Examples(
35
+ # examples=[
36
+ # os.path.join("examples", img_name) for img_name in sorted(os.listdir("examples"))
37
+ # ],
38
+ # inputs=[image],
39
+ # label="Examples",
40
+ # cache_examples=False,
41
+ # )
42
+ # with gr.Column():
43
+ # button_img = gr.Button("Generate Image", elem_id="generateIm", variant="primary")
44
+ # gen_image = gr.Image(label="Generated Image", image_mode="RGBA", type='pil', show_download_button=True, show_label=False)
45
 
46
+ # button_img.click(check_prompt, inputs=[prompt]).success(generate_imgtoimg, inputs=[prompt, image, strength], outputs=[gen_image]).success(update_image, inputs=[gen_image], outputs=[gen_image_var])
47
 
48
  with gr.Tab("Text to Image Generator"):
49
  with gr.Row(variant="panel"):
50
  with gr.Column():
51
  prompt = gr.Textbox(label="Enter a discription of a shoe")
52
+ select = gr.Dropdown(label="Select a controlnet model", choices=["Depth","Normal"])
53
  controlNet_image = gr.Image(label="Enter an image of a shoe, that you want to use as a reference", type='pil')
54
  gr.Examples(
55
  examples=[
 
114
  )
115
 
116
  with gr.Row():
 
 
 
 
 
117
  with gr.Tab("obj"):
118
  output_model_obj = gr.Model3D(
119
  label="Output Model (OBJ Format)",
120
  interactive=False,
121
  )
122
+ with gr.Tab("glb"):
123
+ output_model_glb = gr.Model3D(
124
+ label="Output Model (GLB Format)",
125
+ interactive=False,
126
+ )
127
 
128
  with gr.Row():
129
  gr.Markdown('''Try a different <b>seed value</b> if the result is unsatisfying (Default: 42).''')