diffusion-engineering

diffusion-engineering is a skill for Claude Code, Codex from AnastasiyaW/codex-claude-code-config. It costs 287 tokens per session (1,158 once invoked), scanned A, original, MIT.

A practical engineering guide to diffusion models, which generate or edit images by gradually removing noise. It covers model architectures, sampling controls, training methods, text encoders, memory use, evaluation, and debugging.

In plain words
What is it for?
Use it to design or modify UNet, DiT, Flux, VAE, or latent-diffusion systems; configure samplers; train LoRAs or full models; and optimise or evaluate GPU inference.
Why use it?
It helps explain the engineering choices that affect image quality, speed, and resource use. It also provides focused guidance for training, sampler settings, and fitting models into available GPU memory.

Skill for Claude CodeCodex

Part of the codex-claude-code-config plugin — 49 skills, 8 agents shipped together

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.

agentmods
npx agentmods add skills/anastasiyaw/codex-claude-code-config/diffusion-engineering
Any agent
npx skills add AnastasiyaW/codex-claude-code-config --skill diffusion-engineering
Clone the repo
git clone --depth 1 https://github.com/AnastasiyaW/codex-claude-code-config

Made for: Claude Code, Codex.

Or install codex-claude-code-config, the plugin that ships this one along with the rest of its 49 skills, 8 agents.

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 diffusion-engineering

README.md
[![agentmods](https://agentmods.dev/badge/skills/anastasiyaw/codex-claude-code-config/diffusion-engineering.svg)](https://agentmods.dev/skills/anastasiyaw/codex-claude-code-config/diffusion-engineering)
Your own site
<a href="https://agentmods.dev/skills/anastasiyaw/codex-claude-code-config/diffusion-engineering"><img src="https://agentmods.dev/badge/skills/anastasiyaw/codex-claude-code-config/diffusion-engineering.svg" alt="Measured on agentmods" height="20"></a>
Per session 287 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,158 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00287 $0.01158
Opus 5 $0.00143 $0.00579
Sonnet 5 $0.00057 $0.00232
Haiku 4.5 $0.00029 $0.00116

Measured 3d ago against content hash a3c4b7eb92e9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

diffusion-engineering 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 3d 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.

skills/ai-ml/diffusion-engineering/SKILL.md · 74 lines

How it starts

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

Diffusion Engineering Skill

Быстрая ориентация

Три инженерных решения, которые больше всего влияют на качество/скорость/стоимость:

  1. Где идёт диффузия → пиксели (дорого) или латентное пространство (LDM/SD-семейство — практично)
  2. Backbone денойзера → UNet (классика, проще) или Transformer/DiT/Flow (масштабируется лучше)
  3. Управление сэмплингом → scheduler, число шагов, guidance_scale — часто дают больше, чем правка сети

Reference files — читать по задаче

Тема Файл Когда читать
Архитектуры и data flow references/architectures.md DDPM/SDE/LDM/DiT/Flux/VAE/SDXL, схема пайплайна
Schedulers и guidance references/samplers.md DDIM/Euler/Heun/DPM-Solver/PNDM, CFG, prediction_type
Обучение и дообучение references/training.md Loss/цели, LoRA/DreamBooth/full FT, гиперпараметры
Память и распределённость references/memory.md AMP, checkpointing, ZeRO, FSDP, quantization, FP8
Текст-энкодеры и данные references/encoders-data.md CLIP/Qwen/multi-encoder, токенизация, data pipeline
Оценка и траблшутинг references/eval-debug.md FID/CLIPScore/LPIPS, типовые поломки и фиксы, лицензии

Быстрый чеклист «я строю/модифицирую diffusion»

  • Backbone: UNet (проще) или DiT/Flow (масштабирование)?
  • Модули зафиксированы: tokenizer → text encoder → encoder_hidden_states → denoiser → VAE decode
  • Scheduler выбран: DDIM / Euler / DPM-Solver — A/B на фиксированных seed
  • Дообучение: начинать с LoRA, в full fine-tune только при необходимости
  • Память: AMP включён, при необходимости checkpointing, при масштабе ZeRO/FSDP
  • Данные: стриминг/шардинг (HF streaming, WebDataset), валидировать throughput dataloader
  • Оценка: FID + CLIPScore + LPIPS + human rating; отдельно дневник промптов для overfitting

Trade-offs на один экран

Ручка Увеличить Уменьшить
num_inference_steps ↑ качество ↑ время
guidance_scale (CFG) ↑ adherence к промпту, риск «пережога» ↑ разнообразие
LoRA rank ↑ выразительность ↑ параметры, риск overfitting
Шаги дообучения ↑ адаптация ↑ риск catastrophic forgetting
Batch size ↑ стабильность градиентов ↑ VRAM

Read the full file on GitHub · 74 lines

Files

What ships with it

6 files 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. 3d ago First seen · 74 lines · 287 tokens per session scan A a3c4b7eb92e9

Subscribe to this mod's changes

diffusion-engineering is a skill published in the GitHub repository AnastasiyaW/codex-claude-code-config (147 stars, last pushed 9d ago), licensed MIT. It adds 287 tokens to every session and 1,158 once invoked, about $0.0014 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.