Spaces:
Runtime error
Runtime error
LORA
Browse files
app.py
CHANGED
|
@@ -308,7 +308,10 @@ def set_mp4_comments_imageio_ffmpeg(input_file, comments):
|
|
| 308 |
return False
|
| 309 |
|
| 310 |
@torch.no_grad()
|
| 311 |
-
def worker(input_image, image_position, prompts, n_prompt, seed, resolution, total_second_length, latent_window_size, steps, cfg, gs, rs, gpu_memory_preservation, enable_preview, use_teacache, mp4_crf
|
|
|
|
|
|
|
|
|
|
| 312 |
is_last_frame = (image_position == 100)
|
| 313 |
def encode_prompt(prompt, n_prompt):
|
| 314 |
llama_vec, clip_l_pooler = encode_prompt_conds(prompt, text_encoder, text_encoder_2, tokenizer, tokenizer_2)
|
|
@@ -544,7 +547,10 @@ def worker(input_image, image_position, prompts, n_prompt, seed, resolution, tot
|
|
| 544 |
|
| 545 |
# 20250506 pftq: Modified worker to accept video input and clean frame count
|
| 546 |
@torch.no_grad()
|
| 547 |
-
def worker_video(input_video, prompts, n_prompt, seed, batch, resolution, total_second_length, latent_window_size, steps, cfg, gs, rs, gpu_memory_preservation, enable_preview, use_teacache, no_resize, mp4_crf, num_clean_frames, vae_batch
|
|
|
|
|
|
|
|
|
|
| 548 |
def encode_prompt(prompt, n_prompt):
|
| 549 |
llama_vec, clip_l_pooler = encode_prompt_conds(prompt, text_encoder, text_encoder_2, tokenizer, tokenizer_2)
|
| 550 |
|
|
@@ -850,7 +856,10 @@ def process_on_gpu(input_image,
|
|
| 850 |
global stream
|
| 851 |
stream = AsyncStream()
|
| 852 |
|
| 853 |
-
async_run(worker, input_image, image_position, prompts, n_prompt, seed, resolution, total_second_length, latent_window_size, steps, cfg, gs, rs, gpu_memory_preservation, enable_preview, use_teacache, mp4_crf
|
|
|
|
|
|
|
|
|
|
| 854 |
|
| 855 |
output_filename = None
|
| 856 |
|
|
@@ -970,7 +979,10 @@ def process_video_on_gpu(input_video, prompts, n_prompt, seed, batch, resolution
|
|
| 970 |
stream = AsyncStream()
|
| 971 |
|
| 972 |
# 20250506 pftq: Pass num_clean_frames, vae_batch, etc
|
| 973 |
-
async_run(worker_video, input_video, prompts, n_prompt, seed, batch, resolution, total_second_length, latent_window_size, steps, cfg, gs, rs, gpu_memory_preservation, enable_preview, use_teacache, no_resize, mp4_crf, num_clean_frames, vae_batch
|
|
|
|
|
|
|
|
|
|
| 974 |
|
| 975 |
output_filename = None
|
| 976 |
|
|
|
|
| 308 |
return False
|
| 309 |
|
| 310 |
@torch.no_grad()
|
| 311 |
+
def worker(input_image, image_position, prompts, n_prompt, seed, resolution, total_second_length, latent_window_size, steps, cfg, gs, rs, gpu_memory_preservation, enable_preview, use_teacache, mp4_crf,
|
| 312 |
+
lora_file,
|
| 313 |
+
lora_multiplier,
|
| 314 |
+
fp8_optimization):
|
| 315 |
is_last_frame = (image_position == 100)
|
| 316 |
def encode_prompt(prompt, n_prompt):
|
| 317 |
llama_vec, clip_l_pooler = encode_prompt_conds(prompt, text_encoder, text_encoder_2, tokenizer, tokenizer_2)
|
|
|
|
| 547 |
|
| 548 |
# 20250506 pftq: Modified worker to accept video input and clean frame count
|
| 549 |
@torch.no_grad()
|
| 550 |
+
def worker_video(input_video, prompts, n_prompt, seed, batch, resolution, total_second_length, latent_window_size, steps, cfg, gs, rs, gpu_memory_preservation, enable_preview, use_teacache, no_resize, mp4_crf, num_clean_frames, vae_batch,
|
| 551 |
+
lora_file,
|
| 552 |
+
lora_multiplier,
|
| 553 |
+
fp8_optimization):
|
| 554 |
def encode_prompt(prompt, n_prompt):
|
| 555 |
llama_vec, clip_l_pooler = encode_prompt_conds(prompt, text_encoder, text_encoder_2, tokenizer, tokenizer_2)
|
| 556 |
|
|
|
|
| 856 |
global stream
|
| 857 |
stream = AsyncStream()
|
| 858 |
|
| 859 |
+
async_run(worker, input_image, image_position, prompts, n_prompt, seed, resolution, total_second_length, latent_window_size, steps, cfg, gs, rs, gpu_memory_preservation, enable_preview, use_teacache, mp4_crf,
|
| 860 |
+
lora_file,
|
| 861 |
+
lora_multiplier,
|
| 862 |
+
fp8_optimization)
|
| 863 |
|
| 864 |
output_filename = None
|
| 865 |
|
|
|
|
| 979 |
stream = AsyncStream()
|
| 980 |
|
| 981 |
# 20250506 pftq: Pass num_clean_frames, vae_batch, etc
|
| 982 |
+
async_run(worker_video, input_video, prompts, n_prompt, seed, batch, resolution, total_second_length, latent_window_size, steps, cfg, gs, rs, gpu_memory_preservation, enable_preview, use_teacache, no_resize, mp4_crf, num_clean_frames, vae_batch,
|
| 983 |
+
lora_file,
|
| 984 |
+
lora_multiplier,
|
| 985 |
+
fp8_optimization)
|
| 986 |
|
| 987 |
output_filename = None
|
| 988 |
|