sglang-diffusion-performance

sglang-diffusion-performance is a skill for Claude Code, Codex from sgl-project/sglang. It costs 29 tokens per session (14,245 once invoked), scanned A, original, Apache-2.0.

A performance-tuning guide for SGLang Diffusion, software that generates images from model instructions. It helps choose command-line settings for a model, GPU, and available video memory.

In plain words
What is it for?
Use it to select fast-generation flags, reduce video-memory use, compare settings, and validate which backend and options actually ran.
Why use it?
It reduces guesswork when balancing generation speed against GPU memory limits. It also helps make performance comparisons under consistent conditions.

Skill for Claude CodeCodex

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

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 python/sglang/multimodal_gen/.claude/skills/sglang-diffusion-benchmark-profile/scripts/bench_diffusion_denoise.py \.

Good fit Use it to select fast-generation flags, reduce video-memory use, compare settings, and validate which backend and options actually ran.

Compare 6 skills from other repositories ↓
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,623 stars · on GitHub · sglang.io

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/sgl-project/sglang
agentmods
npx agentmods add skills/sgl-project/sglang/sglang-diffusion-performance

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-performance

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/sgl-project/sglang/sglang-diffusion-performance"><img src="https://agentmods.dev/badge/skills/sgl-project/sglang/sglang-diffusion-performance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 14,245 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 pass 7 Sept 2026
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.00029 $0.14245
Opus 5.5 $0.00012 $0.05698
Sonnet 5.5 $0.00006 $0.02849
Haiku 4.5 $0.00003 $0.01425

Measured 15d ago against content hash 43938f6df6e7, 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-performance 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 15d 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-performance/SKILL.md · 566 lines

How it starts

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

SGLang Diffusion Performance Tuning

Use this skill when the user wants the fastest command line, lower VRAM, or the right performance flags for a specific model and GPU setup.

Start from the model's cookbook page

Tune from the deployment we already recommend, not from scratch: read docs/cookbook/diffusion/<Family>/ for the model first, take its command as the baseline, then apply the options below. The cookbook page is what users follow, so a recipe that silently disagrees with it on GPU count, parallelism degrees, or offload flags is a recipe for a configuration nobody runs.

Families with a cookbook page: Cosmos, Ernie-Image, FLUX, Ideogram, JoyEcho, Krea, LTX, LingBot-Video, LingBot-World, LongLive, MOVA, MiniMax, Qwen-Image, SANA-Video, SANA-WM, Wan, Z-Image.

test/ configs are pinned CI setups for correctness and regression checks, not deployment advice. Use them when you need an exactly reproducible run, and note which cookbook flags you diverged from.

Before running any sglang generate command below inside the diffusion container:

  • use python/sglang/multimodal_gen/.claude/skills/sglang-diffusion-benchmark-profile/scripts/diffusion_skill_env.py to derive the repo root, verify write access, and choose idle GPU(s)
  • export HF_TOKEN first when the selected model lives in a gated Hugging Face repo such as black-forest-labs/FLUX.*
  • export FLASHINFER_DISABLE_VERSION_CHECK=1
  • when a run downloads weights, use a task-owned cache and delete that model's cache after its eager/BCG/quality/profile group finishes; the benchmark skill's --quality-bcg-matrix --model-cache-root --cleanup-model-cache keeps one cache for the group and writes a zero-residual cleanup ledger
  • hold one idle GPU set for the complete A/B matrix and verify no foreign process appears at run boundaries
  • cd to the repo root resolved from sglang.__file__

Native Backend Gate

Performance numbers are useful only when the intended backend actually ran.

  • Treat any log containing Falling back to diffusers backend, Using diffusers backend, or Loaded diffusers pipeline as invalid for native SGLang performance tuning.
  • Use --backend diffusers only for an explicit diffusers baseline. For native recipes, leave the default backend or pin --backend sglang.
  • If a fallback happened, fix pipeline registration/model-path/config issues first, then rerun. Do not compare perf dumps collected from a fallback run.
  • When the runtime auto-selects parallel settings because the user omitted them, keep the result as an auto-tuned baseline. For reproducible tuning, pin --num-gpus, --ulysses-degree, --ring-degree, and --enable-cfg-parallel explicitly.

Read the full file on GitHub · 566 lines

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. 15d ago Changed 43938f6df6e7
  2. 20d ago Changed 78d106a19f82
  3. 25d ago Changed e78d3dd01115
  4. 29d ago Changed · +16 lines 740fca370b3b
  5. 1mo ago Changed · +88 lines 851c1d0cc0af
  6. 1mo ago Changed · +17 lines b009cc23179b
  7. 1mo ago Changed · +6 lines b14a4d8cca33
  8. 1mo ago First seen · 439 lines · 29 tokens per session scan A a843c76ffe45

Subscribe to this mod's changes

sglang-diffusion-performance is a skill published in the GitHub repository sgl-project/sglang (37,623 stars, last pushed today), licensed Apache-2.0. It adds 29 tokens to every session and 14,245 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