KingNish commited on
Commit
8f1a540
1 Parent(s): 6c609d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +39 -2
app.py CHANGED
@@ -151,7 +151,37 @@ footer {
151
  visibility: hidden
152
  }
153
  '''
154
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  with gr.Blocks(css=css) as demo:
156
  gr.Markdown("# Image Generator Pro")
157
  with gr.Row():
@@ -178,6 +208,14 @@ with gr.Blocks(css=css) as demo:
178
  )
179
  seed = gr.Number(value=1371, precision=0, label="Seed", interactive=True)
180
 
 
 
 
 
 
 
 
 
181
  gr.Markdown(help_text)
182
 
183
  instruction.change(fn=response, inputs=[instruction,input_image], outputs=type, queue=False)
@@ -194,7 +232,6 @@ with gr.Blocks(css=css) as demo:
194
  image_cfg_scale,
195
  ],
196
  outputs=[seed, input_image],
197
- queue=False
198
  )
199
 
200
  demo.queue(max_size=99999).launch()
 
151
  visibility: hidden
152
  }
153
  '''
154
+
155
+ def get_example():
156
+ case = [
157
+ [
158
+ "Image Generation",
159
+ None,
160
+ "A Super Car",
161
+ ],
162
+ [
163
+ "Image Editing",
164
+ "./supercar.png",
165
+ "make it red",
166
+ ],
167
+ [
168
+ "Image Editing",
169
+ "./red_car.png",
170
+ "add some snow",
171
+ ],
172
+ [
173
+ "Image Generation",
174
+ None,
175
+ "Ironman flying in front of Ststue of liberty",
176
+ ],
177
+ [
178
+ "Image Generation",
179
+ None,
180
+ "Beautiful Eiffel Tower at Night",
181
+ ],
182
+ ]
183
+ return case
184
+
185
  with gr.Blocks(css=css) as demo:
186
  gr.Markdown("# Image Generator Pro")
187
  with gr.Row():
 
208
  )
209
  seed = gr.Number(value=1371, precision=0, label="Seed", interactive=True)
210
 
211
+ gr.Examples(
212
+ examples=get_example(),
213
+ inputs=[type,input_image, instruction],
214
+ fn=king,
215
+ outputs=[input_image],
216
+ cache_examples=True,
217
+ )
218
+
219
  gr.Markdown(help_text)
220
 
221
  instruction.change(fn=response, inputs=[instruction,input_image], outputs=type, queue=False)
 
232
  image_cfg_scale,
233
  ],
234
  outputs=[seed, input_image],
 
235
  )
236
 
237
  demo.queue(max_size=99999).launch()