CivArchive
    SmartWildcardLoader - v1.02
    Preview 119911853
    Preview 119908310
    Preview 120579427
    Preview 120579429
    Preview 120579426
    Preview 120579425
    Preview 120579428

    I use many wildcards, but I often felt like I was seeing the same results too often. So, I 'VibeCoded' this node with a memory feature to avoid the last (x) used wildcard words.

    I'm just sharing it with the community – if you need help, I'll try my best, or you can always ask Gemini or ChatGPT.

    Have fun!

    Smart Wildcard Loader: Quick Start

    Update Notes: Smart Wildcard Loader (v1.03)

    Improved Parsing & Debugging

    • Robust Wildcard Handling: The parser now intelligently ignores incomplete or unclosed markers (e.g., __unfinished_tag), preventing prompt corruption.

    • Enhanced Debugging: Added console warnings for invalid markers and missing wildcard files when debug is enabled.

    New Features (v1.02)

    • Auto-Pool Mode: Set history_depth to 0 to automatically detect file length. It will exhaust every single line before any word repeats.

    • Reset Button: Use the reset_history toggle to instantly wipe the memory and all frequency stats.

    • Frequency Tracking: If history_depth > 0, the console highlights repeated picks in RED and tells you exactly how often they have appeared.

    • Skip Counter: Tracks the node's "workload" by counting how many lines were skipped to respect your history settings.


    1. Setup

    • File: Save SmartWildcard.py in ComfyUI/custom_nodes/.

    • Folder: Create a wildcards folder in your main ComfyUI/ directory.

    • Content: Put your .txt files (one option per line) inside that folder.

    2. How to Use

    • Inline: {red|blue|green} picks one color directly from your text.

    • Files: __subjects__ picks a random line from wildcards/subjects.txt.

    • Multi-Pick: __colors__+3 picks 3 unique colors from the file.

    • Pattern Search: __*locati*__ finds any file containing "locati" (like locations.txt or old_location.txt).

    • Nested: You can mix them! Example: {__hero__|__villain__} in __*world*__.

    3. Settings Explained

    • history_depth: * 0 (Recommended): The "Auto-Pool". Remembers everything until the file is empty.

      • 1+: Fixed memory. Remembers the last X items and blocks them.

    • reset_history: Set to True to clear the brain. (Turn back to False after one run).

    • debug: Enables the color-coded live feed in your terminal.

    4. Reading the Debug Logs (Console)

    • 🟒 [CHOICE]: The word picked from your file.

    • πŸ”΄ (Repeat!): Only appears if a word is picked again (helps you tune your history depth).

    • 🟑 [STATS]: Pool 400/452 means 400 fresh lines are left; Skips shows how many were blocked.

    • πŸ”΅ [RESET]: The pool was empty, so the node started a new cycle.

    • 🟣 [TIMER]: Shows exactly how many milliseconds the processing took.


    Why use this?

    • Total Variety: Ensures you see every single line of your wildcard files before a repeat occurs.

    • Deep Logic: Files can contain other tags, allowing for infinitely complex prompt chains.

    • Efficiency: All memory is stored in RAM. It’s fast and resets when you restart ComfyUI.

    Description

    Other
    ZImageTurbo

    Details

    Downloads
    25
    Platform
    CivitAI
    Platform Status
    Available
    Created
    2/4/2026
    Updated
    2/11/2026
    Deleted
    -

    Files

    smartwildcardloader_v102.zip

    Mirrors

    CivitAI (1 mirrors)