Skip to content

Commit

Permalink
Fix save_path problem when batch infer
Browse files Browse the repository at this point in the history
  • Loading branch information
ckczzj authored Jan 24, 2025
1 parent 17400d8 commit 0d44cc0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sample_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def main():

# Create save folder to save the samples
save_path = args.save_path if args.save_path_suffix=="" else f'{args.save_path}_{args.save_path_suffix}'
if not os.path.exists(args.save_path):
if not os.path.exists(save_path):
os.makedirs(save_path, exist_ok=True)

# Load models
Expand Down Expand Up @@ -50,9 +50,9 @@ def main():
for i, sample in enumerate(samples):
sample = samples[i].unsqueeze(0)
time_flag = datetime.fromtimestamp(time.time()).strftime("%Y-%m-%d-%H:%M:%S")
save_path = f"{save_path}/{time_flag}_seed{outputs['seeds'][i]}_{outputs['prompts'][i][:100].replace('/','')}.mp4"
save_videos_grid(sample, save_path, fps=24)
logger.info(f'Sample save to: {save_path}')
cur_save_path = f"{save_path}/{time_flag}_seed{outputs['seeds'][i]}_{outputs['prompts'][i][:100].replace('/','')}.mp4"
save_videos_grid(sample, cur_save_path, fps=24)
logger.info(f'Sample save to: {cur_save_path}')

if __name__ == "__main__":
main()

0 comments on commit 0d44cc0

Please sign in to comment.