ComfyUI Node

Prompt Core

Assemble reusable prompts from logs and placeholders, not copy-paste

By sickollie·Created 2 months ago·Updated 27 days ago· 30
Prompt Core
    • final_prompt
    • source_prompt
    • prompt_line
    • outfit_line
    • scene_line
    • prompt_index_resolved
    • outfit_index_resolved
    • scene_index_resolved
    • prompt_count
    • outfit_count
    • scene_count
    • prompt_file
    • outfit_file
    • scene_file
    ◄prompt_sourcemanual►
    ◄manual_prompt►
    ◄prompt_log_file[None]►
    ◄prompt_modeincrement►
    ◄prompt_index0►
    ◄outfit_token_AOUTFIT_A►
    ◄outfit_log_file_A[None]►
    ◄outfit_mode_Arandomize►
    ◄outfit_index_A0►
    ◄outfit_token_BOUTFIT_B►
    ◄outfit_log_file_B[None]►
    ◄outfit_mode_Brandomize►
    ◄outfit_index_B0►
    ◄outfit_token_COUTFIT_C►
    ◄outfit_log_file_C[None]►
    ◄outfit_mode_Crandomize►
    ◄outfit_index_C0►
    ◄scene_tokenSCENE►
    ◄scene_log_file[None]►
    ◄scene_moderandomize►
    ◄scene_index0►
    ◄name_tokenNAME►
    ◄name_value►
    ◄item_tokenITEM►
    ◄item_value►
    ◄prefix_enabledfalse►
    ◄prefix_text►
    ◄suffix_enabledfalse►
    ◄suffix_text►
    ◄prefix_suffix_separator, ►
    ◄cleanup_enabledtrue►
    ◄cleanup_rules\?\[|\] \\?[()] :\s*[+-]?(?:\d+(?:\.\d*)?|\.\d+)►
    ◄saved_prompt►
    ◄manual_prompt_input—►

    If you test LoRAs for a living, you've typed some version of the same prompt two hundred times: a subject name, an outfit description, a scene, and a pile of style words. SickOllie's Prompt Core (Classic family, class SOPromptLogEngine) is the node that makes you stop doing that. It takes one source prompt plus reusable components - outfits A/B/C, a scene, a NAME, an ITEM - and assembles a final string at execution time, so the same graph can produce a hundred variations by rotating text files instead of editing a text box.

    How it works

    The engine reads from one of two places: manual_prompt typed directly, or a prompt_log_file picked from the .txt libraries under ComfyUI/input/SickOllieLogs/prompts/. Each component stream - prompt, three outfit streams, and scene - has its own file picker and its own mode dropdown: fixed, increment, decrement, randomize, or shuffle. That's how you build a test campaign without a single extra node: randomize the outfit, increment the scene, keep the prompt fixed.

    Tokens do the substitution. The default tokens are NAME, OUTFIT_A/OUTFIT_B/OUTFIT_C, SCENE, and ITEM, each with a configurable token string and a value. NAME typically comes from your Loader Core's clean_name output; the others come from their log files. There's also an optional prefix/suffix with its own separator (default , ) and a cleanup pass that strips regex matches - the default rule removes things like [x], (y), and trailing :weight artifacts, which is exactly the junk logs accumulate.

    On each run it resolves the indexes, applies the tokens, cleans up, and hands you the finished string. If a configured log file is missing, it self-heals to [None] and falls back to Manual rather than blocking the queue.

    Inputs and outputs that matter

    The one output you care about is final_prompt - wire it into Generation Core's positive_text. The rest of the fourteen outputs exist so Classic workflows can trace what actually ran: source_prompt, prompt_line, outfit_line, scene_line, the resolved indexes and counts (prompt_index_resolved, outfit_index_resolved, scene_index_resolved, prompt_count, outfit_count, scene_count), and the file stems (prompt_file, outfit_file, scene_file). Those feed Output Core's filenames so your saved files encode which outfit and scene made them.

    Installing it

    It's in the SickOllie pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/sickollie/SickOllie
    

    or ComfyUI Manager → search "SickOllie". Restart and Ctrl+F5. Don't forget the starter logs: copy the SickOllieLogs folder from the pack's Starter Content into ComfyUI/input/ so the dropdowns have files to pick from.

    Where people get burned

    The classic trap is expecting a token to be replaced when it's not in the prompt. Prompt Core only substitutes what's there - if your manual prompt never mentions SCENE, the scene line won't insert. That's by design in Classic (Studio adds explicit placement modes); the fix is to put the tokens in your template. The other common hiccup is renaming a log file after selecting it - the selection goes stale, Prompt Core self-heals to [None], and you reselect. If a saved prompt looks wrong, check whether cleanup rules are eating something you actually wanted; that regex is powerful enough to mangle a prompt if you loosen it.

    CategorySick Ollie/Classic

    Inputs (34)

    NameTypeDefaultDescription
    prompt_sourceCOMBOmanual3 options: manual, input, log
    manual_promptSTRING—
    prompt_log_fileCOMBO[None]5 options: [None], prompts/Creative Library/MASTER - Ready Prompts.txt, prompts/Creative Library/MASTER - Saved Recipe Prompts.txt, prompts/Creative Library/Prompts/All Prompts.txt, prompts/Creative Library/Templates/All Templates.txt
    prompt_modeCOMBOincrement5 options: fixed, increment, decrement, randomize, shuffle
    prompt_indexINT0-2147483648–2147483647—
    outfit_token_ASTRINGOUTFIT_A—
    outfit_log_file_ACOMBO[None]2 options: [None], outfits/Creative Library/MASTER - Outfit Looks.txt
    outfit_mode_ACOMBOrandomize5 options: fixed, increment, decrement, randomize, shuffle
    outfit_index_AINT0-2147483648–2147483647—
    outfit_token_BSTRINGOUTFIT_B—
    outfit_log_file_BCOMBO[None]2 options: [None], outfits/Creative Library/MASTER - Outfit Looks.txt
    outfit_mode_BCOMBOrandomize5 options: fixed, increment, decrement, randomize, shuffle
    outfit_index_BINT0-2147483648–2147483647—
    outfit_token_CSTRINGOUTFIT_C—
    outfit_log_file_CCOMBO[None]2 options: [None], outfits/Creative Library/MASTER - Outfit Looks.txt
    outfit_mode_CCOMBOrandomize5 options: fixed, increment, decrement, randomize, shuffle
    outfit_index_CINT0-2147483648–2147483647—
    scene_tokenSTRINGSCENE—
    scene_log_fileCOMBO[None]2 options: [None], scenes/Creative Library/MASTER - Scenes.txt
    scene_modeCOMBOrandomize5 options: fixed, increment, decrement, randomize, shuffle
    scene_indexINT0-2147483648–2147483647—
    name_tokenSTRINGNAME—
    name_valueSTRING—
    item_tokenSTRINGITEM—
    item_valueSTRING—
    prefix_enabledBOOLEANfalse—
    prefix_textSTRING—
    suffix_enabledBOOLEANfalse—
    suffix_textSTRING—
    prefix_suffix_separatorSTRING, —
    cleanup_enabledBOOLEANtrue—
    cleanup_rulesSTRING\?\[|\] \\?[()] :\s*[+-]?(?:\d+(?:\.\d*)?|\.\d+)—
    saved_promptSTRING—
    manual_prompt_inputoptSTRING—

    Outputs (14)

    NameTypeDescription
    final_promptSTRING—
    source_promptSTRING—
    prompt_lineSTRING—
    outfit_lineSTRING—
    scene_lineSTRING—
    prompt_index_resolvedINT—
    outfit_index_resolvedINT—
    scene_index_resolvedINT—
    prompt_countINT—
    outfit_countINT—
    scene_countINT—
    prompt_fileSTRING—
    outfit_fileSTRING—
    scene_fileSTRING—