helloway commited on
Commit
d33db86
·
1 Parent(s): 2cfe540

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -39
app.py CHANGED
@@ -34,42 +34,9 @@ def gen_image(desc: str):
34
  return [image]
35
 
36
 
37
- examples = [
38
- '天空之城 赛博朋克 动漫',
39
- '秋水共长天一色',
40
- '海滩 蓝天 美景',
41
- '教堂 巴洛克风格',
42
- '落日 莫奈',
43
- '来自深渊 雪山飞狐'
44
- ]
45
-
46
- block = gr.Blocks()
47
-
48
-
49
- with block:
50
- with gr.Group():
51
- with gr.Box():
52
- with gr.Row().style(mobile_collapse=False, equal_height=True):
53
- text = gr.Textbox(
54
- label="Desc",
55
- show_label=False,
56
- max_lines=1,
57
- placeholder="输入中文,生成图片",
58
- ).style(
59
- border=(True, False, True, True),
60
- rounded=(True, False, False, True),
61
- container=False,
62
- )
63
-
64
- btn = gr.Button("Generate image").style(
65
- margin=False,
66
- rounded=(False, True, True, False),
67
- )
68
-
69
- gallery = gr.Gallery(
70
- label="Generated images", show_label=False, elem_id="gallery"
71
- ).style(grid=[1, 1], height="auto")
72
-
73
- gr.Examples(examples=examples, fn=gen_image, inputs=text, outputs=gallery)
74
-
75
- block.queue(concurrency_count=3).launch(debug=True)
 
34
  return [image]
35
 
36
 
37
+ demo = gr.Interface(
38
+ fn=gen_image,
39
+ inputs=["text", "text"],
40
+ outputs=["image"],
41
+ )
42
+ demo.launch()