mirror of
https://github.com/Sygil-Dev/sygil-webui.git
synced 2025-01-05 19:04:06 +03:00
Added option to set the FPS on the txt2vid tab. (#1680)
This commit is contained in:
commit
2bbd9300a3
@ -220,6 +220,7 @@ txt2vid:
|
|||||||
|
|
||||||
beta_scheduler_type: "scaled_linear"
|
beta_scheduler_type: "scaled_linear"
|
||||||
max_duration_in_seconds: 30
|
max_duration_in_seconds: 30
|
||||||
|
fps: 30
|
||||||
|
|
||||||
LDSR_config:
|
LDSR_config:
|
||||||
sampling_steps: 50
|
sampling_steps: 50
|
||||||
|
@ -189,10 +189,10 @@ def make_video_pyav(
|
|||||||
|
|
||||||
write_video(
|
write_video(
|
||||||
output_filepath,
|
output_filepath,
|
||||||
frames,
|
frames,
|
||||||
fps=fps,
|
fps=fps,
|
||||||
audio_array=audio_tensor,
|
audio_array=audio_tensor,
|
||||||
audio_fps=sr,
|
audio_fps=sr,
|
||||||
audio_codec="aac",
|
audio_codec="aac",
|
||||||
options={"crf": "10", "pix_fmt": "yuv420p"},
|
options={"crf": "10", "pix_fmt": "yuv420p"},
|
||||||
)
|
)
|
||||||
@ -777,22 +777,22 @@ class StableDiffusionWalkPipeline(DiffusionPipeline):
|
|||||||
prompt_config_path.write_text(
|
prompt_config_path.write_text(
|
||||||
json.dumps(
|
json.dumps(
|
||||||
dict(
|
dict(
|
||||||
prompts=prompts,
|
prompts=prompts,
|
||||||
seeds=seeds,
|
seeds=seeds,
|
||||||
num_interpolation_steps=num_interpolation_steps,
|
num_interpolation_steps=num_interpolation_steps,
|
||||||
fps=fps,
|
fps=fps,
|
||||||
num_inference_steps=num_inference_steps,
|
num_inference_steps=num_inference_steps,
|
||||||
guidance_scale=guidance_scale,
|
guidance_scale=guidance_scale,
|
||||||
eta=eta,
|
eta=eta,
|
||||||
upsample=upsample,
|
upsample=upsample,
|
||||||
height=height,
|
height=height,
|
||||||
width=width,
|
width=width,
|
||||||
audio_filepath=audio_filepath,
|
audio_filepath=audio_filepath,
|
||||||
audio_start_sec=audio_start_sec,
|
audio_start_sec=audio_start_sec,
|
||||||
),
|
),
|
||||||
|
|
||||||
indent=2,
|
indent=2,
|
||||||
sort_keys=False,
|
sort_keys=False,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
@ -1637,6 +1637,9 @@ def layout():
|
|||||||
|
|
||||||
st.session_state["max_duration_in_seconds"] = st.number_input("Max Duration In Seconds:", value=st.session_state['defaults'].txt2vid.max_duration_in_seconds,
|
st.session_state["max_duration_in_seconds"] = st.number_input("Max Duration In Seconds:", value=st.session_state['defaults'].txt2vid.max_duration_in_seconds,
|
||||||
help="Specify the max duration in seconds you want your video to be.")
|
help="Specify the max duration in seconds you want your video to be.")
|
||||||
|
|
||||||
|
st.session_state["fps"] = st.number_input("Frames per Second (FPS):", value=st.session_state['defaults'].txt2vid.fps,
|
||||||
|
help="Specify the frame rate of the video.")
|
||||||
|
|
||||||
with st.expander("Preview Settings"):
|
with st.expander("Preview Settings"):
|
||||||
#st.session_state["update_preview"] = st.checkbox("Update Image Preview", value=st.session_state['defaults'].txt2vid.update_preview,
|
#st.session_state["update_preview"] = st.checkbox("Update Image Preview", value=st.session_state['defaults'].txt2vid.update_preview,
|
||||||
@ -1903,16 +1906,16 @@ def layout():
|
|||||||
# run video generation
|
# run video generation
|
||||||
video, seed, info, stats = txt2vid(prompts=prompt, gpu=st.session_state["defaults"].general.gpu,
|
video, seed, info, stats = txt2vid(prompts=prompt, gpu=st.session_state["defaults"].general.gpu,
|
||||||
num_steps=st.session_state.sampling_steps, max_duration_in_seconds=st.session_state.max_duration_in_seconds,
|
num_steps=st.session_state.sampling_steps, max_duration_in_seconds=st.session_state.max_duration_in_seconds,
|
||||||
num_inference_steps=st.session_state.num_inference_steps,
|
num_inference_steps=st.session_state.num_inference_steps,
|
||||||
cfg_scale=cfg_scale, save_video_on_stop=save_video_on_stop,
|
cfg_scale=cfg_scale, save_video_on_stop=save_video_on_stop,
|
||||||
outdir=st.session_state["defaults"].general.outdir,
|
outdir=st.session_state["defaults"].general.outdir,
|
||||||
do_loop=st.session_state["do_loop"],
|
do_loop=st.session_state["do_loop"],
|
||||||
use_lerp_for_text=st.session_state["use_lerp_for_text"],
|
use_lerp_for_text=st.session_state["use_lerp_for_text"],
|
||||||
seeds=seed, quality=100, eta=0.0, width=width,
|
seeds=seed, quality=100, eta=0.0, width=width,
|
||||||
height=height, weights_path=custom_model, scheduler=scheduler_name,
|
height=height, weights_path=custom_model, scheduler=scheduler_name,
|
||||||
disable_tqdm=False, beta_start=st.session_state['defaults'].txt2vid.beta_start.value,
|
disable_tqdm=False, beta_start=st.session_state['defaults'].txt2vid.beta_start.value,
|
||||||
beta_end=st.session_state['defaults'].txt2vid.beta_end.value,
|
beta_end=st.session_state['defaults'].txt2vid.beta_end.value,
|
||||||
beta_schedule=beta_scheduler_type, starting_image=None)
|
beta_schedule=beta_scheduler_type, starting_image=None, fps=st.session_state.fps)
|
||||||
|
|
||||||
if video and save_video_on_stop:
|
if video and save_video_on_stop:
|
||||||
if os.path.exists(video): # temporary solution to bypass exception
|
if os.path.exists(video): # temporary solution to bypass exception
|
||||||
|
Loading…
Reference in New Issue
Block a user