hsuwill000 commited on
Commit
d7f02ec
·
verified ·
1 Parent(s): 8845fa7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -13
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(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")
 
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")