Update app.py
Browse files
app.py
CHANGED
@@ -71,6 +71,9 @@ def generate(input=DEFAULT_INPUT, negative_input=DEFAULT_NEGATIVE_INPUT, height=
|
|
71 |
image = model(**parameters).images[0]
|
72 |
return image
|
73 |
|
|
|
|
|
|
|
74 |
# Initialize
|
75 |
with gr.Blocks(css=css) as main:
|
76 |
with gr.Column():
|
@@ -82,10 +85,12 @@ with gr.Blocks(css=css) as main:
|
|
82 |
guidance = gr.Slider(minimum=0, maximum=100, step=0.001, value=3, label = "Guidance")
|
83 |
seed = gr.Textbox(lines=1, value="", label="Seed (Blank for random)")
|
84 |
submit = gr.Button("▶")
|
|
|
85 |
|
86 |
with gr.Column():
|
87 |
image = gr.Image(label="Image")
|
88 |
|
89 |
-
submit.click(generate, inputs=[input, negative_input, height, width, steps, guidance, seed], outputs=[image])
|
|
|
90 |
|
91 |
main.launch(show_api=True)
|
|
|
71 |
image = model(**parameters).images[0]
|
72 |
return image
|
73 |
|
74 |
+
def cloud():
|
75 |
+
print("[CLOUD] | Space maintained.")
|
76 |
+
|
77 |
# Initialize
|
78 |
with gr.Blocks(css=css) as main:
|
79 |
with gr.Column():
|
|
|
85 |
guidance = gr.Slider(minimum=0, maximum=100, step=0.001, value=3, label = "Guidance")
|
86 |
seed = gr.Textbox(lines=1, value="", label="Seed (Blank for random)")
|
87 |
submit = gr.Button("▶")
|
88 |
+
maintain = gr.Button("☁️")
|
89 |
|
90 |
with gr.Column():
|
91 |
image = gr.Image(label="Image")
|
92 |
|
93 |
+
submit.click(generate, inputs=[input, negative_input, height, width, steps, guidance, seed], outputs=[image], queue=False)
|
94 |
+
maintain.click(cloud, inputs=[], outputs=[], queue=False)
|
95 |
|
96 |
main.launch(show_api=True)
|