Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -26,10 +26,16 @@ import warnings
|
|
26 |
|
27 |
class Suppress:
|
28 |
def write(self, msg):
|
|
|
|
|
|
|
|
|
|
|
29 |
pass
|
30 |
|
31 |
warnings.filterwarnings("ignore")
|
32 |
sys.stderr = Suppress()
|
|
|
33 |
|
34 |
last_motion=None
|
35 |
fps=15
|
@@ -39,7 +45,7 @@ height=896
|
|
39 |
device = "cuda"
|
40 |
dtype = torch.float16
|
41 |
result=[]
|
42 |
-
step =
|
43 |
accu=7.5
|
44 |
#repo = "ByteDance/AnimateDiff-Lightning"
|
45 |
#ckpt = f"animatediff_lightning_{step}step_diffusers.safetensors"
|
@@ -135,7 +141,7 @@ def generate_random_string(length):
|
|
135 |
characters = string.ascii_letters + string.digits
|
136 |
return ''.join(random.choice(characters) for _ in range(length))
|
137 |
|
138 |
-
@spaces.GPU(duration=
|
139 |
def Piper(image,positive,negative,motion):
|
140 |
global last_motion
|
141 |
global ip_loaded
|
@@ -196,7 +202,7 @@ def run(i,m,p1,p2,*result):
|
|
196 |
p2_en = translate(p2,"english")
|
197 |
pm = {"p":p1_en,"n":p2_en,"m":m,"i":i}
|
198 |
ln = len(result)
|
199 |
-
print("
|
200 |
rng = list(range(ln))
|
201 |
|
202 |
arr = [pm for _ in rng]
|
|
|
26 |
|
27 |
class Suppress:
|
28 |
def write(self, msg):
|
29 |
+
print("")
|
30 |
+
print("• • • •")
|
31 |
+
print(msg)
|
32 |
+
print("^ ^ ^ ^")
|
33 |
+
print("")
|
34 |
pass
|
35 |
|
36 |
warnings.filterwarnings("ignore")
|
37 |
sys.stderr = Suppress()
|
38 |
+
sys.stdout = Suppress()
|
39 |
|
40 |
last_motion=None
|
41 |
fps=15
|
|
|
45 |
device = "cuda"
|
46 |
dtype = torch.float16
|
47 |
result=[]
|
48 |
+
step = 25
|
49 |
accu=7.5
|
50 |
#repo = "ByteDance/AnimateDiff-Lightning"
|
51 |
#ckpt = f"animatediff_lightning_{step}step_diffusers.safetensors"
|
|
|
141 |
characters = string.ascii_letters + string.digits
|
142 |
return ''.join(random.choice(characters) for _ in range(length))
|
143 |
|
144 |
+
@spaces.GPU(duration=45)
|
145 |
def Piper(image,positive,negative,motion):
|
146 |
global last_motion
|
147 |
global ip_loaded
|
|
|
202 |
p2_en = translate(p2,"english")
|
203 |
pm = {"p":p1_en,"n":p2_en,"m":m,"i":i}
|
204 |
ln = len(result)
|
205 |
+
print("Threads: "+str(ln))
|
206 |
rng = list(range(ln))
|
207 |
|
208 |
arr = [pm for _ in rng]
|