Yaron Koresh commited on
Commit
b3bfe09
·
verified ·
1 Parent(s): 0a5161c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -168,33 +168,33 @@ def calc():
168
 
169
  x = grid(1)
170
 
171
- if last_motion != inp["motion"]:
172
  pipe.unload_lora_weights()
173
- if inp["motion"] != "":
174
- pipe.load_lora_weights(inp["motion"], adapter_name="motion")
175
  pipe.fuse_lora()
176
- pipe.set_adapters(["motion"], [0.7])
177
- last_motion = inp["motion"]
178
 
179
  pipe.to(device,dtype)
180
 
181
- if inp["negative"]=="":
182
  out[x] = pipe(
183
- prompt=inp["positive"],
184
  height=height,
185
  width=width,
186
- ip_adapter_image=inp["image"].convert("RGB").resize((width,height)),
187
  num_inference_steps=step,
188
  guidance_scale=accu,
189
  num_frames=(fps*time)
190
  )
191
 
192
  out[x] = pipe(
193
- prompt=inp["positive"],
194
- negative_prompt=inp["negative"],
195
  height=height,
196
  width=width,
197
- ip_adapter_image=inp["image"].convert("RGB").resize((width,height)),
198
  num_inference_steps=step,
199
  guidance_scale=accu,
200
  num_frames=(fps*time)
 
168
 
169
  x = grid(1)
170
 
171
+ if last_motion != inp[3]:
172
  pipe.unload_lora_weights()
173
+ if inp[3] != "":
174
+ pipe.load_lora_weights(inp[3], adapter_name="motion")
175
  pipe.fuse_lora()
176
+ pipe.set_adapters([3], [0.7])
177
+ last_motion = inp[3]
178
 
179
  pipe.to(device,dtype)
180
 
181
+ if inp[2]=="":
182
  out[x] = pipe(
183
+ prompt=inp[1],
184
  height=height,
185
  width=width,
186
+ ip_adapter_image=inp[0].convert("RGB").resize((width,height)),
187
  num_inference_steps=step,
188
  guidance_scale=accu,
189
  num_frames=(fps*time)
190
  )
191
 
192
  out[x] = pipe(
193
+ prompt=inp[1],
194
+ negative_prompt=inp[2],
195
  height=height,
196
  width=width,
197
+ ip_adapter_image=inp[0].convert("RGB").resize((width,height)),
198
  num_inference_steps=step,
199
  guidance_scale=accu,
200
  num_frames=(fps*time)