analyze-generative-diffusion-model

analyze-generative-diffusion-model is a skill for Claude Code from pjt222/agent-almanac. It costs 104 tokens per session (3,818 once invoked), scanned A, original, MIT.

A model-evaluation workflow for image-generating diffusion models such as Stable Diffusion, DALL·E, and Flux. It measures output quality and examines how the model uses noise, text attention, and its internal representation.

In plain words
What is it for?
Use it to calculate image-quality metrics, compare noise schedules, inspect text-to-image attention maps, explore latent spaces, and detect inputs unlike the training data.
Why use it?
It helps diagnose poor or unusual generations with measurable tests and visual inspections instead of judging outputs only by eye. The findings can guide debugging or fine-tuning decisions.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the agent-almanac plugin — 122 skills, 76 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/pjt222/agent-almanac/analyze-generative-diffusion-model
Any agent
npx skills add pjt222/agent-almanac --skill analyze-generative-diffusion-model
Clone the repo
git clone --depth 1 https://github.com/pjt222/agent-almanac

Made for: Claude Code.

Or install agent-almanac, the plugin that ships this one along with the rest of its 122 skills, 76 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 analyze-generative-diffusion-model

README.md
[![agentmods](https://agentmods.dev/badge/skills/pjt222/agent-almanac/analyze-generative-diffusion-model.svg)](https://agentmods.dev/skills/pjt222/agent-almanac/analyze-generative-diffusion-model)
Your own site
<a href="https://agentmods.dev/skills/pjt222/agent-almanac/analyze-generative-diffusion-model"><img src="https://agentmods.dev/badge/skills/pjt222/agent-almanac/analyze-generative-diffusion-model.svg" alt="Measured on agentmods" height="20"></a>
Per session 104 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,818 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.1 $0.00104 $0.03818
Opus 5 $0.00052 $0.01909
Sonnet 5 $0.00021 $0.00764
Haiku 4.5 $0.00010 $0.00382

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

Security

Grade A, and why

analyze-generative-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 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.

i18n/caveman-lite/skills/analyze-generative-diffusion-model/SKILL.md · 369 lines

How it starts

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

Analyze a Generative Diffusion Model

Evaluate pre-trained generative diffusion models through quantitative quality metrics, noise schedule inspection, cross-attention map analysis, and latent space probing to understand model behavior, diagnose failure modes, and guide fine-tuning decisions.

When to Use

  • Evaluating a pre-trained generative diffusion model's output quality with standard metrics
  • Computing FID, IS, CLIP score, or precision/recall for generated image sets
  • Inspecting and comparing noise schedules (linear, cosine, learned) via SNR curves
  • Extracting cross-attention maps to understand text-to-image token-region correspondences
  • Interpolating between latent codes or discovering semantic directions in the latent space
  • Detecting out-of-distribution inputs for a diffusion model pipeline

Inputs

  • Required: Pre-trained model identifier or checkpoint path (e.g., stabilityai/stable-diffusion-2-1)
  • Required: Analysis mode — one or more of: metrics, schedule, attention, latent
  • Required: Reference dataset for metric computation (real images or dataset name)
  • Optional: Text prompts for attention analysis (default: model-appropriate test prompts)
  • Optional: Number of generated samples for metric computation (default: 10000)
  • Optional: Device configuration (default: cuda if available, else cpu)

Procedure

Step 1: Quantitative Evaluation

Compute standard generative quality metrics against a reference dataset.

  1. Set up the evaluation pipeline:
import torch
from diffusers import StableDiffusionPipeline
from torchmetrics.image.fid import FrechetInceptionDistance
from torchmetrics.image.inception import InceptionScore

device = "cuda" if torch.cuda.is_available() else "cpu"
pipe = StableDiffusionPipeline.from_pretrained(
    "stabilityai/stable-diffusion-2-1", torch_dtype=torch.float16
).to(device)

fid = FrechetInceptionDistance(feature=2048, normalize=True).to(device)
inception = InceptionScore(normalize=True).to(device)

Read the full file on GitHub · 369 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. 3d ago First seen · 369 lines · 104 tokens per session scan A c910639015e3

Subscribe to this mod's changes

analyze-generative-diffusion-model is a skill published in the GitHub repository pjt222/agent-almanac (32 stars, last pushed 2d ago), licensed MIT. It adds 104 tokens to every session and 3,818 once invoked, about $0.0005 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-09-03.

Related

Other skills, from other repositories

metodo-3w1h

Dê a habilidade para agentes de IA de estruturar e otimizar prompts de imagens utilizando rigorosamente o método 3W1H (Who, What, Where, How) criado pelo Mário Lúcio. Utilize esta skill sempre que o usuário mencionar termos como 'gerar imagem', 'criar prompt de imagem', 'engenharia de prompt de imagem', 'fotorrealismo…

marioluciofjr/skills · 144 tokens

prompt-personagem

Gera automaticamente prompts detalhados de personagens para inteligência artificial. Utilizando listas pré-definidas de atributos, o script cria descrições únicas combinando gênero, idade, tom de pele, penteado e poses variadas. Use esta skill SEMPRE que o usuário invocar o gatilho "/personagem", independentemente de…

marioluciofjr/skills · 74 tokens

baoyu-danger-gemini-web

Generates images and text via reverse-engineered Gemini Web API. Supports text generation, image generation from prompts, reference images for vision input, and multi-turn conversations. Use when other skills need image generation backend, or when user requests "generate image with Gemini", "Gemini text generation"…

bestagentkits/agency-skills · 74 tokens

baoyu-imagine

AI image generation with OpenAI GPT Image 2, Azure OpenAI, Google, OpenRouter, DashScope, Z.AI GLM-Image, MiniMax, Jimeng, Seedream and Replicate APIs. Supports text-to-image, reference images, aspect ratios, and batch generation from saved prompt files. Sequential by default; use batch parallel generation when the…

guanyang/open-agent-hub · 103 tokens

voice-extractor

Capture a user's real writing voice from 5-20 prior samples, store a local voice.yaml fingerprint, and enforce it on newsjack drafts so AI tells disappear. Measures voice with named stylometry lenses (Burrows's Delta function-word vector, MATTR lexical diversity, sentence-length burstiness, Biber Dimension-1 register…

elvisun/newsjack · 90 tokens

map

Build and commit a Cortex function knowledge graph — maps structural dependencies and domain intent relationships across all AI functions in the project. Supports --reduce (default on) for transitive reduction of the dependency graph.

Snowflake-Labs/cocoplus · 42 tokens