---
name: diffusion-prompt-library
description: A curated, tagged prompt library for diffusion models with negative-prompt presets and CFG/sampler defaults.
title: Diffusion Prompt Library
category: image-video
difficulty: beginner
license: CC-BY-SA-4.0
author: admin
source_url: "https://github.com/CompVis/stable-diffusion"
icon: 🖼️
input: text
output: structured-json
phase: enhance
domain: design
tags: diffusion-models,prompt-engineering,yaml-templates,tag-based-retrieval,negative-prompts,model-agnostic,sampler-config,cfg-presets,sdxl,flux,prompt-composition,library-curation
best_for:
  - Reducing diffusion prompt iteration time and variance
  - Standardizing image generation workflows across model families
  - Building reusable prompt scaffolding for design teams
---

## Description

Ships as a structured YAML bundle + a loader. Prompts are tagged by subject, style, era, color palette, and technical settings (CFG, sampler, steps). The loader composes a final prompt from user intent + the best-matching library entries.

## Why it works

Diffusion prompting is the quintessential 'small input, huge output-variance' problem: the same subject produces wildly different images depending on style hooks, camera vocabulary, and negative prompts. A curated library encodes hard-won knowledge (what actually helps, what's cargo-culted) and the loader pattern means a user's four-word prompt gets augmented with the right 25-word skeleton automatically.

## How it works

1) Library is YAML: `id, subject_tags, style_tags, prompt_template, negative_template, cfg, sampler, steps, sample_url`. 2) Loader takes user intent + optional overrides. 3) Classifies user intent via a small LLM into subject + desired style tags. 4) Selects the top-3 library entries by tag cosine-similarity. 5) Merges: subject from user + scaffolding from the chosen entry + negative prompts + sampler params. 6) Returns the final payload in the target model's dialect (SDXL, Flux, Ideogram). 7) Caches the last-N generations per user so the library grows personalized over time.
