Update app.py
Browse files
app.py
CHANGED
@@ -45,13 +45,11 @@ examples = [
|
|
45 |
#"""
|
46 |
|
47 |
css="""
|
48 |
-
/* Add some basic styling to the app */
|
49 |
body {
|
50 |
font-family: Arial, sans-serif;
|
51 |
background-color: #f2f2f2;
|
52 |
}
|
53 |
|
54 |
-
/* Style the column container */
|
55 |
col-container {
|
56 |
margin: 0 auto;
|
57 |
max-width: 520px;
|
@@ -62,26 +60,22 @@ col-container {
|
|
62 |
box-shadow: 0 0 10px rgba(0,0,0,0.1);
|
63 |
}
|
64 |
|
65 |
-
/* Style the markdown text */
|
66 |
.gr-markdown {
|
67 |
font-size: 16px;
|
68 |
color: #333;
|
69 |
}
|
70 |
|
71 |
-
/* Style the input fields */
|
72 |
.gr-input {
|
73 |
padding: 10px;
|
74 |
border: 1px solid #ccc;
|
75 |
border-radius: 5px;
|
76 |
}
|
77 |
|
78 |
-
/* Style the sliders */
|
79 |
.gr-slider {
|
80 |
width: 100%;
|
81 |
padding: 10px;
|
82 |
}
|
83 |
|
84 |
-
/* Style the buttons */
|
85 |
.gr-button {
|
86 |
background-color: #4CAF50;
|
87 |
color: #fff;
|
@@ -95,7 +89,6 @@ col-container {
|
|
95 |
background-color: #3e8e41;
|
96 |
}
|
97 |
|
98 |
-
/* Style the accordion */
|
99 |
.gr-accordion {
|
100 |
background-color: #f2f2f2;
|
101 |
border: 1px solid #ddd;
|
@@ -108,7 +101,6 @@ col-container {
|
|
108 |
margin-bottom: 10px;
|
109 |
}
|
110 |
|
111 |
-
/* Style the examples */
|
112 |
.gr-examples {
|
113 |
padding: 10px;
|
114 |
background-color: #f2f2f2;
|
@@ -138,12 +130,14 @@ with gr.Blocks(css=css) as demo:
|
|
138 |
|
139 |
result = gr.Image(label="Result", show_label=False)
|
140 |
|
141 |
-
gr.
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
|
|
|
|
147 |
)
|
148 |
|
149 |
|
|
|
45 |
#"""
|
46 |
|
47 |
css="""
|
|
|
48 |
body {
|
49 |
font-family: Arial, sans-serif;
|
50 |
background-color: #f2f2f2;
|
51 |
}
|
52 |
|
|
|
53 |
col-container {
|
54 |
margin: 0 auto;
|
55 |
max-width: 520px;
|
|
|
60 |
box-shadow: 0 0 10px rgba(0,0,0,0.1);
|
61 |
}
|
62 |
|
|
|
63 |
.gr-markdown {
|
64 |
font-size: 16px;
|
65 |
color: #333;
|
66 |
}
|
67 |
|
|
|
68 |
.gr-input {
|
69 |
padding: 10px;
|
70 |
border: 1px solid #ccc;
|
71 |
border-radius: 5px;
|
72 |
}
|
73 |
|
|
|
74 |
.gr-slider {
|
75 |
width: 100%;
|
76 |
padding: 10px;
|
77 |
}
|
78 |
|
|
|
79 |
.gr-button {
|
80 |
background-color: #4CAF50;
|
81 |
color: #fff;
|
|
|
89 |
background-color: #3e8e41;
|
90 |
}
|
91 |
|
|
|
92 |
.gr-accordion {
|
93 |
background-color: #f2f2f2;
|
94 |
border: 1px solid #ddd;
|
|
|
101 |
margin-bottom: 10px;
|
102 |
}
|
103 |
|
|
|
104 |
.gr-examples {
|
105 |
padding: 10px;
|
106 |
background-color: #f2f2f2;
|
|
|
130 |
|
131 |
result = gr.Image(label="Result", show_label=False)
|
132 |
|
133 |
+
with gr.Row():
|
134 |
+
|
135 |
+
gr.Examples(
|
136 |
+
examples = examples,
|
137 |
+
fn = infer,
|
138 |
+
inputs = [prompt],
|
139 |
+
outputs = [result, seed],
|
140 |
+
cache_examples="lazy"
|
141 |
)
|
142 |
|
143 |
|