Nodes/ComfyUI-CraftKit/Smart Prompt Controller πŸ“‹
ComfyUI Node

Smart Prompt Controller πŸ“‹

Cycle prompts without a wall of Primitive nodes

By CraftopiaStudioΒ·Created 6 months agoΒ·Updated a day agoΒ· 2
Smart Prompt Controller πŸ“‹
    • prompt
    • active_list
    β—„index1β–Ί
    β—„prompt_list_1β€”β–Ί
    β—„prompt_list_2β€”β–Ί
    β—„prompt_list_3β€”β–Ί
    β—„prompt_list_4β€”β–Ί

    If you've ever built a batch workflow that rotates through prompts, you know how fast it turns into index math, a pile of Primitive nodes, and a headache you only debugged because you had to. Smart Prompt Controller is the "make the prompts rotate themselves" node: up to four prompt lists, one incrementing index, and it counts the lines, picks the right one, and tells you which list it's currently in.

    It's part of ComfyUI-CraftKit, and it's built for a specific, very real workflow: generating a LoRA dataset in categories. Headshots, halfbody, fullbody, tall portrait - each with its own prompt list, and usually its own aspect ratio. The controller cycles the prompts; its sibling node Smart Profile Switch handles the per-category resolution. Together they replace what would otherwise be a small graph of its own.

    How it works

    You give it up to four prompt lists, one prompt per line, in STRING inputs. The index input is your position across all lists, 1-indexed, and the node wraps around - hit the end and it cycles back to the start. The clever part is that it does the counting for you: dump 5 headshot prompts in list 1 and 10 fullbody prompts in list 2, and it walks 1–5, then 6–15, with zero padding or manual tracking. Uneven categories just work.

    The status label on the node shows where you are: List 1 - 4/5 | total: 8. And because the index widget has "control after generate" set to increment in the node definition, each run auto-advances - set it once and let a batch run itself.

    The inputs that matter

    • Index - your cursor across all lists. It increments automatically, but you can also drive it from another node if you want non-sequential control.
    • Prompt list 1 - the one you'll definitely use. It's a forceInput STRING, which means you can't type into the widget; you wire a multiline text node into it. That trips people up the first time.
    • Prompt lists 2–4 - optional. The node just skips whatever is empty.

    The two outputs are the point: prompt (the selected line, wired to your CLIP Text Encode / positive prompt) and active_list (an INT, 1–4, wired into a Switch node or straight into Smart Profile Switch).

    Installing it

    ComfyUI Manager: search for ComfyUI-CraftKit. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/CraftopiaStudio/ComfyUI-CraftKit
    

    Restart, and it's under CraftKit in the menu. No extra dependencies - Pillow, NumPy and PyTorch all ship with ComfyUI.

    Gotchas

    • If no list has any lines, you get an empty prompt and active_list 0. The status label just says "no prompts connected." Easy to diagnose once you know the label exists.
    • active_list is 1-based and refers to the physical list number (1–4), not the global position. That's what you want for a switch, but it's worth knowing.
    • It's an output node, so it always executes - that's deliberate, so the status label renders. Don't be confused if it shows up in the "executed" list.

    It's a small node that saves you from a genuinely fiddly pattern. If you do dataset generation in batches - not just LoRA, but any "many variations of the same scene" workflow - this is the one you'll keep.

    CategoryCraftKit

    Inputs (5)

    NameTypeDefaultDescription
    indexINT11–99999Current position across all lists.
    prompt_list_1optSTRINGPrompt list, one prompt per line.
    prompt_list_2optSTRINGOptional second prompt list.
    prompt_list_3optSTRINGOptional third prompt list.
    prompt_list_4optSTRINGOptional fourth prompt list.

    Outputs (2)

    NameTypeDescription
    promptSTRINGβ€”
    active_listINTβ€”