stability-ai-generative-models
Use Stability AI's generative-models package for SDXL inference APIs, SVD/SV3D/SV4D video sampling, config-driven training, demos, and watermarking workflows.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- stability-ai-generative-models
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use Stability AI's generative-models package for SDXL inference APIs, SVD/SV3D/SV4D video sampling, config-driven training, demos, and watermarking workflows.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/repo-provenance.md1.9 KB
- 参考文档references/repo-routing-metadata.json535 B
- 参考文档references/troubleshooting.md3.8 KB
- 脚本scripts/check_environment.py4.2 KB
03 SKILL.md 正文
Generative Models
Use this repo skill when a task involves Stability AI generative-models, the installed sgm package, SDXL inference APIs, Stable Video Diffusion or SV3D/SV4D sampling scripts, config-driven diffusion training, demo apps, or invisible watermark detection.
Route By Task
- Use inference-api for
sgm.inference.api,SamplingPipeline, SDXL text-to-image/image-to-image, base+refiner latent handoff, sampler choices, and checkpoint/config mismatch diagnosis. - Use video-sampling for standalone SVD, SVD-XT, SV3D, SV4D, SV4D2, 8-view video-to-4D, camera-path, input video/frame, and low-VRAM sampling workflows.
- Use training-and-configs for
main.py --base, OmegaConf dotlist overrides,instantiate_from_config,DiffusionEngine,AutoencodingEngine, toy/example training configs, and static config validation. - Use demos-and-watermarking for Streamlit/Gradio demo routing, SDXL Turbo demo behavior, converting demo controls into automated calls, and watermark bit-match interpretation.
Install And Import Context
- The Python distribution is
sgm; the public import issgm; the repository snapshot used for this skill reports version0.1.0. - The package metadata does not declare the full runtime dependency set. For real sampling/training, install a PyTorch-compatible environment plus the documented runtime requirements for the selected workflow.
- For static inspection or planning, use the minimal import check below before attempting checkpoint-backed execution.
python -c "import sgm; print(sgm.__version__)"
python scripts/check_environment.py --json
Working Safely
- Do not load checkpoints, start UI servers, download model weights, or launch training until the user confirms runtime cost, credentials, GPU availability, and output paths.
- Treat CUDA/GPU, checkpoint files, Hugging Face access,
xformers,rembg, Streamlit/Gradio, and video encoders as workflow-specific prerequisites rather than assumptions. - Prefer bundled helper scripts for safe inspection: they avoid checkpoint loads and long-running execution.
- Read references/troubleshooting.md for cross-cutting install/import, optional dependency, checkpoint, CUDA, and data/config failures.
- Read references/repo-provenance.md before deciding whether this skill matches a current checkout or should be refreshed.
Bundled Helpers
scripts/check_environment.pychecks required imports, optional dependency visibility, distribution versions, and torch/CUDA facts without loading checkpoints.sub-skills/inference-api/scripts/inspect_inference_api.pyinspects API signatures, enum values, and model specs.sub-skills/video-sampling/scripts/inspect_video_sampling_cli.pystatically summarizes video sampling script defaults, configs, checkpoints, inputs, and command templates.sub-skills/training-and-configs/scripts/inspect_training_config.pyvalidates and summarizes training config files without starting training.sub-skills/demos-and-watermarking/scripts/watermark_match_thresholds.pyclassifies watermark bit-match counts without image-processing dependencies.
Common Non-Fits
- Use a Diffusers-specific skill for Hugging Face Diffusers pipeline APIs that do not involve
sgmor this repository's scripts. - Use a generic PyTorch Lightning skill for framework-only trainer questions without
generative-modelsconfigs or classes. - Use a computer-vision/model-serving skill when the request is about deployment frameworks rather than this package's generation, demo, or training surfaces.
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).