mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-07-09 17:08:33 +00:00
add fps controls
This commit is contained in:
parent
272c1ee232
commit
48a6d161a5
4 changed files with 30 additions and 23 deletions
File diff suppressed because one or more lines are too long
1
expose.h
1
expose.h
|
|
@ -238,6 +238,7 @@ struct sd_generation_inputs
|
|||
const float eta = -1.0f;
|
||||
const int clip_skip = -1;
|
||||
const int vid_req_frames = 1;
|
||||
const int vid_fps = 16;
|
||||
const int video_output_type = 0; //0=gif, 1=avi, 2=both
|
||||
const bool remove_limits = false;
|
||||
const bool circular_x = false;
|
||||
|
|
|
|||
|
|
@ -421,6 +421,7 @@ class sd_generation_inputs(ctypes.Structure):
|
|||
("eta", ctypes.c_float),
|
||||
("clip_skip", ctypes.c_int),
|
||||
("vid_req_frames", ctypes.c_int),
|
||||
("vid_fps", ctypes.c_int),
|
||||
("video_output_type", ctypes.c_int),
|
||||
("remove_limits", ctypes.c_bool),
|
||||
("circular_x", ctypes.c_bool),
|
||||
|
|
@ -2788,6 +2789,7 @@ def sd_generate(genparams):
|
|||
eta = tryparsefloat(genparams.get("eta", None), None)
|
||||
vid_req_frames = tryparseint(genparams.get("frames", 1),1)
|
||||
vid_req_frames = 1 if (not vid_req_frames or vid_req_frames < 1) else vid_req_frames
|
||||
vid_fps = tryparseint(genparams.get("fps", 16),16)
|
||||
video_output_type = genparams.get("video_output_type", 0)
|
||||
cache_mode = str(genparams.get("cache_mode", ""))
|
||||
cache_options = str(genparams.get("cache_options", ""))
|
||||
|
|
@ -2807,6 +2809,7 @@ def sd_generate(genparams):
|
|||
flow_shift = None # fall back to the default
|
||||
sample_steps = (1 if sample_steps < 1 else (forced_steplimit if sample_steps > forced_steplimit else sample_steps))
|
||||
vid_req_frames = (1 if vid_req_frames < 1 else (120 if vid_req_frames > 120 else vid_req_frames))
|
||||
vid_fps = (16 if vid_fps < 16 else (24 if vid_fps > 24 else vid_fps))
|
||||
|
||||
swap_refimg = (True if tryparseint(genparams.get("send_as_refimg", 0),0) else False)
|
||||
if len(extra_images_arr)==0 and swap_refimg and init_images and init_images!="" and not mask:
|
||||
|
|
@ -2841,6 +2844,7 @@ def sd_generate(genparams):
|
|||
inputs.eta = -1.0 if eta is None else eta
|
||||
inputs.clip_skip = clip_skip
|
||||
inputs.vid_req_frames = vid_req_frames
|
||||
inputs.vid_fps = vid_fps
|
||||
inputs.video_output_type = video_output_type
|
||||
inputs.remove_limits = allow_remove_limits
|
||||
inputs.circular_x = tryparseint(adapter_obj.get("circular_x", genparams.get("circular_x",0)),0)
|
||||
|
|
|
|||
|
|
@ -1339,6 +1339,7 @@ sd_generation_outputs sdtype_generate(const sd_generation_inputs inputs)
|
|||
int vid_req_frames = inputs.vid_req_frames;
|
||||
int video_output_type = inputs.video_output_type;
|
||||
int generated_num_results = 1;
|
||||
int vid_fps = inputs.vid_fps;
|
||||
remove_limits = inputs.remove_limits;
|
||||
|
||||
//special case, is img2img and denoise strength is 0 and steps is 1, do a passthru
|
||||
|
|
@ -1361,6 +1362,7 @@ sd_generation_outputs sdtype_generate(const sd_generation_inputs inputs)
|
|||
vid_gen_params.strength = params.strength;
|
||||
vid_gen_params.seed = params.seed;
|
||||
vid_gen_params.video_frames = vid_req_frames;
|
||||
vid_gen_params.fps = vid_fps;
|
||||
if(wan_imgs.size()>0)
|
||||
{
|
||||
if(wan_imgs.size()>=1)
|
||||
|
|
@ -1564,11 +1566,11 @@ sd_generation_outputs sdtype_generate(const sd_generation_inputs inputs)
|
|||
|
||||
if(video_output_type==0 || video_output_type==2)
|
||||
{
|
||||
status = create_gif_buf_from_sd_images_msf(results, generated_num_results, 16, &out_data,&out_len);
|
||||
status = create_gif_buf_from_sd_images_msf(results, generated_num_results, vid_fps, &out_data,&out_len);
|
||||
}
|
||||
if(video_output_type==1 || video_output_type==2)
|
||||
{
|
||||
status2 = create_mjpg_avi_membuf_from_sd_images(results, generated_num_results, 16, 40, &out_data2,&out_len2, generated_audio);
|
||||
status2 = create_mjpg_avi_membuf_from_sd_images(results, generated_num_results, vid_fps, 40, &out_data2,&out_len2, generated_audio);
|
||||
}
|
||||
|
||||
if(!sd_is_quiet && sddebugmode==1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue