Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -36,7 +36,7 @@ with gr.Blocks(css=css) as demo:
|
|
36 |
"
|
37 |
>
|
38 |
<h1 style="font-weight: 900; margin-bottom: 7px; margin-top: 5px;">
|
39 |
-
Chameleon Text2Img 🦎
|
40 |
</h1>
|
41 |
</div>
|
42 |
</div>""")
|
@@ -50,16 +50,26 @@ with gr.Blocks(css=css) as demo:
|
|
50 |
elem_id="translated"
|
51 |
)
|
52 |
with gr.Row():
|
53 |
-
diffuse_btn = gr.Button(value="
|
54 |
with gr.Column(elem_id="generated-gallery"):
|
55 |
sd_output = gr.Gallery().style(grid=2, height="auto")
|
|
|
|
|
|
|
|
|
56 |
|
|
|
|
|
|
|
|
|
|
|
57 |
diffuse_btn.click(get_images,
|
58 |
inputs = [
|
59 |
text_output
|
60 |
],
|
61 |
-
outputs = [sd_output, community_icon, loading_icon]
|
62 |
-
)
|
|
|
63 |
|
64 |
|
65 |
|
|
|
36 |
"
|
37 |
>
|
38 |
<h1 style="font-weight: 900; margin-bottom: 7px; margin-top: 5px;">
|
39 |
+
Chameleon Text2Img Generator Demo 🦎
|
40 |
</h1>
|
41 |
</div>
|
42 |
</div>""")
|
|
|
50 |
elem_id="translated"
|
51 |
)
|
52 |
with gr.Row():
|
53 |
+
diffuse_btn = gr.Button(value="Diffuse the Prompt!")
|
54 |
with gr.Column(elem_id="generated-gallery"):
|
55 |
sd_output = gr.Gallery().style(grid=2, height="auto")
|
56 |
+
with gr.Group(elem_id="share-btn-container"):
|
57 |
+
community_icon = gr.HTML(community_icon_html, visible=False)
|
58 |
+
loading_icon = gr.HTML(loading_icon_html, visible=False)
|
59 |
+
share_button = gr.Button("Share to community", elem_id="share-btn", visible=False)
|
60 |
|
61 |
+
see_prompts.click(get_prompts,
|
62 |
+
inputs = [input_text],
|
63 |
+
outputs = [
|
64 |
+
text_output
|
65 |
+
])
|
66 |
diffuse_btn.click(get_images,
|
67 |
inputs = [
|
68 |
text_output
|
69 |
],
|
70 |
+
outputs = [sd_output, community_icon, loading_icon, share_button]
|
71 |
+
)
|
72 |
+
share_button.click(None, [], [], _js=share_js)
|
73 |
|
74 |
|
75 |
|