Categories & Keys & Templates

Understanding the building blocks

3 min read

Before we get right into how the whole tool works, let's first understand the building blocks of PromptAnvil: Categories, Templates and Keys.

Categories

Categories are groups that define the generated prompts. They help you organize and structure your prompts effectively when creating large batches. Each category can contain multiple prompt templates.

Tip: If your main goal is to create prompts for a specific style or theme, you can use just 1 category and add all your templates inside it.

Prompt Templates

Prompt Templates are the blueprints for generating prompts. They define the raw output format that PromptAnvil uses to create variations. Each template can include different keys — placeholders that get replaced with specific values during generation.

For maximum variety: Create multiple templates within a category. PromptAnvil can mix and match different templates to produce a wider range of outputs.

Use different keys across your templates to cover more aspects and details in your prompts.

Keys & Weights

Keys are the wildcards or variables within your prompt templates. They represent specific attributes that can vary in the generated prompts.

Template: "A {Animal} sitting on a {Surface}"

Keys: Animal (cat, dog, bird) | Surface (chair, rock, branch)

When creating keys, think about the different attributes relevant to your prompts. More diverse and specific keys lead to richer, more varied outputs.

Understanding Weights

Each key has a Weight property that determines how often a specific value will appear in the generated prompts. Higher weight values increase the likelihood of that value being selected during prompt generation.

Example: If you have a key "Color" with values "red" (weight: 1.0), "blue" (weight: 0.5), and "green" (weight: 0.2), the value "red" will appear more frequently in the generated prompts compared to "blue" and "green".

The Problem: Contradictions

While random key selection offers variety, it creates one critical issue: Contradictions.

For example, if you have a prompt template like "{Animal} in the {Location}" and your keys have values like "polar bear", "camel" for Animal and "desert", "arctic" for Location, you might end up with nonsensical prompts like "polar bear in the desert" or "camel in the arctic".

How do you solve this? Prompt Logic Rules