MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / get_preprocess_parser

Function get_preprocess_parser

tools/preprocess/ltx2.3_preprocess_data.py:40–151  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38
39
40def get_preprocess_parser():
41 parser = argparse.ArgumentParser(description="LTX-2.3 IC-LoRA control-video preprocessing (pose / canny / depth) for v2av.")
42
43 parser.add_argument(
44 "--mode",
45 type=str,
46 default="pose",
47 choices=["pose", "canny", "depth"],
48 help="pose: DWPose skeleton (needs --ckpt_path). canny: OpenCV Canny edges (Union-Control). depth: MiDaS-small monocular depth via torch.hub (Union-Control; first run downloads weights).",
49 )
50
51 parser.add_argument(
52 "--ckpt_path",
53 type=str,
54 default=None,
55 help="Required when --mode pose: DWPose ONNX root with det/yolox_l.onnx and pose2d/dw-ll_ucoco_384.onnx (see yzd-v/DWPose). Ignored for canny/depth.",
56 )
57
58 parser.add_argument("--video_path", type=str, default=None, help="The path to the driving video.")
59 parser.add_argument(
60 "--refer_path",
61 type=str,
62 default=None,
63 help="Optional path to the character/reference image (the human appearance the "
64 "downstream LTX-2.3 v2av task will animate). When provided, the skeleton canvas "
65 "aspect ratio is taken from this image; source video "
66 "frames are letterboxed into the canvas before DWPose runs. This guarantees a "
67 "portrait image yields a portrait output, etc. When omitted, the canvas falls "
68 "back to the source video aspect ratio.",
69 )
70 parser.add_argument(
71 "--save_path",
72 type=str,
73 default=None,
74 help="Output control video (.mp4). If a directory is given, writes pose_skeleton.mp4 / canny_control.mp4 / depth_control.mp4 depending on --mode.",
75 )
76
77 parser.add_argument(
78 "--resolution_area",
79 type=int,
80 nargs=2,
81 default=[1280, 720],
82 help="The target resolution area for the skeleton video, specified as "
83 "[width, height]. The video (or, if --refer_path is given, the image) is "
84 "resized to have a total area equivalent to width * height while preserving "
85 "its original aspect ratio. Both dimensions are snapped to a multiple of 32 "
86 "for LTX-2.3.",
87 )
88 parser.add_argument(
89 "--fps",
90 type=int,
91 default=24,
92 help="Target FPS for the output skeleton video. Set to -1 to keep the source FPS. LTX-2.3 IC-LoRA is typically trained at 24 FPS.",
93 )
94 parser.add_argument(
95 "--num_frames",
96 type=int,
97 default=-1,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected