sglang-diffusion-add-model

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

A development guide for adding a new image-generation model or pipeline to SGLang Diffusion. Diffusion models create images through repeated denoising steps, and a pipeline is the code that connects preparation, denoising, and decoding.

In plain words
What is it for?
Use it to add model preprocessing, connect standard denoising and decoding stages, and choose an appropriate pipeline structure.
Why use it?
It gives new model integrations a consistent structure and keeps model-specific preparation separate from shared processing stages. This makes the integration easier to maintain and compare with reference implementations.

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 to add model preprocessing, connect standard denoising and decoding stages, and choose an appropriate pipeline structure.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sgl-project/sglang/sglang-diffusion-add-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 · 37,675 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 sglang-diffusion-add-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 sglang-diffusion-add-model

README.md
[![agentmods](https://agentmods.dev/badge/skills/sgl-project/sglang/sglang-diffusion-add-model/github.svg)](https://agentmods.dev/skills/sgl-project/sglang/sglang-diffusion-add-model)
Your own site
<a href="https://agentmods.dev/skills/sgl-project/sglang/sglang-diffusion-add-model"><img src="https://agentmods.dev/badge/skills/sgl-project/sglang/sglang-diffusion-add-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 sglang-diffusion-add-model

Your own site · 80×15
<a href="https://agentmods.dev/skills/sgl-project/sglang/sglang-diffusion-add-model"><img src="https://agentmods.dev/badge/skills/sgl-project/sglang/sglang-diffusion-add-model.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 9,284 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. Third-party audits
  • Snyk pass 7 Sept 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high System Prompt Leakage · line 404
    Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
    Fix: Remove any instructions that reveal, print, or output system prompts or internal rules. System instructions should never be exposed to end users.
  • medium System Prompt Leakage · line 429
    Skill contains patterns that could indirectly extract system prompts through rephrasing, translation, summarization, or side-channel techniques.
    Fix: Guard against indirect extraction by refusing to summarize, translate, or rephrase system instructions. Add explicit anti-extraction clauses.
How audits are shown
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.00024 $0.09284
Opus 5.5 $0.00010 $0.03714
Sonnet 5.5 $0.00005 $0.01857
Haiku 4.5 $0.00002 $0.00928

Measured 16d ago against content hash 34dcd853d84e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sglang-diffusion-add-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 16d 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.

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

How it starts

The opening of the file, as written. The whole thing — 780 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.

Three Pipeline Styles

Style A: Hybrid Monolithic Pipeline (Recommended)

The recommended default for most new models. Uses a three-stage structure:

BeforeDenoisingStage (model-specific)  -->  DenoisingStage (standard)  -->  DecodingStage (standard)
  • BeforeDenoisingStage: A single, model-specific stage that consolidates all pre-processing logic: input validation, text encoding, image encoding, latent preparation, timestep setup. This stage is unique per model.
  • DenoisingStage: Framework-standard stage for the denoising loop (DiT/UNet forward passes). Shared across models.
  • DecodingStage: Framework-standard stage for VAE decoding. Shared across models.

Why recommended? Modern diffusion models have highly heterogeneous pre-processing requirements (different text encoders, different latent formats, different conditioning mechanisms). The Hybrid approach keeps pre-processing isolated per model, avoids fragile shared stages with excessive conditional logic, and lets developers port Diffusers reference code quickly.

Style B: Modular Composition Style

Uses the framework's fine-grained standard stages (TextEncodingStage, LatentPreparationStage, TimestepPreparationStage, etc.) to build the pipeline by composition.

This style is appropriate when:

  • The new model's pre-processing can largely reuse existing stages — e.g., a model that uses standard CLIP/T5 text encoding + standard latent preparation with minimal customization. In this case, add_standard_t2i_stages() or add_standard_ti2i_stages() may be all you need.
  • A model-specific optimization needs to be extracted as a standalone stage — e.g., a specialized encoding or conditioning step that benefits from being a separate stage for profiling, parallelism control, or reuse across multiple pipeline variants.

See existing Modular examples: QwenImagePipeline (uses add_standard_t2i_stages), FluxPipeline, WanPipeline, SanaPipeline, StableDiffusion3Pipeline, and ZImagePipeline.

Read the full file on GitHub · 780 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. 16d ago Changed 34dcd853d84e
  2. 1mo ago Changed · +2 lines 4ad59a61ba03
  3. 1mo ago First seen · 778 lines · 24 tokens per session scan A 4269fb556560

Subscribe to this mod's changes

sglang-diffusion-add-model is a skill published in the GitHub repository sgl-project/sglang (37,675 stars, last pushed today), licensed Apache-2.0. It adds 24 tokens to every session and 9,284 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-08-30.

Related

Other skills, from other repositories

llama-factory

Expert guidance for fine-tuning LLMs with LLaMA-Factory - WebUI no-code, 100+ models, 2/3/4/5/6/8-bit QLoRA, multimodal support.

davila7/claude-code-templates · 51 tokens

groq-inference

Ultra-fast LLM inference on custom LPU hardware. OpenAI-compatible API at api.groq.com. Lowest latency in the industry (500-1000+ tok/s). Supports chat completions, vision, audio (Whisper STT + TTS), tool calling, JSON mode, and streaming. Free tier available. Inference only — no training.

synthetic-sciences/openscience · 77 tokens

fireworks-ai-inference

Fast inference and fine-tuning platform with serverless and on-demand GPU deployments. OpenAI-compatible API for chat completions, embeddings, function calling, vision, and structured output. Supports SFT, DPO, and RL fine-tuning. SOC2 + HIPAA compliant.

synthetic-sciences/openscience · 62 tokens

huggingface-transformers

Use when running or fine-tuning Hugging Face Transformers models in Python — pipeline() inference for text classification and generation, loading weights with AutoModel/AutoTokenizer, devicemap and dtype memory management, tokenizer usage, Trainer fine-tuning, and BGE embeddings for Chinese RAG. Covers transformers…

znlgis/opengis-skills · 86 tokens

mlx-serve

Hook an app, game or script up to the local mlx-serve server for LLM chat, embeddings, image, speech, music, sound effect, video and 3D generation, and Laya/Kev/Clef typed decisions, or make a whole film or music video on this Mac. Use when code should call mlx-serve or the user wants a video, song, pictures or game…

ddalcu/mlx-serve · 88 tokens

hqq-quantization

Half-Quadratic Quantization for LLMs without calibration data. Use when quantizing models to 4/3/2-bit precision without needing calibration datasets, for fast quantization workflows, or when deploying with vLLM or HuggingFace Transformers.

synthetic-sciences/openscience · 58 tokens