Spaces:
Running
on
Zero
Running
on
Zero
陈硕
commited on
Commit
·
6f2359b
1
Parent(s):
ab732e1
fix pipe bug
Browse files
app.py
CHANGED
|
@@ -242,7 +242,6 @@ def convert_prompt(prompt: str, image_path: str = None, retry_times: int = 3) ->
|
|
| 242 |
|
| 243 |
@spaces.GPU
|
| 244 |
def infer(
|
| 245 |
-
pipe_image,
|
| 246 |
prompt: str,
|
| 247 |
orbit_type: str,
|
| 248 |
image_input: str,
|
|
@@ -274,6 +273,8 @@ def infer(
|
|
| 274 |
adapter_timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
| 275 |
|
| 276 |
# Load LoRA weights on CPU
|
|
|
|
|
|
|
| 277 |
pipe_image.load_lora_weights(lora_path, weight_name=weight_name, adapter_name=f"adapter_{adapter_timestamp}")
|
| 278 |
pipe_image.fuse_lora(lora_scale=1 / lora_rank)
|
| 279 |
pipe_image = pipe_image.to(device)
|
|
@@ -397,11 +398,9 @@ with gr.Blocks() as demo:
|
|
| 397 |
seed_value,
|
| 398 |
scale_status,
|
| 399 |
rife_status,
|
| 400 |
-
pipe_image,
|
| 401 |
progress=gr.Progress(track_tqdm=True)
|
| 402 |
):
|
| 403 |
latents, seed = infer(
|
| 404 |
-
pipe_image,
|
| 405 |
prompt,
|
| 406 |
orbit_type,
|
| 407 |
image_input,
|
|
@@ -440,7 +439,7 @@ with gr.Blocks() as demo:
|
|
| 440 |
|
| 441 |
generate_button.click(
|
| 442 |
generate,
|
| 443 |
-
inputs=[prompt, orbit_type, image_in, seed_param, enable_scale, enable_rife
|
| 444 |
outputs=[video_output, download_video_button, download_gif_button, seed_text],
|
| 445 |
)
|
| 446 |
|
|
|
|
| 242 |
|
| 243 |
@spaces.GPU
|
| 244 |
def infer(
|
|
|
|
| 245 |
prompt: str,
|
| 246 |
orbit_type: str,
|
| 247 |
image_input: str,
|
|
|
|
| 273 |
adapter_timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
| 274 |
|
| 275 |
# Load LoRA weights on CPU
|
| 276 |
+
global pipe_image
|
| 277 |
+
|
| 278 |
pipe_image.load_lora_weights(lora_path, weight_name=weight_name, adapter_name=f"adapter_{adapter_timestamp}")
|
| 279 |
pipe_image.fuse_lora(lora_scale=1 / lora_rank)
|
| 280 |
pipe_image = pipe_image.to(device)
|
|
|
|
| 398 |
seed_value,
|
| 399 |
scale_status,
|
| 400 |
rife_status,
|
|
|
|
| 401 |
progress=gr.Progress(track_tqdm=True)
|
| 402 |
):
|
| 403 |
latents, seed = infer(
|
|
|
|
| 404 |
prompt,
|
| 405 |
orbit_type,
|
| 406 |
image_input,
|
|
|
|
| 439 |
|
| 440 |
generate_button.click(
|
| 441 |
generate,
|
| 442 |
+
inputs=[prompt, orbit_type, image_in, seed_param, enable_scale, enable_rife],
|
| 443 |
outputs=[video_output, download_video_button, download_gif_button, seed_text],
|
| 444 |
)
|
| 445 |
|