wenjiao commited on
Commit
dbbe9a7
1 Parent(s): 6098c15
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -26,9 +26,9 @@ queue_size = 0
26
  def set_msg():
27
  global queue_size
28
  if queue_size > int(os.environ["max_queue_size"]):
29
- return "The current traffic is high with " + str(queue_size) + " in the queue. Please wait a moment."
30
  else:
31
- return "The current traffic is not high. You can submit your job now."
32
 
33
  def img2img_generate(source_img, prompt, steps=25, strength=0.75, seed=42, guidance_scale=7.5):
34
 
@@ -135,10 +135,10 @@ with gr.Blocks(css=css) as demo:
135
  gr.Markdown("# Stable Diffusion Inference Demo on 4th Gen Intel Xeon Scalable Processors")
136
  gr.Markdown(md)
137
 
138
- text = gr.Text(queue_size)
139
- textBoxGreen = gr.Textbox(set_msg, every=3, label='Real-time Jobs in Queue', elem_id='txtGreenStyle', visible=True)
140
- textBoxOrange = gr.Textbox(set_msg, every=3, label='Real-time Jobs in Queue', elem_id='txtOrangeStyle', visible=False)
141
-
142
 
143
  with gr.Tab("Text-to-Image"):
144
  with gr.Row(visible=True) as text_to_image:
 
26
  def set_msg():
27
  global queue_size
28
  if queue_size > int(os.environ["max_queue_size"]):
29
+ return ["The current traffic is high with " + str(queue_size) + " in the queue. Please wait a moment.", queue_size]
30
  else:
31
+ return ["The current traffic is not high. You can submit your job now.", queue_size]
32
 
33
  def img2img_generate(source_img, prompt, steps=25, strength=0.75, seed=42, guidance_scale=7.5):
34
 
 
135
  gr.Markdown("# Stable Diffusion Inference Demo on 4th Gen Intel Xeon Scalable Processors")
136
  gr.Markdown(md)
137
 
138
+ queueText = gr.Text()
139
+ textBoxGreen = gr.Textbox(set_msg, every=3, label='Real-time Jobs in Queue', elem_id='txtGreenStyle', visible=True, outputs=[queueText])
140
+ textBoxOrange = gr.Textbox(set_msg, every=3, label='Real-time Jobs in Queue', elem_id='txtOrangeStyle', visible=False, outputs=[queueText])
141
+ queueText = gr.Text(queue_size)
142
 
143
  with gr.Tab("Text-to-Image"):
144
  with gr.Row(visible=True) as text_to_image: