Update app.py
Browse files
app.py
CHANGED
|
@@ -108,19 +108,20 @@ css = """
|
|
| 108 |
"""
|
| 109 |
|
| 110 |
# Interface Gradio
|
| 111 |
-
with gr.Blocks() as demo:
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
|
|
|
| 116 |
label="Inference Steps", minimum=1, maximum=50, step=1, value=15
|
| 117 |
)
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
|
| 123 |
-
demo.launch()
|
| 124 |
|
| 125 |
run_button = gr.Button("Run", scale=0, variant="primary")
|
| 126 |
|
|
|
|
| 108 |
"""
|
| 109 |
|
| 110 |
# Interface Gradio
|
| 111 |
+
with gr.Blocks() as demo:
|
| 112 |
+
gr.Markdown("## Text-to-Image Optimized for CPU")
|
| 113 |
+
|
| 114 |
+
with gr.Row():
|
| 115 |
+
prompt = gr.Textbox(label="Prompt")
|
| 116 |
+
num_inference_steps = gr.Slider(
|
| 117 |
label="Inference Steps", minimum=1, maximum=50, step=1, value=15
|
| 118 |
)
|
| 119 |
+
with gr.Row():
|
| 120 |
+
generate_button = gr.Button("Generate")
|
| 121 |
+
result = gr.Image(label="Generated Image")
|
| 122 |
+
generate_button.click(infer, inputs=[prompt, num_inference_steps], outputs=result)
|
| 123 |
|
| 124 |
+
demo.launch()
|
| 125 |
|
| 126 |
run_button = gr.Button("Run", scale=0, variant="primary")
|
| 127 |
|