kIDAa commited on
Commit
b819d6d
1 Parent(s): 6b258a3

add examples

Browse files
Files changed (1) hide show
  1. app.py +29 -0
app.py CHANGED
@@ -255,4 +255,33 @@ with gr.Blocks() as app:
255
  h, w = canvas["background"].shape[:2]
256
  canvas["background"] = output_image.resize((w, h))
257
  return tuple(canvas_list)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
258
  app.launch()
 
255
  h, w = canvas["background"].shape[:2]
256
  canvas["background"] = output_image.resize((w, h))
257
  return tuple(canvas_list)
258
+
259
+ canvas1 = {
260
+ "background": Image.open("images/image1.png"),
261
+ "layers": [np.array(Image.open("images/image1_layer.png"))],
262
+ "composite": "images/image1_layer.png",
263
+ }
264
+ canvas2 = {
265
+ "background": Image.open("images/image2.png"),
266
+ "layers": [np.array(Image.open("images/image2_layer.png"))],
267
+ "composite": "images/image2_layer.png",
268
+ }
269
+ canvas3 = {
270
+ "background": Image.open("images/image3.png"),
271
+ "layers": [np.array(Image.open("images/image3_layer.png"))],
272
+ "composite": "images/image3_layer.png",
273
+ }
274
+
275
+ print(*enable_local_prompt_list, *local_prompt_list, *mask_scale_list, *canvas_list)
276
+ with gr.Row():
277
+ show_case = gr.Examples(
278
+ examples=[
279
+ ["a girl", 0, "images/image1.png", True, "red hat", 3.0, canvas1],
280
+ ["an orange cat", 0, "images/image2.png", True, "a big crown on the cat", 3.0, canvas2],
281
+ ["A young man is riding a horse", 0, "images/image3.png", True, "A robot is riding a horse", 3.0, canvas3],
282
+ ],
283
+ inputs=[prompt, seed, output_image, enable_local_prompt_list[0], local_prompt_list[0], mask_scale_list[0], canvas_list[0]],
284
+ label=None
285
+ )
286
+
287
  app.launch()