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, 77 agents shipped together

Good fit 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.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/pjt222/agent-almanac/analyze-generative-diffusion-model
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 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, 77 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/github.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/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 analyze-generative-diffusion-model

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • 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.00104 $0.03818
Opus 5.5 $0.00042 $0.01527
Sonnet 5.5 $0.00021 $0.00764
Haiku 4.5 $0.00010 $0.00382

Measured 1mo ago against content hash c910639015e3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 (42 stars, last pushed 4d ago), licensed MIT. It adds 104 tokens to every session and 3,818 once invoked, about $0.0004 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-09-03.

Related

Other skills, from other repositories

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

prompt-set-qa

Gate a prompt universe for schema and provenance completeness, target or campaign contamination, evidence entailment, naturalness, one-concept clarity, architecture consistency, aided status, answer leakage, and semantic duplicates. Use after realistic prompt generation and before human panel selection.

elvisun/newsjack · 56 tokens

realistic-prompt-generation

Generate natural, controlled prompt variants from a target-blind design brief and prompt architecture while preserving approved jobs, acts, journeys, constraints, roles, locales, proximity bands, and evidence language. Use after architecture design and before contamination or semantic QA.

elvisun/newsjack · 55 tokens

build-ai-visibility-panel

Research any company, product, or service from a URL plus description and build a comprehensive, evidence-bound AEO/GEO/AI-visibility prompt panel across buyer jobs, information acts, journey states, B0-B5 proximity, aided status, roles, locales, variants, partitions, surfaces, and measurement lanes. Use when a user…

elvisun/newsjack · 117 tokens

ai-visibility-panel-design

Select QA-approved canonical intent cells into a versioned AI-visibility tracking panel with partitions, variants, lanes, surfaces, locales, repetitions, separate exposure and priority weights, randomization, uncertainty, refresh rules, and campaign controls. Use after prompt QA or when revising an existing panel.

elvisun/newsjack · 64 tokens

cosmos-dbt-core

Turns a dbt Core project into an Airflow DAG/TaskGroup using Astronomer Cosmos. Use turning a dbt Core project into an Airflow DAG or TaskGroup with Astronomer Cosmos. Before implementing, verify dbt engine, warehouse, Airflow version, execution environment, DAG vs TaskGroup, and manifest availability.

astronomer/agents · 73 tokens