phenomenon1981 commited on
Commit
081c595
1 Parent(s): 1afc3c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -7
app.py CHANGED
@@ -8,7 +8,6 @@ import time
8
  from queue import Queue
9
  from threading import Thread
10
 
11
- generate_locked = False
12
 
13
  text_gen=gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion")
14
  def get_prompts(prompt_text):
@@ -42,19 +41,13 @@ def add_random_noise(prompt, noise_level=0.07):
42
 
43
 
44
  def send_it1(inputs, noise_level, proc1=proc1):
45
- global generate_locked
46
- if generate_locked:
47
- return
48
- generate_locked = True
49
  prompt_with_noise = add_random_noise(inputs, noise_level)
50
  while queue.qsize() >= queue_threshold:
51
  time.sleep(2)
52
  queue.put(prompt_with_noise)
53
  output1 = proc1(prompt_with_noise)
54
- generate_locked = False
55
  return output1
56
 
57
-
58
  def send_it2(inputs, noise_level, proc1=proc1):
59
  prompt_with_noise = add_random_noise(inputs, noise_level)
60
  while queue.qsize() >= queue_threshold:
 
8
  from queue import Queue
9
  from threading import Thread
10
 
 
11
 
12
  text_gen=gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion")
13
  def get_prompts(prompt_text):
 
41
 
42
 
43
  def send_it1(inputs, noise_level, proc1=proc1):
 
 
 
 
44
  prompt_with_noise = add_random_noise(inputs, noise_level)
45
  while queue.qsize() >= queue_threshold:
46
  time.sleep(2)
47
  queue.put(prompt_with_noise)
48
  output1 = proc1(prompt_with_noise)
 
49
  return output1
50
 
 
51
  def send_it2(inputs, noise_level, proc1=proc1):
52
  prompt_with_noise = add_random_noise(inputs, noise_level)
53
  while queue.qsize() >= queue_threshold: