()
| 58 | |
| 59 | |
| 60 | def _parse_args(): |
| 61 | parser = argparse.ArgumentParser( |
| 62 | description="Generate a image or video from a text prompt or image using Wan" |
| 63 | ) |
| 64 | parser.add_argument( |
| 65 | "--task", |
| 66 | type=str, |
| 67 | default="multitalk-14B", |
| 68 | choices=list(WAN_CONFIGS.keys()), |
| 69 | help="The task to run.") |
| 70 | parser.add_argument( |
| 71 | "--size", |
| 72 | type=str, |
| 73 | default="multitalk-480", |
| 74 | choices=list(SIZE_CONFIGS.keys()), |
| 75 | help="The buckget size of the generated video. The aspect ratio of the output video will follow that of the input image." |
| 76 | ) |
| 77 | parser.add_argument( |
| 78 | "--frame_num", |
| 79 | type=int, |
| 80 | default=81, |
| 81 | help="How many frames to be generated in one clip. The number should be 4n+1" |
| 82 | ) |
| 83 | parser.add_argument( |
| 84 | "--ckpt_dir", |
| 85 | type=str, |
| 86 | default=None, |
| 87 | help="The path to the Wan checkpoint directory.") |
| 88 | parser.add_argument( |
| 89 | "--quant_dir", |
| 90 | type=str, |
| 91 | default=None, |
| 92 | help="The path to the Wan quant checkpoint directory.") |
| 93 | parser.add_argument( |
| 94 | "--wav2vec_dir", |
| 95 | type=str, |
| 96 | default=None, |
| 97 | help="The path to the wav2vec checkpoint directory.") |
| 98 | parser.add_argument( |
| 99 | "--lora_dir", |
| 100 | type=str, |
| 101 | nargs='+', |
| 102 | default=None, |
| 103 | help="The paths to the LoRA checkpoint files." |
| 104 | ) |
| 105 | parser.add_argument( |
| 106 | "--lora_scale", |
| 107 | type=float, |
| 108 | nargs='+', |
| 109 | default=[1.2], |
| 110 | help="Controls how much to influence the outputs with the LoRA parameters. Accepts multiple float values." |
| 111 | ) |
| 112 | parser.add_argument( |
| 113 | "--offload_model", |
| 114 | type=str2bool, |
| 115 | default=None, |
| 116 | help="Whether to offload the model to CPU after each model forward, reducing GPU memory usage." |
| 117 | ) |
no test coverage detected