Spaces:
Sleeping
Sleeping
tokeron
commited on
Commit
•
e18f8f6
1
Parent(s):
896b56f
no need label
Browse files
app.py
CHANGED
@@ -41,14 +41,12 @@ def get_prompt(prompt):
|
|
41 |
return "Images generated"
|
42 |
|
43 |
|
44 |
-
if __name__ == '__main__':
|
45 |
-
with gr.Blocks() as demo:
|
46 |
-
gallery = gr.Gallery(
|
47 |
-
label="Generated images", show_label=False, elem_id="gallery",
|
48 |
-
columns=[6], rows=[4], object_fit="contain", height="auto") # set rows to 24 to accommodate all images
|
49 |
-
btn = gr.Button("Generate images", scale=0)
|
50 |
-
text_input = gr.Interface(fn=get_prompt, inputs="text", outputs='Gallery')
|
51 |
|
52 |
-
|
53 |
-
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
41 |
return "Images generated"
|
42 |
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
+
with gr.Blocks() as demo:
|
46 |
+
gallery = gr.Gallery(
|
47 |
+
label="Generated images", show_label=False, elem_id="gallery",
|
48 |
+
columns=[6], rows=[4], object_fit="contain", height="auto") # set rows to 24 to accommodate all images
|
49 |
+
btn = gr.Button("Generate images", scale=0)
|
50 |
+
text_input = gr.Interface(fn=get_prompt, inputs="text", outputs='Gallery')
|
51 |
+
btn.click(get_prompt, text_input, gallery) # pass the text input interface to btn.click()
|
52 |
+
demo.launch()
|