()
| 60 | |
| 61 | |
| 62 | def _parse_args(): |
| 63 | parser = argparse.ArgumentParser( |
| 64 | description="Generate a image or video from a text prompt or image using Wan" |
| 65 | ) |
| 66 | parser.add_argument( |
| 67 | "--task", |
| 68 | type=str, |
| 69 | default="infinitetalk-14B", |
| 70 | choices=list(WAN_CONFIGS.keys()), |
| 71 | help="The task to run.") |
| 72 | parser.add_argument( |
| 73 | "--size", |
| 74 | type=str, |
| 75 | default="infinitetalk-480", |
| 76 | choices=list(SIZE_CONFIGS.keys()), |
| 77 | help="The buckget size of the generated video. The aspect ratio of the output video will follow that of the input image." |
| 78 | ) |
| 79 | parser.add_argument( |
| 80 | "--frame_num", |
| 81 | type=int, |
| 82 | default=81, |
| 83 | help="How many frames to be generated in one clip. The number should be 4n+1" |
| 84 | ) |
| 85 | parser.add_argument( |
| 86 | "--max_frame_num", |
| 87 | type=int, |
| 88 | default=1000, |
| 89 | help="The max frame lenght of the generated video." |
| 90 | ) |
| 91 | parser.add_argument( |
| 92 | "--ckpt_dir", |
| 93 | type=str, |
| 94 | default=None, |
| 95 | help="The path to the Wan checkpoint directory.") |
| 96 | parser.add_argument( |
| 97 | "--infinitetalk_dir", |
| 98 | type=str, |
| 99 | default=None, |
| 100 | help="The path to the InfiniteTalk checkpoint directory.") |
| 101 | parser.add_argument( |
| 102 | "--quant_dir", |
| 103 | type=str, |
| 104 | default=None, |
| 105 | help="The path to the Wan quant checkpoint directory.") |
| 106 | parser.add_argument( |
| 107 | "--wav2vec_dir", |
| 108 | type=str, |
| 109 | default=None, |
| 110 | help="The path to the wav2vec checkpoint directory.") |
| 111 | parser.add_argument( |
| 112 | "--dit_path", |
| 113 | type=str, |
| 114 | default=None, |
| 115 | help="The path to the Wan checkpoint directory.") |
| 116 | parser.add_argument( |
| 117 | "--lora_dir", |
| 118 | type=str, |
| 119 | nargs='+', |
no test coverage detected