Some checks are pending
build-images / api (push) Waiting to run
build-images / worker-gpu (push) Waiting to run
build-images / web (push) Waiting to run
codeql / Analyze (javascript-typescript) (push) Waiting to run
codeql / Analyze (python) (push) Waiting to run
perf / API hot-path micro-smoke (budgeted) (push) Waiting to run
perf / Desktop engine crates (release build check) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Waiting to run
vision2026-ci / API phase modules (ruff + pytest) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Waiting to run
vision2026-ci / Python SDK resource tests (push) Waiting to run
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Waiting to run
vision2026-ci / Alembic upgrade + drift check (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Waiting to run
Paid, hosted product at menivor.com, now retired as a company project. Fresh squashed history of the cleaned working tree (secret-scanned, no .env, no customer data, no outreach logs). Built on MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
58 lines
2.0 KiB
Python
58 lines
2.0 KiB
Python
import torch
|
|
import argparse
|
|
import importlib
|
|
from typing import Dict, Any
|
|
|
|
def load_parser(module_name: str) -> argparse.ArgumentParser:
|
|
module = importlib.import_module(module_name)
|
|
if not hasattr(module, "get_parser"):
|
|
raise ValueError(f"{module_name} undefined get_parser()")
|
|
return module.get_parser()
|
|
|
|
def filter_args(args: Dict[str, Any], parser: argparse.ArgumentParser) -> Dict[str, Any]:
|
|
known_args = set()
|
|
for action in parser._actions:
|
|
if action.dest and action.dest != "help":
|
|
known_args.add(action.dest)
|
|
return {k: v for k, v in args.items() if k in known_args}
|
|
|
|
def main():
|
|
|
|
main_parser = argparse.ArgumentParser()
|
|
main_parser.add_argument("--base", type=str, default='ltx', choices=['ltx', 'wan'])
|
|
pipeline_args, _ = main_parser.parse_known_args()
|
|
|
|
if pipeline_args.base in ["ltx"]:
|
|
preproccess_name, inference_name = "vace_preproccess", "vace_ltx_inference"
|
|
else:
|
|
preproccess_name, inference_name = "vace_preproccess", "vace_wan_inference"
|
|
|
|
preprocess_parser = load_parser(preproccess_name)
|
|
inference_parser = load_parser(inference_name)
|
|
|
|
for parser in [preprocess_parser, inference_parser]:
|
|
for action in parser._actions:
|
|
if action.dest != "help":
|
|
main_parser._add_action(action)
|
|
|
|
cli_args = main_parser.parse_args()
|
|
args_dict = vars(cli_args)
|
|
|
|
# run preprocess
|
|
preprocess_args = filter_args(args_dict, preprocess_parser)
|
|
preprocesser = importlib.import_module(preproccess_name)
|
|
preprocess_output = preprocesser.main(preprocess_args)
|
|
print("preprocess_output:", preprocess_output)
|
|
|
|
del preprocesser
|
|
torch.cuda.empty_cache()
|
|
|
|
# run inference
|
|
inference_args = filter_args(args_dict, inference_parser)
|
|
inference_args.update(preprocess_output)
|
|
preprocess_output = importlib.import_module(inference_name).main(inference_args)
|
|
print("preprocess_output:", preprocess_output)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main() |