Because the windows file name cannot have an *, replace the * with an x

This commit is contained in:
zhizhen man 2025-03-06 22:57:46 +08:00
parent 6797c48002
commit 9e47cce40f

View File

@ -384,7 +384,8 @@ def generate(args):
formatted_prompt = args.prompt.replace(" ", "_").replace("/",
"_")[:50]
suffix = '.png' if "t2i" in args.task else '.mp4'
args.save_file = f"{args.task}_{args.size}_{args.ulysses_size}_{args.ring_size}_{formatted_prompt}_{formatted_time}" + suffix
safe_size = args.size.replace("*", "x")
args.save_file = f"{args.task}_{safe_size}_{args.ulysses_size}_{args.ring_size}_{formatted_prompt}_{formatted_time}" + suffix
if "t2i" in args.task:
logging.info(f"Saving generated image to {args.save_file}")