sayakpaul HF staff commited on
Commit
2495f4f
1 Parent(s): f7ac112
Files changed (1) hide show
  1. app.py +21 -24
app.py CHANGED
@@ -87,9 +87,7 @@ with gr.Blocks(theme="gradio/soft") as demo:
87
  text_cfg = gr.Number(value=7.5, label=f"Text CFG", interactive=True)
88
  seed = gr.Slider(minimum=0, maximum=100000, step=1, label="Seed")
89
 
90
- car_output_gallery = gr.Gallery(
91
- label="Generated images", show_label=False, elem_id="gallery"
92
- ).style(columns=[2], rows=[2], object_fit="contain", height="auto")
93
  submit_btn = gr.Button(value="Submit")
94
  all_car_inputs = [prompt, neg_prompt, input_image, steps, img_cfg, text_cfg, seed]
95
  submit_btn.click(
@@ -98,6 +96,15 @@ with gr.Blocks(theme="gradio/soft") as demo:
98
  outputs=[car_output_gallery],
99
  )
100
 
 
 
 
 
 
 
 
 
 
101
  with gr.Tab("Low-level image processing"):
102
  rompt = gr.Textbox(label="Prompt")
103
  neg_prompt = gr.Textbox(label="Negative Prompt")
@@ -107,9 +114,7 @@ with gr.Blocks(theme="gradio/soft") as demo:
107
  text_cfg = gr.Number(value=7.5, label=f"Text CFG", interactive=True)
108
  seed = gr.Slider(minimum=0, maximum=100000, step=1)
109
 
110
- img_proc_output_gallery = gr.Gallery(
111
- label="Generated images", show_label=False, elem_id="gallery"
112
- ).style(columns=[2], rows=[2], object_fit="contain", height="auto")
113
  submit_btn = gr.Button(value="Submit")
114
  all_img_proc_inputs = [prompt, neg_prompt, input_image, steps, img_cfg, text_cfg, seed]
115
  submit_btn.click(
@@ -117,22 +122,14 @@ with gr.Blocks(theme="gradio/soft") as demo:
117
  inputs=all_img_proc_inputs,
118
  outputs=[img_proc_output_gallery],
119
  )
 
 
 
 
 
 
 
 
 
120
 
121
- gr.Markdown("### Cartoonization example")
122
- gr.Examples(
123
- [examples[0]],
124
- inputs=all_car_inputs,
125
- outputs=car_output_gallery,
126
- fn=infer_cartoonization,
127
- cache_examples=True,
128
- )
129
- gr.Markdown("### Low-level image processing example")
130
- gr.Examples(
131
- [examples[1]],
132
- inputs=all_img_proc_inputs,
133
- outputs=img_proc_output_gallery,
134
- fn=infer_img_proc,
135
- cache_examples=True,
136
- )
137
-
138
- demo.launch()
 
87
  text_cfg = gr.Number(value=7.5, label=f"Text CFG", interactive=True)
88
  seed = gr.Slider(minimum=0, maximum=100000, step=1, label="Seed")
89
 
90
+ car_output_gallery = gr.Gallery().style(grid=[2], height="auto")
 
 
91
  submit_btn = gr.Button(value="Submit")
92
  all_car_inputs = [prompt, neg_prompt, input_image, steps, img_cfg, text_cfg, seed]
93
  submit_btn.click(
 
96
  outputs=[car_output_gallery],
97
  )
98
 
99
+ gr.Markdown("### Cartoonization example")
100
+ gr.Examples(
101
+ [examples[0]],
102
+ inputs=all_car_inputs,
103
+ outputs=car_output_gallery,
104
+ fn=infer_cartoonization,
105
+ cache_examples=True,
106
+ )
107
+
108
  with gr.Tab("Low-level image processing"):
109
  rompt = gr.Textbox(label="Prompt")
110
  neg_prompt = gr.Textbox(label="Negative Prompt")
 
114
  text_cfg = gr.Number(value=7.5, label=f"Text CFG", interactive=True)
115
  seed = gr.Slider(minimum=0, maximum=100000, step=1)
116
 
117
+ img_proc_output_gallery = gr.Gallery().style(grid=[2], height="auto")
 
 
118
  submit_btn = gr.Button(value="Submit")
119
  all_img_proc_inputs = [prompt, neg_prompt, input_image, steps, img_cfg, text_cfg, seed]
120
  submit_btn.click(
 
122
  inputs=all_img_proc_inputs,
123
  outputs=[img_proc_output_gallery],
124
  )
125
+
126
+ gr.Markdown("### Low-level image processing example")
127
+ gr.Examples(
128
+ [examples[1]],
129
+ inputs=all_img_proc_inputs,
130
+ outputs=img_proc_output_gallery,
131
+ fn=infer_img_proc,
132
+ cache_examples=True,
133
+ )
134
 
135
+ demo.launch(enable_queue=True)