From ba68cc5199e23476a9e4592977a24a232904ee59 Mon Sep 17 00:00:00 2001 From: Hugo Zanini Date: Sat, 30 Dec 2023 10:35:36 -0300 Subject: [PATCH] Update animate.py Adding `savedir` as a parameter for changing the saving folder externally. This will not break the existing code. --- demo/animate.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/demo/animate.py b/demo/animate.py index b71f1940..7b31a161 100644 --- a/demo/animate.py +++ b/demo/animate.py @@ -125,7 +125,7 @@ def __init__(self, config="configs/prompts/animation.yaml") -> None: print("Initialization Done!") - def __call__(self, source_image, motion_sequence, random_seed, step, guidance_scale, size=512): + def __call__(self, source_image, motion_sequence, random_seed, step, guidance_scale, size=512, savedir = f"demo/outputs"): prompt = n_prompt = "" random_seed = int(random_seed) step = int(step) @@ -185,11 +185,10 @@ def __call__(self, source_image, motion_sequence, random_seed, step, guidance_sc samples_per_video = torch.cat(samples_per_video) time_str = datetime.datetime.now().strftime("%Y-%m-%dT%H-%M-%S") - savedir = f"demo/outputs" animation_path = f"{savedir}/{time_str}.mp4" os.makedirs(savedir, exist_ok=True) save_videos_grid(samples_per_video, animation_path) return animation_path - \ No newline at end of file +