inference
Operate MAGI-1 source-code inference for text-to-video, image-to-video, and video-to-video generation.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- inference
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Operate MAGI-1 source-code inference for text-to-video, image-to-video, and video-to-video generation.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/cli-and-api.md7.3 KB
- 参考文档references/configuration.md8.3 KB
- 参考文档references/troubleshooting.md8.7 KB
- 脚本scripts/magi_command_builder.py9.6 KB
- 脚本scripts/magi_config_check.py15.2 KB
03 SKILL.md 正文
MAGI-1 inference
Use this sub-skill when a task needs MAGI-1 source-code inference for text-to-video (t2v), image-to-video (i2v), or video-to-video / continuation (v2v) and the agent must choose configs, edit inference JSON safely, build commands, or troubleshoot CUDA/distributed/checkpoint failures.
Do not use this sub-skill for ComfyUI node installation or graph editing; route those tasks to the ComfyUI sub-skill. Prompt enhancement with Dify is only a root-level auxiliary topic and is not covered here beyond prompt text passed into inference.
Start here
- Read references/cli-and-api.md to choose the CLI or
MagiPipelineAPI route and assemblet2v,i2v, orv2varguments. - Read references/configuration.md before editing any MAGI JSON config or switching between 4.5B, 24B, base, distill, and fp8-quant variants.
- Use scripts/magi_config_check.py to validate config shape, required fields, CFG rules, process-count expectations, and optional checkpoint path existence without loading models.
- Use scripts/magi_command_builder.py to print a safe source-code command and recommended environment variables without executing inference.
- If inference fails or hangs, read references/troubleshooting.md before changing kernels, checkpoints, distributed settings, or media inputs.
Hard constraints
- Meaningful MAGI inference is CUDA-backed. Use a runtime stack compatible with the repository requirements, including CUDA-enabled PyTorch plus MAGI's attention/media dependencies, then run the bundled preflight checks in the user's environment. Dependency import success proves only preflight readiness, not checkpoint-backed generation.
- Full generation is not a smoke test unless valid MAGI DiT, T5, VAE, and special-token assets are available at the paths referenced by the config and environment.
engine_config.pp_size * engine_config.cp_sizemust equal the launched distributed world size. Single-process commands require config values of1 * 1; multi-GPU configs should usetorchrun.- Keep source-code commands rooted at a MAGI source checkout or installed package tree with
inference/importable. This skill provides operating guidance and bundled helpers; it does not include model weights.
Evidence distilled
This sub-skill distills the inference CLI, API, config schema, example configs, example launch scripts, video/prompt processing, checkpoint loading, and distributed initialization from the MAGI repository evidence paths named in the references. Source paths are recorded as provenance only; all runtime links in this sub-skill point to generated skill files.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).