add-diffusion-model

add-diffusion-model is a skill for Claude Code, Codex from sgl-project/sglang. It costs 30 tokens per session (3,712 once invoked), scanned A, original, Apache-2.0.

A step-by-step guide for adding a new diffusion model or pipeline variant to SGLang Diffusion, a system for running image-generation models. It covers reading the reference implementation, choosing the smallest change, and following the project’s model and distributed-memory requirements.

In plain words
What is it for?
Use it when adding support for a diffusion model or pipeline variant in SGLang.
Why use it?
It reduces the risk of adding a model based on guesses or missing required registry, pipeline, or implementation changes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it when adding support for a diffusion model or pipeline variant in SGLang.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sgl-project/sglang/add-diffusion-model
About the project

SGLang is a framework for running inference for large language models and multimodal models, meaning it processes inputs to produce model outputs such as text or other media. It is used to serve and accelerate open AI models and related workloads.

sgl-project/sglang · 39,186 stars · on GitHub · sglang.io

Install

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.

Any agent
npx skills add sgl-project/sglang --skill add-diffusion-model
Clone the repo
git clone --depth 1 https://github.com/sgl-project/sglang

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for add-diffusion-model

README.md
[![agentmods](https://agentmods.dev/badge/skills/sgl-project/sglang/add-diffusion-model/github.svg)](https://agentmods.dev/skills/sgl-project/sglang/add-diffusion-model)
Your own site
<a href="https://agentmods.dev/skills/sgl-project/sglang/add-diffusion-model"><img src="https://agentmods.dev/badge/skills/sgl-project/sglang/add-diffusion-model/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for add-diffusion-model

Your own site · 80×15
<a href="https://agentmods.dev/skills/sgl-project/sglang/add-diffusion-model"><img src="https://agentmods.dev/badge/skills/sgl-project/sglang/add-diffusion-model.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,712 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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

ModelPer sessionOnce invoked
Fable 5.1 $0.00030 $0.03712
Opus 5.5 $0.00012 $0.01485
Sonnet 5.5 $0.00006 $0.00742
Haiku 4.5 $0.00003 $0.00371

Measured today against content hash db7661e27a5f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

add-diffusion-model 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 today.

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.

python/sglang/multimodal_gen/.agents/skills/add-diffusion-model/SKILL.md · 300 lines

How it starts

The opening of the file, as written. The whole thing — 300 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Add a Diffusion Model to SGLang

Use this skill when adding a new diffusion model or pipeline variant to sglang.multimodal_gen.

The implementation guide is docs/docs/sglang-diffusion/support_new_models.mdx. It owns the file map, the code skeleton for each piece, the pipeline shapes, the registry, the distributed and memory contract, and the PR checklist. Read it first. This skill gives the order of work and the checks between steps; it does not repeat the guide's code, and the guide wins where the two disagree.

Paths below are relative to python/sglang/multimodal_gen/ unless they start with docs/.

1. Read the reference before writing code

Work from the model's actual source: its Diffusers pipeline, the official implementation, or the checkpoint's model_index.json. If the user gave a Hugging Face model ID or repo, inspect it yourself first; ask only when the reference is private, ambiguous, or unavailable. Do not infer the architecture from the model name.

Write down the items listed under "Read the Reference First" in the guide before creating files.

2. Pick the smallest change

Follow "Start With the Smallest Change" in the guide. Compare the model with the families in docs/docs/sglang-diffusion/compatibility_matrix.mdx and with runtime/pipelines/ before adding anything:

  • a new checkpoint of an existing family is a config variant, not a new pipeline class; FireRed-Image-Edit, for example, is registered on the Qwen-Image edit config
  • a stage, VAE, text encoder, or scheduler that already covers most of what the model needs is extended, not copied
  • a new file has to carry behavior that existing code cannot express

3. Choose the pipeline shape

Use the order in "Choose a Pipeline Shape" in the guide, and stop at the first shape that fits:

  1. native stages through the add_standard_* helpers, such as add_standard_t2i_stages, add_standard_ti2i_stages, and add_standard_ti2v_stages
  2. a subclass of the one native stage that differs
  3. a custom single-purpose stage inserted between native stages
  4. an aggregated BeforeDenoisingStage, only as a last resort

Read the full file on GitHub · 300 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. today Changed · -2 lines db7661e27a5f
  2. 3d ago Changed · +3 lines 8f5ab09f930c
  3. 4d ago First seen · 299 lines · 30 tokens per session scan A 585a5c34548b

Subscribe to this mod's changes

add-diffusion-model is a skill published in the GitHub repository sgl-project/sglang (39,186 stars, last pushed today), licensed Apache-2.0. It adds 30 tokens to every session and 3,712 once invoked, about $0.0001 per session on Opus 5.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-11-26.

Related

add-diffusion-model compared with skills from other repositories

add-diffusion-model next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
add-diffusion-modelsgl-project/sglangSkill39ktodayApache-2.0A30Claude Code, Codex
saelensNousResearch/hermes-agentSkill267ktodayMITA14Claude Code, Codex
apimudler/LocalAISkill51ktodayMITA47Claude Code
modelsmudler/LocalAISkill51ktodayMITA44Claude Code
localaimudler/LocalAISkill51ktodayMITA63Claude Code, Codex
batch-processing-clinical-textmaziyarpanahi/openmedSkill5.9ktodayApache-2.0A161Claude Code
exporting-to-fhirmaziyarpanahi/openmedSkill5.9ktodayApache-2.0A163Claude Code