Yaron Koresh commited on
Commit
e09a947
·
verified ·
1 Parent(s): bbff51c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -18
app.py CHANGED
@@ -22,7 +22,6 @@ from diffusers import DiffusionPipeline, AnimateDiffPipeline, MotionAdapter, Eul
22
  import jax
23
  import jax.numpy as jnp
24
 
25
- ip_loaded=False
26
  last_motion=None
27
  fps=15
28
  time=5
@@ -147,23 +146,6 @@ def Piper(image,positive,negative,motion):
147
  if negative == "":
148
  negative = None
149
 
150
- if image == None:
151
- if ip_loaded:
152
- pipe.unload_ip_adapter()
153
- ip_loaded=False
154
- return pipe(
155
- positive,
156
- negative_prompt=negative,
157
- height=1024,
158
- width=576,
159
- num_inference_steps=step,
160
- guidance_scale=1,
161
- num_frames=(fps*time)
162
- )
163
-
164
- if not ip_loaded:
165
- pipe.load_ip_adapter("h94/IP-Adapter", subfolder="models", weight_name="ip-adapter_sd15.bin")
166
- ip_loaded=True
167
  return pipe(
168
  positive,
169
  negative_prompt=negative,
@@ -217,6 +199,7 @@ pipe.scheduler = EulerDiscreteScheduler(
217
  timestep_spacing="trailing",
218
  steps_offset=1
219
  )
 
220
  pipe.enable_vae_slicing()
221
  pipe.enable_free_init(method="butterworth", use_fast_sampling=False)
222
 
 
22
  import jax
23
  import jax.numpy as jnp
24
 
 
25
  last_motion=None
26
  fps=15
27
  time=5
 
146
  if negative == "":
147
  negative = None
148
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  return pipe(
150
  positive,
151
  negative_prompt=negative,
 
199
  timestep_spacing="trailing",
200
  steps_offset=1
201
  )
202
+ pipe.load_ip_adapter("h94/IP-Adapter", subfolder="models", weight_name="ip-adapter_sd15.bin")
203
  pipe.enable_vae_slicing()
204
  pipe.enable_free_init(method="butterworth", use_fast_sampling=False)
205