Spaces:
Paused
Paused
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -144,6 +144,17 @@ def Piper(image,positive,negative,motion):
|
|
| 144 |
last_motion = motion
|
| 145 |
|
| 146 |
pipe.to(device,dtype)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
|
| 148 |
return pipe(
|
| 149 |
prompt=positive,
|
|
@@ -168,7 +179,7 @@ def infer(pm):
|
|
| 168 |
_do.append(f'{p1}')
|
| 169 |
posi = " ".join(_do)
|
| 170 |
|
| 171 |
-
if
|
| 172 |
return None
|
| 173 |
out = Piper(pm["i"],posi,neg,pm["m"])
|
| 174 |
export_to_gif(out.frames[0],name,fps=fps)
|
|
|
|
| 144 |
last_motion = motion
|
| 145 |
|
| 146 |
pipe.to(device,dtype)
|
| 147 |
+
|
| 148 |
+
if negative=="":
|
| 149 |
+
return pipe(
|
| 150 |
+
prompt=positive,
|
| 151 |
+
height=height,
|
| 152 |
+
width=width,
|
| 153 |
+
ip_adapter_image=image.convert("RGB").resize((width,height)),
|
| 154 |
+
num_inference_steps=step,
|
| 155 |
+
guidance_scale=accu,
|
| 156 |
+
num_frames=(fps*time)
|
| 157 |
+
)
|
| 158 |
|
| 159 |
return pipe(
|
| 160 |
prompt=positive,
|
|
|
|
| 179 |
_do.append(f'{p1}')
|
| 180 |
posi = " ".join(_do)
|
| 181 |
|
| 182 |
+
if pm["i"] == None:
|
| 183 |
return None
|
| 184 |
out = Piper(pm["i"],posi,neg,pm["m"])
|
| 185 |
export_to_gif(out.frames[0],name,fps=fps)
|