Spaces:
Runtime error
Runtime error
LORA params
Browse files
app.py
CHANGED
|
@@ -811,7 +811,10 @@ def worker_video(input_video, prompts, n_prompt, seed, batch, resolution, total_
|
|
| 811 |
stream.output_queue.push(('end', None))
|
| 812 |
return
|
| 813 |
|
| 814 |
-
def get_duration(input_image, image_position, prompts, generation_mode, n_prompt, seed, resolution, total_second_length, latent_window_size, steps, cfg, gs, rs, gpu_memory_preservation, enable_preview, use_teacache, mp4_crf
|
|
|
|
|
|
|
|
|
|
| 815 |
global total_second_length_debug_value
|
| 816 |
|
| 817 |
if total_second_length_debug_value is not None:
|
|
@@ -838,7 +841,10 @@ def process_on_gpu(input_image,
|
|
| 838 |
gpu_memory_preservation=6,
|
| 839 |
enable_preview=True,
|
| 840 |
use_teacache=False,
|
| 841 |
-
mp4_crf=16
|
|
|
|
|
|
|
|
|
|
| 842 |
):
|
| 843 |
start = time.time()
|
| 844 |
global stream
|
|
@@ -936,10 +942,16 @@ def process(input_image,
|
|
| 936 |
gpu_memory_preservation,
|
| 937 |
enable_preview,
|
| 938 |
use_teacache,
|
| 939 |
-
mp4_crf
|
|
|
|
|
|
|
|
|
|
| 940 |
)
|
| 941 |
|
| 942 |
-
def get_duration_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
|
|
|
|
|
|
|
|
|
|
| 943 |
global total_second_length_debug_value
|
| 944 |
if total_second_length_debug_value is not None:
|
| 945 |
duration = min(total_second_length_debug_value * 60 * 10, 600)
|
|
@@ -949,7 +961,10 @@ def get_duration_video(input_video, prompts, n_prompt, seed, batch, resolution,
|
|
| 949 |
|
| 950 |
# Remove this decorator if you run on local
|
| 951 |
@spaces.GPU(duration=get_duration_video)
|
| 952 |
-
def process_video_on_gpu(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
|
|
|
|
|
|
|
|
|
|
| 953 |
start = time.time()
|
| 954 |
global stream
|
| 955 |
stream = AsyncStream()
|
|
@@ -1021,7 +1036,10 @@ def process_video(input_video, prompt, n_prompt, randomize_seed, seed, batch, re
|
|
| 1021 |
if cfg > 1:
|
| 1022 |
gs = 1
|
| 1023 |
|
| 1024 |
-
yield from process_video_on_gpu(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
|
|
|
|
|
|
|
|
|
|
| 1025 |
|
| 1026 |
def end_process():
|
| 1027 |
stream.input_queue.push('end')
|
|
|
|
| 811 |
stream.output_queue.push(('end', None))
|
| 812 |
return
|
| 813 |
|
| 814 |
+
def get_duration(input_image, image_position, prompts, generation_mode, n_prompt, seed, resolution, total_second_length, latent_window_size, steps, cfg, gs, rs, gpu_memory_preservation, enable_preview, use_teacache, mp4_crf,
|
| 815 |
+
lora_file,
|
| 816 |
+
lora_multiplier,
|
| 817 |
+
fp8_optimization):
|
| 818 |
global total_second_length_debug_value
|
| 819 |
|
| 820 |
if total_second_length_debug_value is not None:
|
|
|
|
| 841 |
gpu_memory_preservation=6,
|
| 842 |
enable_preview=True,
|
| 843 |
use_teacache=False,
|
| 844 |
+
mp4_crf=16,
|
| 845 |
+
lora_file=None,
|
| 846 |
+
lora_multiplier=0.8,
|
| 847 |
+
fp8_optimization=False
|
| 848 |
):
|
| 849 |
start = time.time()
|
| 850 |
global stream
|
|
|
|
| 942 |
gpu_memory_preservation,
|
| 943 |
enable_preview,
|
| 944 |
use_teacache,
|
| 945 |
+
mp4_crf,
|
| 946 |
+
lora_file,
|
| 947 |
+
lora_multiplier,
|
| 948 |
+
fp8_optimization
|
| 949 |
)
|
| 950 |
|
| 951 |
+
def get_duration_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,
|
| 952 |
+
lora_file,
|
| 953 |
+
lora_multiplier,
|
| 954 |
+
fp8_optimization):
|
| 955 |
global total_second_length_debug_value
|
| 956 |
if total_second_length_debug_value is not None:
|
| 957 |
duration = min(total_second_length_debug_value * 60 * 10, 600)
|
|
|
|
| 961 |
|
| 962 |
# Remove this decorator if you run on local
|
| 963 |
@spaces.GPU(duration=get_duration_video)
|
| 964 |
+
def process_video_on_gpu(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,
|
| 965 |
+
lora_file,
|
| 966 |
+
lora_multiplier,
|
| 967 |
+
fp8_optimization):
|
| 968 |
start = time.time()
|
| 969 |
global stream
|
| 970 |
stream = AsyncStream()
|
|
|
|
| 1036 |
if cfg > 1:
|
| 1037 |
gs = 1
|
| 1038 |
|
| 1039 |
+
yield from process_video_on_gpu(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,
|
| 1040 |
+
lora_file,
|
| 1041 |
+
lora_multiplier,
|
| 1042 |
+
fp8_optimization)
|
| 1043 |
|
| 1044 |
def end_process():
|
| 1045 |
stream.input_queue.push('end')
|