Nodes/ComfyUI-Prompt_util_pack/Prompt Hidden Processor
ComfyUI Node

Prompt Hidden Processor

[[smile;laugh;neutral]] — variation blocks without a wildcard pack

By fmartinellidev·Created 8 months ago·Updated 8 months ago· 0
Prompt Hidden Processor
    • input_prompt
    • clean_prompt
    promptA portrait of [[smile;neutral;laugh]], soft lighting, studio background
    input_index_split0
    delimiter_pair[[ ]]

    The Prompt Hidden Processor is the dynamic-prompt trick made explicit: you write A portrait of [[smile;neutral;laugh]] into your prompt, and this node swaps the whole [[...]] block for whichever option you pick. It's the same idea as the old wildcard and bracket systems from the A1111 days - batch a grid of expressions and lighting setups without editing the graph - but here it's just a node in the graph, no extra pack required.

    The appeal is control. You're not sampling randomly; you're picking option N and getting the same variation every time for a given input_index_split. That's the "controlled facial variation, no random sampling" use case the pack's README advertises, and it's genuinely useful when you're building a character-reference library or a dataset for LoRA training where you want every expression you planned for, in order, not whatever the random number generator felt like.

    How it works

    The node scans your prompt for every [[...]] block, splits each block's contents on ;, and replaces it with the option at input_index_split (0-based). Two delimiters are available: [[ ]] (the default) and ## ## for when your prompt is full of brackets already. If the index is out of range for a block, it clamps to the last option rather than failing.

    It gives you two outputs, and they answer different questions:

    • input_prompt - the prompt with each hidden block replaced by its chosen option. This is what you wire into your positive conditioning.
    • clean_prompt - the same prompt with all hidden blocks deleted, brackets and all. That's the "what am I actually sampling without variation" view, handy for sanity-checking or logging a baseline.

    The inputs that matter: prompt (multiline, your text with hidden blocks), input_index_split (which option to use across every block, 0–99), and delimiter_pair (the two choices above).

    Where people get burned

    • One index for all blocks. input_index_split applies to every [[...]] in the prompt. There's no per-block index, so you can't have a smile block pick option 1 and a lighting block pick option 2 at the same time. If you need independent choices, you'll chain two of these nodes.
    • Empty prompt, empty outputs. Both outputs come back blank on empty input - no error, just silence.
    • Single-option blocks are pointless. [[smile]] collapses to smile and adds nothing but a variable that isn't.

    The intended chain in the pack: the Snippet Extractor feeds a caption, this node resolves the [[...]] variations, and the Variable Substitutor fills in the @key placeholders like @lighting that the README's example leaves dangling. That last bit matters - a {placeholder} left in your prompt becomes literal text the model will happily try to render.

    Installation

    It's in the four-node Prompt util pack, pure Python with no dependencies and no models to download:

    cd ComfyUI/custom_nodes
    git clone https://github.com/fmartinellidev/ComfyUI-Prompt_util_pack
    

    Restart ComfyUI, or grab it from ComfyUI Manager by searching "Prompt_util_pack". Works with any checkpoint. If the README ever shows you an example, trust the node's own behavior over the docs - they've drifted apart.

    Categoryprompt/util_pack

    Inputs (3)

    NameTypeDefaultDescription
    promptSTRINGA portrait of [[smile;neutral;laugh]], soft lighting, studio background
    input_index_splitINT00–99
    delimiter_pairCOMBO[[ ]]2 options: [[ ]], ## ##

    Outputs (2)

    NameTypeDescription
    input_promptSTRING
    clean_promptSTRING