Skip to content

A wildcard management extension for Stable Diffusion WebUI.

Notifications You must be signed in to change notification settings

SiliconeShojo/Codex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codex - Wildcard Gallery for Stable Diffusion WebUI

Extension Preview

Note

This is a fork of navimixu/wildcard-gallery, modified to work independently without requiring external dependencies like sd-dynamic-prompts.


📖 Table of Contents


🚀 What is Codex?

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.

📥 Installation

Method 1: Install from URL (Recommended)

  1. Open Stable Diffusion WebUI.
  2. Go to ExtensionsInstall from URL.
  3. Paste this repository URL.
  4. Click Install.
  5. Restart the WebUI completely.

Method 2: Manual Install

Clone the repo into your extensions folder:

git clone https://github.com/SiliconeShojo/Codex.git

📝 Wildcard Management & Syntax

Codex 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.

TXT Files (Simple Lists)

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__

YAML Files (Structured Categories)

Create extensions/codex/wildcards/styles.yaml:

artistic:
  oil:
    - thick impasto oil painting
    - classical oil portrait
  watercolor:
    - soft watercolor style
    - wet-on-wet technique

Usage: __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.


🎨 Visual Gallery & Previews

Using the Gallery

  1. Navigate to the Extra Networks panel (where Lora/Checkpoints are).
  2. Click the "Codex" tab.
  3. Clicking a card inserts the syntax (e.g., __wildcard__) into your prompt.

Generating Previews

Make your gallery beautiful by generating preview images for your text files.

  1. Go to txt2img.
  2. Open the "Codex preview utils" script in the scripts dropdown.
  3. Select Wildcards: Use the dropdown or path selector to choose files.
  4. Insertion Method:
    • AFTER/BEFORE: Appends wildcard to current prompt.
    • SEARCH & REPLACE: Replaces specific text with the wildcard.
  5. Click Generate.

❓ Troubleshooting

Wildcards not showing?
  • Ensure files are in extensions/codex/wildcards/.
  • Ensure file extensions are .txt or .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.

Credits

This project is a shameless steal 🕵️ (fork) from navimixu/wildcard-gallery.


Moe Counter

About

A wildcard management extension for Stable Diffusion WebUI.

Topics

Resources

Stars

Watchers

Forks