Nodes/AUN ComfyUI Nodes/AUN Prompt Cycler
ComfyUI Node

AUN Prompt Cycler

Rotate through an endless list of prompts like a jukebox

By loz2754·Created 8 months ago·Updated a day ago· 5
AUN Prompt Cycler
    • prompt
    • prompt_title
    • index
    cycle_modemanual
    manual_index1
    range_indices1-10
    search_query
    custom_promptsMountain:A majestic mountain landscape at sunset with golden light. City:A futuristic city with flying cars and neon lights. Forest:A peaceful forest with sunlight filtering through trees. Coral:An underwater scene with colorful coral reefs and fish. Cabin:A cozy cabin in the woods during winter snowfall. Space:A space station orbiting a distant planet. Marketplace:A bustling marketplace in an ancient city. Lake:A serene lake with mountains reflected in the water. Laboratory:A steampunk laboratory with brass gears and steam. Garden:A magical garden with glowing flowers and butterflies.

    Batching out a folder of variations means changing the prompt between runs, and the old way - editing a text box between every generation - is how you spend a whole afternoon. AUN Prompt Cycler automates it: feed it a list of prompts, and every run advances to the next one (or a random one, or one from a filtered subset). It's a direct descendant of tenitsky's prompt cycler, extended with search, ranges, and titled prompts, and it's the quiet workhorse behind a lot of AUN example workflows.

    How it works

    It keeps a running position internally, and each execution returns the current prompt plus its title and index. Modes:

    • Sequential - step through in order, wrapping around. The default, and the one you'll use for "generate all 10 of these."
    • Random - pick any prompt each run. Great for exploration batches.
    • Manual - manual_index picks a specific prompt (1-based). The "give me #4" mode.
    • Range - a comma-separated list of indices or ranges like 1,2,4-8,11. Think "skip the ones I've already seen."
    • Search - filter the list by keyword before cycling. mountain sunset means both words (AND), mountain, forest means either (OR), and you can combine: mountain sunset, forest is (mountain AND sunset) OR forest. Case-insensitive.

    Prompts go into custom_prompts, one per line, and you can give each a title with Title: Prompt text - the part before the colon becomes prompt_title and the rest becomes the prompt. Lines without a title get auto-generated ones like "Prompt 1." That title output is the sleeper feature: AUN's compact-mode overlays and the AUN_prompt_cycler_selected WebSocket event use it, and you can wire it to a text display to see which prompt is live without reading the whole thing.

    The outputs

    • prompt (STRING) - goes to your CLIP Text Encode node.
    • prompt_title (STRING) - the title of the active prompt.
    • index (INT) - the 1-based position. This is the hook that makes the AUN ecosystem click: wire it into a Random Multi-LoRA Model Loader's prompt_index and each prompt automatically pulls its matching LoRA set and trigger words. The README's flagship example is exactly that chain.

    Why you'd reach for it

    If you're doing any kind of prompt-ab test or batch exploration, this replaces a pile of manual edits with one queue run. The combination that really shines is cycler → multi-LoRA loader: 20 prompts, each with its own LoRA stack, generating in one go. For that alone the pack is worth installing.

    Install

    Part of AUN ComfyUI Nodes (loz2754):

    cd ComfyUI/custom_nodes
    git clone https://github.com/loz2754/AUN-ComfyUI-Nodes
    

    or ComfyUI Manager → search "AUN ComfyUI Nodes" → install → restart. Deps (piexif, opencv-python-headless, imageio-ffmpeg, requests) come via Manager; no model downloads.

    Gotchas

    The internal position is session state - it remembers across runs in the same ComfyUI session, so don't expect a fresh random start unless you restart or reset the node. And because it holds state, two cyclers in one workflow each advance independently, which is usually what you want but occasionally confusing. If a prompt has a colon in it and you want a title, that's ambiguous - the first colon wins as the title separator, so keep titles clean.

    CategoryAUN Nodes/Prompts

    Inputs (5)

    NameTypeDefaultDescription
    cycle_modeCOMBOmanualHow to cycle prompts: manual (pick by index), sequential (step through), random, range (e.g. '1,2,4-8,11'), or search (filter by text).
    manual_indexINT11–18446744073709550000Manually select a prompt by index (1-based). Used when cycle_mode is 'manual'.
    range_indicesSTRING1-10Comma-separated indices or ranges for range mode (1-based), e.g. '1,2,4-8,11'.
    search_querySTRINGSearch for prompts (case-insensitive). Space = AND (e.g., 'mountain sunset'), comma = OR (e.g., 'mountain, forest'). Combines: 'mountain sunset, forest' matches (mountain AND sunset) OR forest.
    custom_promptsoptSTRINGMountain:A majestic mountain landscape at sunset with golden light. City:A futuristic city with flying cars and neon lights. Forest:A peaceful forest with sunlight filtering through trees. Coral:An underwater scene with colorful coral reefs and fish. Cabin:A cozy cabin in the woods during winter snowfall. Space:A space station orbiting a distant planet. Marketplace:A bustling marketplace in an ancient city. Lake:A serene lake with mountains reflected in the water. Laboratory:A steampunk laboratory with brass gears and steam. Garden:A magical garden with glowing flowers and butterflies.Enter your own prompts, one per line. Optional title: use 'Title: Prompt text' format. Lines without a title get auto-generated ones (e.g., 'Prompt 1').

    Outputs (3)

    NameTypeDescription
    promptSTRING
    prompt_titleSTRING
    indexINT