diff --git a/imaginairy/cli/videogen.py b/imaginairy/cli/videogen.py index 38d5dece..1a5700bb 100644 --- a/imaginairy/cli/videogen.py +++ b/imaginairy/cli/videogen.py @@ -74,18 +74,21 @@ def videogen_cmd( configure_logging() output_fps = output_fps or fps - - generate_video( - input_path=start_image, - num_frames=num_frames, - num_steps=steps, - model_name=model, - fps_id=fps, - output_fps=output_fps, - motion_bucket_id=motion_amount, - cond_aug=cond_aug, - seed=seed, - decoding_t=decoding_t, - output_folder=output_folder, - repetitions=repeats, - ) + try: + generate_video( + input_path=start_image, + num_frames=num_frames, + num_steps=steps, + model_name=model, + fps_id=fps, + output_fps=output_fps, + motion_bucket_id=motion_amount, + cond_aug=cond_aug, + seed=seed, + decoding_t=decoding_t, + output_folder=output_folder, + repetitions=repeats, + ) + except FileNotFoundError as e: + logger.error(str(e)) + exit(1) diff --git a/imaginairy/video_sample.py b/imaginairy/video_sample.py index 9fbd5aeb..c7a363b8 100644 --- a/imaginairy/video_sample.py +++ b/imaginairy/video_sample.py @@ -96,7 +96,8 @@ def generate_video( if len(all_img_paths) == 0: raise ValueError("Folder does not contain any images.") else: - raise ValueError + msg = f"Could not find file or folder at {input_path}" + raise FileNotFoundError(msg) expected_size = (1024, 576) for _ in range(repetitions):