Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import time
|
|
| 6 |
import traceback
|
| 7 |
|
| 8 |
# Create a Client instance to communicate with the Hugging Face space
|
| 9 |
-
client = Client("hsuwill000/LCM_SoteMix_OpenVINO_CPU_Space_TAESD")
|
| 10 |
|
| 11 |
# Counter for image filenames to avoid overwriting
|
| 12 |
count = 0
|
|
@@ -49,18 +49,17 @@ def infer_gradio(prompt: str):
|
|
| 49 |
return None # Return nothing if an error occurs
|
| 50 |
|
| 51 |
# Define Gradio Interface
|
| 52 |
-
with gr.Blocks(
|
| 53 |
-
with gr.
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 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")
|
|
|
|
| 6 |
import traceback
|
| 7 |
|
| 8 |
# Create a Client instance to communicate with the Hugging Face space
|
| 9 |
+
client = Client("https://huggingface.co/spaces/hsuwill000/LCM_SoteMix_OpenVINO_CPU_Space_TAESD")
|
| 10 |
|
| 11 |
# Counter for image filenames to avoid overwriting
|
| 12 |
count = 0
|
|
|
|
| 49 |
return None # Return nothing if an error occurs
|
| 50 |
|
| 51 |
# Define Gradio Interface
|
| 52 |
+
with gr.Blocks() as demo:
|
| 53 |
+
with gr.Row(): # Use a Row to place the prompt input and the button side by side
|
| 54 |
+
prompt_input = gr.Textbox(
|
| 55 |
+
label="Enter Your Prompt",
|
| 56 |
+
placeholder="Type your prompt for image generation here",
|
| 57 |
+
lines=1, # Set the input to be only one line tall
|
| 58 |
+
interactive=True # Allow user to interact with the textbox
|
| 59 |
+
)
|
| 60 |
+
|
| 61 |
+
# Change the button text to "RUN:" and align it with the prompt input
|
| 62 |
+
run_button = gr.Button("RUN",lines=2)
|
|
|
|
| 63 |
|
| 64 |
# Output image display area
|
| 65 |
output_image = gr.Image(label="Generated Image")
|