Yaron Koresh commited on
Commit
b263b2a
·
verified ·
1 Parent(s): 716f353

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -89,6 +89,7 @@ def generate_random_string(length):
89
  characters = string.ascii_letters + string.digits
90
  return ''.join(random.choice(characters) for _ in range(length))
91
 
 
92
  def Piper(_do):
93
  pipe = pipe_t2i()
94
  try:
@@ -105,6 +106,7 @@ def Piper(_do):
105
  print(e)
106
  return None
107
 
 
108
  def Piper2(img,posi,neg):
109
  pipe = pipe_i2i()
110
  try:
@@ -118,12 +120,12 @@ def Piper2(img,posi,neg):
118
  print(e)
119
  return None
120
 
 
121
  def tok(txt):
122
  toks = pipe.tokenizer(txt)['input_ids']
123
  print(toks)
124
  return toks
125
 
126
- @spaces.GPU(duration=75)
127
  def infer(p1,p2):
128
  name = generate_random_string(12)+".png"
129
  _do = ['beautiful', 'playful', 'photographed', 'realistic', 'dynamic poze', 'deep field', 'reasonable coloring', 'rough texture', 'best quality', 'focused']
 
89
  characters = string.ascii_letters + string.digits
90
  return ''.join(random.choice(characters) for _ in range(length))
91
 
92
+ @spaces.GPU(duration=35)
93
  def Piper(_do):
94
  pipe = pipe_t2i()
95
  try:
 
106
  print(e)
107
  return None
108
 
109
+ @spaces.GPU(duration=35)
110
  def Piper2(img,posi,neg):
111
  pipe = pipe_i2i()
112
  try:
 
120
  print(e)
121
  return None
122
 
123
+ @spaces.GPU(duration=35)
124
  def tok(txt):
125
  toks = pipe.tokenizer(txt)['input_ids']
126
  print(toks)
127
  return toks
128
 
 
129
  def infer(p1,p2):
130
  name = generate_random_string(12)+".png"
131
  _do = ['beautiful', 'playful', 'photographed', 'realistic', 'dynamic poze', 'deep field', 'reasonable coloring', 'rough texture', 'best quality', 'focused']