Spaces:
Build error
Build error
Haoxin Chen
commited on
Commit
·
8cdb359
1
Parent(s):
8531aba
set max_sample_step to 60
Browse files- app.py +2 -2
- videocontrol_test.py +2 -0
- videocrafter_test.py +3 -1
app.py
CHANGED
@@ -34,7 +34,7 @@ def videocrafter_demo(result_dir='./tmp/'):
|
|
34 |
with gr.Row():
|
35 |
model_index = gr.Dropdown(label='Models', elem_id=f"model", choices=model_choices, value=model_choices[0], type="index",interactive=True)
|
36 |
with gr.Row():
|
37 |
-
steps = gr.Slider(minimum=1, maximum=
|
38 |
eta = gr.Slider(minimum=0.0, maximum=1.0, step=0.1, label='ETA', value=1.0, elem_id="eta")
|
39 |
with gr.Row():
|
40 |
lora_scale = gr.Slider(minimum=0.0, maximum=2.0, step=0.1, label='Lora Scale', value=1.0, elem_id="lora_scale")
|
@@ -68,7 +68,7 @@ def videocrafter_demo(result_dir='./tmp/'):
|
|
68 |
vc_eta = gr.Slider(minimum=0.0, maximum=1.0, step=0.1, label='ETA', value=1.0, elem_id="vc_eta")
|
69 |
vc_cfg_scale = gr.Slider(minimum=1.0, maximum=30.0, step=0.5, label='CFG Scale', value=15.0, elem_id="vc_cfg_scale")
|
70 |
with gr.Row():
|
71 |
-
vc_steps = gr.Slider(minimum=1, maximum=
|
72 |
frame_stride = gr.Slider(minimum=0 , maximum=100, step=1, label='Frame Stride', value=0, elem_id="vc_frame_stride")
|
73 |
|
74 |
vc_end_btn = gr.Button("Send")
|
|
|
34 |
with gr.Row():
|
35 |
model_index = gr.Dropdown(label='Models', elem_id=f"model", choices=model_choices, value=model_choices[0], type="index",interactive=True)
|
36 |
with gr.Row():
|
37 |
+
steps = gr.Slider(minimum=1, maximum=60, step=1, elem_id=f"steps", label="Sampling steps", value=50)
|
38 |
eta = gr.Slider(minimum=0.0, maximum=1.0, step=0.1, label='ETA', value=1.0, elem_id="eta")
|
39 |
with gr.Row():
|
40 |
lora_scale = gr.Slider(minimum=0.0, maximum=2.0, step=0.1, label='Lora Scale', value=1.0, elem_id="lora_scale")
|
|
|
68 |
vc_eta = gr.Slider(minimum=0.0, maximum=1.0, step=0.1, label='ETA', value=1.0, elem_id="vc_eta")
|
69 |
vc_cfg_scale = gr.Slider(minimum=1.0, maximum=30.0, step=0.5, label='CFG Scale', value=15.0, elem_id="vc_cfg_scale")
|
70 |
with gr.Row():
|
71 |
+
vc_steps = gr.Slider(minimum=1, maximum=60, step=1, elem_id="vc_steps", label="Sampling steps", value=50)
|
72 |
frame_stride = gr.Slider(minimum=0 , maximum=100, step=1, label='Frame Stride', value=0, elem_id="vc_frame_stride")
|
73 |
|
74 |
vc_end_btn = gr.Button("Send")
|
videocontrol_test.py
CHANGED
@@ -63,6 +63,8 @@ class VideoControl:
|
|
63 |
self.spatial_transform = transforms_video.CenterCropVideo(self.resolution)
|
64 |
|
65 |
def get_video(self, input_video, input_prompt, frame_stride=0, vc_steps=50, vc_cfg_scale=15.0, vc_eta=1.0):
|
|
|
|
|
66 |
## load video
|
67 |
print("input video", input_video)
|
68 |
info_str = ''
|
|
|
63 |
self.spatial_transform = transforms_video.CenterCropVideo(self.resolution)
|
64 |
|
65 |
def get_video(self, input_video, input_prompt, frame_stride=0, vc_steps=50, vc_cfg_scale=15.0, vc_eta=1.0):
|
66 |
+
if vc_steps > 60:
|
67 |
+
vc_steps = 60
|
68 |
## load video
|
69 |
print("input video", input_video)
|
70 |
info_str = ''
|
videocrafter_test.py
CHANGED
@@ -19,8 +19,8 @@ def save_results(videos, save_dir,
|
|
19 |
npz_to_video_grid(videos[i:i+1,...],
|
20 |
os.path.join(save_subdir, f"{save_name}_{i:03d}.mp4"),
|
21 |
fps=save_fps)
|
22 |
-
print(f'Successfully saved videos in {save_subdir}')
|
23 |
video_path_list = [os.path.join(save_subdir, f"{save_name}_{i:03d}.mp4") for i in range(videos.shape[0])]
|
|
|
24 |
return video_path_list
|
25 |
|
26 |
|
@@ -45,6 +45,8 @@ class Text2Video():
|
|
45 |
self.origin_weight = None
|
46 |
|
47 |
def get_prompt(self, input_text, steps=50, model_index=0, eta=1.0, cfg_scale=15.0, lora_scale=1.0):
|
|
|
|
|
48 |
if model_index > 0:
|
49 |
input_text = input_text + ', ' + self.lora_trigger_word_list[model_index]
|
50 |
inject_lora = model_index > 0
|
|
|
19 |
npz_to_video_grid(videos[i:i+1,...],
|
20 |
os.path.join(save_subdir, f"{save_name}_{i:03d}.mp4"),
|
21 |
fps=save_fps)
|
|
|
22 |
video_path_list = [os.path.join(save_subdir, f"{save_name}_{i:03d}.mp4") for i in range(videos.shape[0])]
|
23 |
+
print(f'Successfully saved videos in {video_path_list[0]}')
|
24 |
return video_path_list
|
25 |
|
26 |
|
|
|
45 |
self.origin_weight = None
|
46 |
|
47 |
def get_prompt(self, input_text, steps=50, model_index=0, eta=1.0, cfg_scale=15.0, lora_scale=1.0):
|
48 |
+
if steps > 60:
|
49 |
+
steps = 60
|
50 |
if model_index > 0:
|
51 |
input_text = input_text + ', ' + self.lora_trigger_word_list[model_index]
|
52 |
inject_lora = model_index > 0
|