Nodes/arkennemasis Nodes/arkennemasis Prompt Build (substitution, no LLM)
ComfyUI Node

arkennemasis Prompt Build (substitution, no LLM)

The prompt builder that only substitutes

By Hishamahmer·Created 2 months ago·Updated 9 days ago· 9
arkennemasis Prompt Build (substitution, no LLM)
    • prompt
    • constant_hash
    • prompt_hash
    • change_only
    recipe_json{}
    cell_json{}
    extra_constant
    audit_dir

    Here's the uncomfortable thing the arkennemasis runbook admits outright: letting a language model author each variation prompt individually was the original design, and it's the one change the pipeline's authors say must not be implemented. Independently written prompts differ in incidental wording, and incidental wording moves the camera. ArkPromptBuild is the replacement - it assembles one cell's prompt by pure string substitution. No model call, no cost, no latency, and no way for two cells to drift apart.

    The required property is brutal and simple: same prompt except the slot → same image except the slot. Build guarantees it by construction. The change instruction (template plus that cell's values) varies. The product invariants, Lock A (product identity) and Lock B (scene continuity) are appended from the recipe and are byte-identical across the entire run.

    How it works

    The node takes a template from the recipe with {slots} in it - things like {region}, {hex}, {description}, {axis}, {value} - and fills them from the cell. Two details make it smarter than a blind .replace():

    • Unknown slots raise. If you type {regoin} it fails on the first cell rather than shipping literal {regoin} text to the generator on every cell.
    • Sentences that lose their only content get dropped whole. A client who supplies a hex and no prose would otherwise produce "The top-panel is ." - noise the generator has to interpret, on every hex-only value. The node detects that and removes the sentence instead.

    Inputs and outputs

    • recipe_json, cell_json - the two required inputs, straight from Recipe Compile and the cell stage.
    • extra_constant - optional text appended to every prompt after the locks. Good for backend-specific phrasing that helps a particular model, but it joins the constant block, so it must not mention anything cell-specific.
    • audit_dir - optional folder. Each built prompt is written as <key>.prompt.txt, and the constant hash is appended to constants.log. Set it if you plan to run the audit.
    • prompt - the finished string for the generator.
    • constant_hash - hash of the invariant block plus both locks. Every cell must produce the same value.
    • prompt_hash - hash of the whole prompt.
    • change_only - just the varying part, handy for eyeballing what actually differs between cells.

    Install

    One of 61 nodes in the arkennemasis pack, and one of the few that needs nothing but the pack itself:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Hishamahmer/comfyui-arkennemasis
    pip install -r ComfyUI/custom_nodes/comfyui-arkennemasis/requirements.txt
    

    Restart ComfyUI, or use Manager → Install via Git URL.

    Troubleshooting

    • "Template contains unknown slot(s)" - you have a typo in a {slot}. The error names the offenders and the valid list.
    • Prompts differ between cells beyond the slot - the extra_constant probably mentions something cell-specific. It must not; it joins the hashed constant block.
    • Audit shows nothing - you didn't set audit_dir, so no constants.log exists yet.

    Where people get burned: they skip the audit because the prompts look fine. The whole point of hashing the constant block is that drift is invisible at a glance and costs a paid regeneration to discover. Wire the folder, run the check, sleep better.

    Categoryarkennemasis/Variation

    Inputs (4)

    NameTypeDefaultDescription
    recipe_jsonSTRING{}
    cell_jsonSTRING{}
    extra_constantoptSTRINGOptional extra text appended to EVERY prompt, after the locks — a backend-specific phrasing that helps this particular model. It joins the constant block, so it must not mention anything cell-specific.
    audit_diroptSTRINGOptional folder. Every built prompt is written there as <key>.prompt.txt, and the constant hash is appended to constants.log — which is what Prompt Audit reads.

    Outputs (4)

    NameTypeDescription
    promptSTRING
    constant_hashSTRING
    prompt_hashSTRING
    change_onlySTRING