magi-1
Operate MAGI-1 autoregressive video generation inference, ComfyUI nodes, configs, and prompt enhancement assets.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- magi-1
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Operate MAGI-1 autoregressive video generation inference, ComfyUI nodes, configs, and prompt enhancement assets.
- disable-model-invocation
- true
02 资源文件 8
- 参考文档references/dify-prompt-enhancement.md1.8 KB
- 参考文档references/installation-and-assets.md4.6 KB
- 参考文档references/model-and-config-overview.md4.0 KB
- 参考文档references/prompt_enhancement_dify_dsl.yml15.8 KB
- 参考文档references/repo-provenance.md2.4 KB
- 参考文档references/repo-routing-metadata.json410 B
- 参考文档references/troubleshooting.md4.8 KB
- 脚本scripts/magi_runtime_preflight.py7.4 KB
03 SKILL.md 正文
MAGI-1 repo skill
Use this skill when a task is about MAGI-1, the SandAI autoregressive video generation repository, including source-code inference, model/config selection, CUDA/runtime setup, ComfyUI custom nodes, or the bundled Dify prompt-enhancement workflow.
MAGI-1 is not a lightweight CPU library. Real generation needs CUDA, the MAGI DiT weights, T5 weights, VAE weights, special-token assets, and ffmpeg. This skill provides self-contained operating guidance and safe preflight helpers; it does not include model weights.
Route by task
| User task | Read |
|---|---|
Build or debug t2v, i2v, or v2v source-code commands |
sub-skills/inference/SKILL.md |
| Edit or validate MAGI JSON configs, checkpoint paths, process counts, or CFG/distill/fp8 settings | sub-skills/inference/SKILL.md and sub-skills/inference/references/configuration.md |
Use the Python MagiPipeline API |
sub-skills/inference/references/cli-and-api.md |
| Install, recognize, or operate the MAGI-1 ComfyUI custom node | sub-skills/comfyui/SKILL.md |
| Import or adapt MAGI ComfyUI workflow JSONs | sub-skills/comfyui/references/comfyui-nodes-and-workflows.md |
| Prepare weights, runtime dependencies, or safe environment checks | references/installation-and-assets.md and scripts/magi_runtime_preflight.py |
| Understand model families and hardware expectations | references/model-and-config-overview.md |
| Use the prompt enhancement DSL outside MAGI generation | references/dify-prompt-enhancement.md |
| Diagnose install/import, asset, CUDA, ffmpeg, or cross-workflow issues | references/troubleshooting.md plus the nearest sub-skill troubleshooting reference |
Common operating path
- Choose the user-facing surface:
- Source CLI/API inference: use the
inferencesub-skill. - ComfyUI node graph: use the
comfyuisub-skill. - Prompt rewriting in Dify: use the Dify reference.
- Source CLI/API inference: use the
- Choose a model family from references/model-and-config-overview.md. Prefer 4.5B variants for single-GPU use; 24B examples are multi-GPU configurations.
- Download or locate local MAGI DiT, T5, and VAE weights. Edit a copied JSON config so
load,t5_pretrained, andvae_pretrainedpoint to local paths. - Run scripts/magi_runtime_preflight.py in the runtime Python to check CUDA, attention packages, ffmpeg, and optional source assets.
- For source CLI/API, run sub-skills/inference/scripts/magi_config_check.py before generation and sub-skills/inference/scripts/magi_command_builder.py to print a command.
- For ComfyUI, import one of the bundled workflow JSONs from sub-skills/comfyui/references/workflows/ and reassign every placeholder path inside the UI before queueing.
- If anything fails, read references/troubleshooting.md first, then the workflow-specific troubleshooting page.
Strong constraints and safety notes
- Do not present a config parse, helper output, or import check as a successful video generation. A real MAGI smoke test must load weights and write a playable MP4.
- Do not tell users to run original repository examples from an absent checkout. Use this skill's bundled helpers and references to reconstruct safe commands and checks.
- Do not claim CPU-only generation support. CUDA is required by MAGI source distributed initialization and model code paths.
- Match
engine_config.pp_size * engine_config.cp_sizeto the launched process count. The bundled inference config checker validates this preflight. - Treat model architecture fields as checkpoint-coupled. For most tasks, copy a release-family config and edit paths, seed, output dimensions, frame count, steps, FPS, and parallel sizes only when launch topology changes.
- The ComfyUI node path is single-process/single-GPU by default because
MagiProcesssets its own distributed and CUDA visibility environment variables. - Large model downloads, full generation, and ComfyUI host operation may be expensive or environment-specific. Ask for user approval before long downloads or long generation runs.
Bundled helpers
- scripts/magi_runtime_preflight.py: checks Python version, key dependency imports, CUDA visibility, optional tiny CUDA tensor execution, ffmpeg availability, and optional MAGI source asset paths without loading model weights.
- sub-skills/inference/scripts/magi_config_check.py: validates MAGI JSON config schema, CFG/distill/fp8 rules, process-count alignment, and optional checkpoint paths.
- sub-skills/inference/scripts/magi_command_builder.py: prints a source-code inference command and recommended environment variables; it does not execute generation.
- sub-skills/comfyui/scripts/inspect_workflow_nodes.py: inspects ComfyUI workflow JSONs offline and lists MAGI nodes plus placeholder fields.
Provenance and routing metadata
- Source snapshot and evidence paths are recorded in references/repo-provenance.md.
- Managed router metadata for repo-skill import is recorded in references/repo-routing-metadata.json.
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).