Note
This is a fork of navimixu/wildcard-gallery, modified to work independently without requiring external dependencies like sd-dynamic-prompts.
Codex is a visual wildcard manager and gallery system for Stable Diffusion. It solves the problem of managing thousands of text prompts by providing a visual card-based interface.
Key Capabilities:
- 🖼️ Visual Browser: Organize wildcards as cards in the Extra Networks panel.
- ⚡ One-Click Insertion: Click a card to insert the wildcard path directly into your prompt.
- 🎲 Advanced Engine: Native support for standard wildcards, variants (
{a|b}), and sampling. - 📸 Preview System: Generate preview images to see exactly what a wildcard produces before you use it.
- 🔧 Zero Dependencies: Works out of the box. No other extensions required.
- Open Stable Diffusion WebUI.
- Go to Extensions → Install from URL.
- Paste this repository URL.
- Click Install.
- Restart the WebUI completely.
Clone the repo into your extensions folder:
git clone https://github.com/SiliconeShojo/Codex.gitCodex uses its own internal directory for wildcards.
Location: extensions/codex/wildcards/
📂 1. File Formats (Click to expand)
You can use simple .txt files or structured .yaml files.
Create extensions/codex/wildcards/characters/heroes.txt:
# This is a comment
a brave knight in shining armor
a mysterious wizard
a cyberpunk netrunner
Usage: __characters/heroes__
Create extensions/codex/wildcards/styles.yaml:
artistic:
oil:
- thick impasto oil painting
- classical oil portrait
watercolor:
- soft watercolor style
- wet-on-wet techniqueUsage: __styles/artistic/oil__
🎲 2. Dynamic Syntax Guide (Click to expand)
Codex features a built-in parser for advanced prompting logic.
| Type | Syntax | Result |
|---|---|---|
| Standard | __filename__ |
Picks 1 random line from a .txt file or .yaml category. |
| Variants | {red|blue|green} |
Randomly chooses one option (e.g., "red"). |
| Sampling | __3$$colors__ |
Picks 3 unique entries, joined by the default , . |
| Sampling | __5$$|$$adjectives__ |
Picks 5 entries, joined by a custom separator |. |
| Nested | __meta_wildcard__ |
Wildcards inside wildcards are automatically resolved. |
Avoid extra spaces: The parser is space-sensitive. Use
__3$$colors__rather than__3$$ colors__to ensure the name matches your local wildcard files or YAML keys exactly.
- Navigate to the Extra Networks panel (where Lora/Checkpoints are).
- Click the "Codex" tab.
- Clicking a card inserts the syntax (e.g.,
__wildcard__) into your prompt.
Make your gallery beautiful by generating preview images for your text files.
- Go to txt2img.
- Open the "Codex preview utils" script in the scripts dropdown.
- Select Wildcards: Use the dropdown or path selector to choose files.
- Insertion Method:
- AFTER/BEFORE: Appends wildcard to current prompt.
- SEARCH & REPLACE: Replaces specific text with the wildcard.
- Click Generate.
Wildcards not showing?
- Ensure files are in
extensions/codex/wildcards/. - Ensure file extensions are
.txtor.yaml. - Check the console for
[Codex]indexing logs.
Previews not generating?
- Verify the "Codex preview utils" script is active.
- Ensure you have selected a wildcard in the script dropdown.
Wildcards not replacing in generation?
- Check "Enable Wildcard Replacement" in the Codex accordion.
- Verify the wildcard name matches the filename exactly.
This project is a shameless steal 🕵️ (fork) from navimixu/wildcard-gallery.
- Original Author: navimixu