phenomenon1981 commited on
Commit
db8b594
1 Parent(s): 33d271f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -10
app.py CHANGED
@@ -10,7 +10,6 @@ queue = Queue()
10
 
11
  text_gen=gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion")
12
  proc1=gr.Interface.load("models/dreamlike-art/dreamlike-photoreal-2.0")
13
- proc5=gr.Interface.load("models/dreamlike-art/dreamlike-diffusion-1.0")
14
 
15
  def reset_queue_periodically():
16
  start_time = time.time()
@@ -83,7 +82,7 @@ def send_it4(inputs, noise_level, proc1=proc1):
83
  return output4
84
  time.sleep(1)
85
 
86
- def send_it5(inputs, noise_level, proc5=proc5):
87
  global queue_length_counter
88
  prompt_with_noise = add_random_noise(inputs, noise_level)
89
  if queue_length_counter >= 15:
@@ -95,7 +94,7 @@ def send_it5(inputs, noise_level, proc5=proc5):
95
  return output5
96
  time.sleep(1)
97
 
98
- def send_it6(inputs, noise_level, proc5=proc5):
99
  global queue_length_counter
100
  prompt_with_noise = add_random_noise(inputs, noise_level)
101
  if queue_length_counter >= 15:
@@ -107,7 +106,7 @@ def send_it6(inputs, noise_level, proc5=proc5):
107
  return output6
108
  time.sleep(1)
109
 
110
- def send_it7(inputs, noise_level, proc5=proc5):
111
  global queue_length_counter
112
  prompt_with_noise = add_random_noise(inputs, noise_level)
113
  if queue_length_counter >= 15:
@@ -119,7 +118,7 @@ def send_it7(inputs, noise_level, proc5=proc5):
119
  return output7
120
  time.sleep(1)
121
 
122
- def send_it8(inputs, noise_level, proc5=proc5):
123
  global queue_length_counter
124
  prompt_with_noise = add_random_noise(inputs, noise_level)
125
  if queue_length_counter >= 15:
@@ -165,11 +164,11 @@ with gr.Blocks() as myface:
165
  output3=gr.Image(label="Dreamlike Photoreal 2.0")
166
  output4=gr.Image(label="Dreamlike Photoreal 2.0")
167
  with gr.Row():
168
- output5=gr.Image(label="Dreamlike Diffusion 1.0")
169
- output6=gr.Image(label="Dreamlike Diffusion 1.0")
170
  with gr.Row():
171
- output7=gr.Image(label="Dreamlike Diffusion 1.0")
172
- output8=gr.Image(label="Dreamlike Diffusion 1.0")
173
 
174
 
175
  run.click(send_it1, inputs=[prompt, noise_level], outputs=[output1])
@@ -187,6 +186,6 @@ with gr.Blocks() as myface:
187
  myface.queue(concurrency_count=8)
188
  myface.launch(enable_queue=True, inline=True)
189
  while True:
190
- if queue.qsize() >= 20:
191
  queue.queue.clear()
192
  time.sleep(30)
 
10
 
11
  text_gen=gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion")
12
  proc1=gr.Interface.load("models/dreamlike-art/dreamlike-photoreal-2.0")
 
13
 
14
  def reset_queue_periodically():
15
  start_time = time.time()
 
82
  return output4
83
  time.sleep(1)
84
 
85
+ def send_it5(inputs, noise_level, proc1=proc1):
86
  global queue_length_counter
87
  prompt_with_noise = add_random_noise(inputs, noise_level)
88
  if queue_length_counter >= 15:
 
94
  return output5
95
  time.sleep(1)
96
 
97
+ def send_it6(inputs, noise_level, proc1=proc1):
98
  global queue_length_counter
99
  prompt_with_noise = add_random_noise(inputs, noise_level)
100
  if queue_length_counter >= 15:
 
106
  return output6
107
  time.sleep(1)
108
 
109
+ def send_it7(inputs, noise_level, proc1=proc1):
110
  global queue_length_counter
111
  prompt_with_noise = add_random_noise(inputs, noise_level)
112
  if queue_length_counter >= 15:
 
118
  return output7
119
  time.sleep(1)
120
 
121
+ def send_it8(inputs, noise_level, proc1=proc1):
122
  global queue_length_counter
123
  prompt_with_noise = add_random_noise(inputs, noise_level)
124
  if queue_length_counter >= 15:
 
164
  output3=gr.Image(label="Dreamlike Photoreal 2.0")
165
  output4=gr.Image(label="Dreamlike Photoreal 2.0")
166
  with gr.Row():
167
+ output5=gr.Image(label="Dreamlike Photoreal 2.0")
168
+ output6=gr.Image(label="Dreamlike Photoreal 2.0")
169
  with gr.Row():
170
+ output7=gr.Image(label="Dreamlike Photoreal 2.0")
171
+ output8=gr.Image(label="Dreamlike Photoreal 2.0")
172
 
173
 
174
  run.click(send_it1, inputs=[prompt, noise_level], outputs=[output1])
 
186
  myface.queue(concurrency_count=8)
187
  myface.launch(enable_queue=True, inline=True)
188
  while True:
189
+ if queue.qsize() >= 15:
190
  queue.queue.clear()
191
  time.sleep(30)