Yaron Koresh commited on
Commit
8f78275
·
verified ·
1 Parent(s): 0c2eae0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -11
app.py CHANGED
@@ -22,6 +22,10 @@ from diffusers.utils import load_image
22
  #import jax
23
  #import jax.numpy as jnp
24
 
 
 
 
 
25
  def port_inc():
26
  env = os.getenv("CUSTOM_PORT")
27
  if env == None:
@@ -178,8 +182,9 @@ def infer(p):
178
  else:
179
  neg = None
180
  posi = " ".join(_do)
181
- print(posi, neg)
182
  output = Piper1(posi)
 
183
  if output == None:
184
  return None
185
  else:
@@ -187,7 +192,7 @@ def infer(p):
187
  if neg == None:
188
  return name
189
  img = load_image(name).convert("RGB")
190
- output2 = Piper2(img,p1,neg)
191
  if output2 == None:
192
  return None
193
  else:
@@ -238,16 +243,7 @@ def ui():
238
  demo.queue().launch(server_port=int(os.getenv("CUSTOM_PORT")))
239
 
240
  if __name__ == "__main__":
241
-
242
- global pp1
243
- global pp2
244
- global result
245
-
246
- pp1=pipe_t2i()
247
- pp2=pipe_i2i()
248
- result=[]
249
 
250
  mp.set_start_method("fork", force=True)
251
-
252
  port_inc()
253
  ui()
 
22
  #import jax
23
  #import jax.numpy as jnp
24
 
25
+ pp1=pipe_t2i()
26
+ pp2=pipe_i2i()
27
+ result=[]
28
+
29
  def port_inc():
30
  env = os.getenv("CUSTOM_PORT")
31
  if env == None:
 
182
  else:
183
  neg = None
184
  posi = " ".join(_do)
185
+ print(posi)
186
  output = Piper1(posi)
187
+ print(output)
188
  if output == None:
189
  return None
190
  else:
 
192
  if neg == None:
193
  return name
194
  img = load_image(name).convert("RGB")
195
+ output2 = Piper2(img,posi,neg)
196
  if output2 == None:
197
  return None
198
  else:
 
243
  demo.queue().launch(server_port=int(os.getenv("CUSTOM_PORT")))
244
 
245
  if __name__ == "__main__":
 
 
 
 
 
 
 
 
246
 
247
  mp.set_start_method("fork", force=True)
 
248
  port_inc()
249
  ui()