Skip to content

Commit

Permalink
Update video_utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
costiash authored Nov 11, 2022
1 parent d6a74bb commit 92aa668
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion stable_diffusion_tf/video_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def generate_frames_translation(ax_trans, max_num_frames):
str_for_parse_key_frames = f"0:({ax_trans})"
key_frames = parse_key_frames(str_for_parse_key_frames)
frames_translation_values = get_inbetweens(key_frames, max_num_frames)
return frames_translation_values.to_dict()
return frames_translation_values


def create_prompts_frames_dict(first_prompt, first_frame=0, second_prompt=None, second_frame=None, third_prompt=None, third_frame=None, fourth_prompt=None, fourth_frame=None):
Expand Down Expand Up @@ -210,6 +210,20 @@ def create_prompt_iprompt_seq(args, prompts_frames_dict):
return prompt_iprompt_seq_lst


def generate_init_frame(curr_prompt, args, generator):
img = generator.generate(
curr_prompt,
seed=args['seed'],
num_steps=40,
unconditional_guidance_scale=7,
temperature=1,
batch_size=1,
)

next_seed(args)
return img[0]


def construct_ffmpeg_video_cmd(args, frames_path, mp4_path):
fps = args['fps']
max_frames = args['maximum_number_of_frames']
Expand Down

0 comments on commit 92aa668

Please sign in to comment.