Prompt Logic
Create dynamic prompts with rules
In the Categories & Keys & Templates guide, we covered the foundational elements of PromptAnvil. Now, let's explore how to elevate your prompt generation using Prompt Logic.
PromptAnvil isn't just about random variations; it's about creating coherent, context-aware prompts. Prompt Logic allows you to integrate advanced logical rules to generate more relevant and targeted outputs. By defining specific conditions and actions, you can control how different elements interact with each other.
Types of Logic Rules
PromptAnvil offers 5 types of logic rules to control your prompt generation:
SETForce Specific Values
Forces a specific value to be included in the prompt when certain conditions are met.
Example: If Animal = "polar bear", then SET Location = "arctic"
This ensures polar bears always appear in arctic settings.
BOOSTIncrease Probability
Increases the probability of certain values appearing together without forcing them.
Example: If Style = "minimalist", BOOST Color = "white" and Color = "gray"
Neutral colors become more likely in minimalist prompts.
PROMPTOverride Entire Prompt
Completely replaces the template with a custom prompt when conditions are met.
Example: If Theme = "abstract", PROMPT "Chaotic blend of shapes and colors"
Useful for special cases that need unique phrasing.
EXCLUDERemove Conflicting Values
Prevents specific values from appearing when certain conditions are met.
Example: If Animal = "camel", EXCLUDE Location = "arctic"
Prevents nonsensical combinations like camels in the arctic.
FILTERKeep Only Specific Values
Keeps only specific values and discards all others for a key.
Example: If Theme = "ocean", FILTER Color to only ["blue", "teal", "aqua"]
Limits color choices to ocean-appropriate values.
Core Principle: If a condition is met, the specified action is applied using the selected rule type.
AI-Powered Logic Generation
Creating logic rules manually can be complex. That's why PromptAnvil includes an AI assistant to help you.
How It Works
- •AI analyzes your categories, templates, and keys
- •Generates 5 intelligent rule suggestions based on your configuration
- •You review and approve suggestions before they're applied
- •Perfect for beginners or when you need quick setup