AGENT SKILL

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

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

  1. Read references/cli-and-api.md to choose the CLI or MagiPipeline API route and assemble t2v, i2v, or v2v arguments.
  2. Read references/configuration.md before editing any MAGI JSON config or switching between 4.5B, 24B, base, distill, and fp8-quant variants.
  3. 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.
  4. Use scripts/magi_command_builder.py to print a safe source-code command and recommended environment variables without executing inference.
  5. 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_size must equal the launched distributed world size. Single-process commands require config values of 1 * 1; multi-GPU configs should use torchrun.
  • 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

VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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).

★ 351