Update app.py
Browse files
app.py
CHANGED
|
@@ -49,21 +49,18 @@ def infer_gradio(prompt: str):
|
|
| 49 |
return None # Return nothing if an error occurs
|
| 50 |
|
| 51 |
# Define Gradio Interface
|
| 52 |
-
with gr.Blocks() as demo:
|
| 53 |
-
with gr.
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
run_button = gr.Button("RUN:").style(
|
| 65 |
-
width="20%" # Set the button width to 1/5
|
| 66 |
-
)
|
| 67 |
|
| 68 |
# Output image display area
|
| 69 |
output_image = gr.Image(label="Generated Image")
|
|
|
|
| 49 |
return None # Return nothing if an error occurs
|
| 50 |
|
| 51 |
# Define Gradio Interface
|
| 52 |
+
with gr.Blocks(css=".input-container { display: flex; align-items: center; justify-content: space-between; } .input-container .textbox { width: 80%; } .input-container .button { width: 20%; }") as demo:
|
| 53 |
+
with gr.Column():
|
| 54 |
+
# Use a Row with CSS class to control layout
|
| 55 |
+
with gr.Row(elem_id="input-container"):
|
| 56 |
+
prompt_input = gr.Textbox(
|
| 57 |
+
placeholder="Type your prompt for image generation here",
|
| 58 |
+
lines=1, # Set the input to be only one line tall
|
| 59 |
+
interactive=True # Allow user to interact with the textbox
|
| 60 |
+
).style(class_name="textbox") # Assign CSS class for width control
|
| 61 |
+
|
| 62 |
+
# Change the button text to "RUN:" and align it with the prompt input
|
| 63 |
+
run_button = gr.Button("RUN").style(class_name="button") # Assign CSS class for width control
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
# Output image display area
|
| 66 |
output_image = gr.Image(label="Generated Image")
|