hsuwill000 commited on
Commit
5469b0c
·
verified ·
1 Parent(s): 36a0cf6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -14
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
@@ -50,24 +50,21 @@ def infer_gradio(prompt: str):
50
 
51
  # Define Gradio Interface
52
  with gr.Blocks() as demo:
53
- with gr.Column():
54
- gr.Markdown("# LCMSoteMix Image Generator")
55
-
56
- # Prompt input field for the user
57
  prompt_input = gr.Textbox(
58
  label="Enter Your Prompt",
59
  placeholder="Type your prompt for image generation here",
60
- lines=4, # Allow multi-line input for the prompt
61
  interactive=True # Allow user to interact with the textbox
62
  )
63
 
64
- # Button to trigger the generation
65
- run_button = gr.Button("Generate Image")
66
-
67
- # Output image display area
68
- output_image = gr.Image(label="Generated Image")
69
-
70
- # Connecting the button click to the image generation function
71
- run_button.click(infer_gradio, inputs=prompt_input, outputs=output_image)
72
 
73
  demo.launch()
 
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
 
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")
63
+
64
+ # Output image display area
65
+ output_image = gr.Image(label="Generated Image")
66
+
67
+ # Connecting the button click to the image generation function
68
+ run_button.click(infer_gradio, inputs=prompt_input, outputs=output_image)
69
 
70
  demo.launch()