Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/huggingface/diffusers/model-integrationnpx skills add huggingface/diffusers --skill model-integrationgit clone --depth 1 https://github.com/huggingface/diffusersWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00045 | $0.01861 |
| Opus 5 | $0.00023 | $0.00931 |
| Sonnet 5 | $0.00009 | $0.00372 |
| Haiku 4.5 | $0.00005 | $0.00186 |
Grade A, and why
model-integration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 124 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Goal
Integrate a new model into diffusers end-to-end, to full numerical parity with the reference implementation — one workflow at a time.
Setup — gather before starting
Before writing any code, gather info in this order:
- Reference repo — ask for the github link. If they've already set it up locally, ask for the path. Otherwise, ask what setup steps are needed (install deps, download checkpoints, set env vars, etc.) and run through them before proceeding.
- Inference script — ask for a runnable end-to-end script for a basic workflow first (e.g. T2V). Then ask what other workflows they want to support (I2V, V2V, etc.) and agree on the full implementation order together.
- Standard vs modular — default to modular. Modular Diffusers is the preferred implementation for new pipelines; the standard
DiffusionPipelineis still supported but no longer the default. We prefer modular especially for models that don't fit a fixed task-based structure (modality baked into the checkpoint) or that are actively evolving.
Ask step 3 as an AskUserQuestion, with modular marked as the recommended default.
Once you have everything, confirm the plan with the user before implementing — state exactly what you'll do, e.g. "I'll integrate model X with pipeline Y based on your script, and verify the model matches the reference before considering it done."
Then work through the Integration checklist below
Integration checklist
A pipeline in Diffusers (be it standard or modular) will have multiple components. These components can be models, schedulers, processors, etc.
- Transformer model
- Implement the model with
from_pretrainedsupport (conventions: models.md) - Convert weights (see Weight / Checkpoint Conversion)
- Parity test against the reference (internal, not shipped — see Model parity test)
- Register in the relevant
__init__.pyfiles (lazy imports) - Model-level tests (see Testing)
- Implement the model with
- VAE (if applicable) — reuse an existing
AutoencoderKL*if possible; if a new one is needed, follow the same sub-steps as the transformer - Scheduler — reuse an existing scheduler, or add a custom one
- Pipeline
- Implement the pipeline — see modular.md for modular pipeline, or pipelines.md for standard pipeline
- Add a LoRA mixin if applicable
- Register in the relevant
__init__.pyfiles (lazy imports) - Pipeline-level tests (see Testing)
- Docs — see File structure
- Style —
make styleandmake quality
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 124 lines · 45 tokens per session scan A 16faeacecc0b
model-integration is a skill published in the GitHub repository huggingface/diffusers (34,407 stars, last pushed 2d ago), licensed Apache-2.0. It adds 45 tokens to every session and 1,861 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
nano-banana-pro-openrouter
Deterministic OpenRouter image generation adapter for Nano Banana Pro / Gemini image models. Use as skillexec when a meta-skill needs local image files and structured IMAGEREADY records without spawning an LLM agent.
founder-meditation
When something goes wrong — build failures, crashes, errors, test failures, deployment issues — generate a short calming meditation with TTS audio to reassure the user that everything will be okay.
music-and-singing-studio
Generate instrumental music, background beds, jingles, or sung songs with lyrics through OpenSquilla audio tools. Use when the user asks for BGM, music generation, 唱歌, 生成歌曲, lyrics to song, or a playable music audio artifact.
api-contrib
Contributing to the Kokoro-FastAPI Python API: module layout, endpoint gating pattern, test expectations. Use when adding or changing endpoints, services, or inference code.
ima2
Use the ima2-gen CLI/server to generate, edit, inspect, and manage local AI image generation jobs.
videoagent-image-studio
Tired of juggling 8 API keys? This skill gives you one-command access to Midjourney, Flux, Ideogram, and more, with zero setup. Use when you want to generate any image without worrying about API keys.