Nodes/ComfyUI-JNodes/Make Parameter Table
ComfyUI Node

Make Parameter Table

Parse <params:...> tags out of a prompt, fast

By JaredTherriault·Created 3 years ago·Updated about a month ago· 91
Make Parameter Table
    • passthrough
    • parameter_table
    parameter_list<params:my_string_variable:string> <params:my_number_variable: 0.5>
    parsing_keyparams
    overwritefalse

    JNodes has a whole feature built around embedding control values directly in your prompt text: write <params:image_size_x:1024> anywhere in your prompt and a parameter node downstream can pull 1024 back out as an actual number, ready to plug into a latent size or any other input. It's a clever way to keep per-prompt overrides - resolution, seed, checkpoint, whatever - living inside the prompt itself instead of scattered across separate widgets you have to remember to change.

    The catch with the older way of doing this (JNodes_GetParameterFromList) is that it re-scans the whole prompt text every time you ask for a single parameter. Fine for one or two params, expensive once you've got a dozen. JNodes_MakeParameterTable exists to fix that: it parses the prompt once, builds a lookup table, and every subsequent JNodes_GetParameterFromTable call just reads from that table instead of re-parsing text. The node's own description puts it plainly - higher upfront cost, much faster at scale.

    How it works

    Feed it your prompt (or any text containing <params:...> tags) as parameter_list. It scans for every tag matching your chosen parsing_key - params by default, but you can rename the tag family to anything, useful if you want to keep multiple independent sets of parameters in the same prompt without them colliding. Each match becomes an entry in the output table. overwrite controls what happens if the same parameter name shows up twice: on, the later one wins; off, the first one sticks.

    Two things come out: passthrough, which is your original text handed straight back unchanged (so you can keep chaining string operations on the same prompt without a separate wire), and parameter_table, the actual JNODES_PARAMETER_TABLE you feed into one or more JNodes_GetParameterFromTable nodes to pull values back out by name.

    The inputs and outputs

    • parameter_list (STRING, multiline) - the text to scan for <params:name:value> tags.
    • parsing_key (default params) - which tag family to look for; change it to run independent parameter sets.
    • overwrite (BOOLEAN) - whether a later duplicate tag replaces an earlier one.
    • passthrough output (STRING) - the original text, unchanged.
    • parameter_table output (JNODES_PARAMETER_TABLE) - feed into JNodes_GetParameterFromTable.

    How to install it

    Via ComfyUI Manager: Install Custom Nodes, search "JNodes", install, restart. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/JaredTherriault/ComfyUI-JNodes
    pip install -r ComfyUI-JNodes/requirements.txt
    

    then restart ComfyUI. No model downloads.

    Common issues & troubleshooting

    Don't reach for this with just one or two parameters. The node's own description is honest that the table-building has a higher upfront cost - for a couple of values, plain JNodes_GetParameterFromList is simpler and the performance difference won't matter. This node earns its keep once you've got many parameters or you're reading the same table repeatedly.

    Tags outside your CLIP prompt need cleaning up before inference. <params:...> tags aren't valid prompt syntax to your CLIP encoder - they're metadata JNodes reads, not words you want the model to "see." Route your text through JNodes_RemoveParseableDataForInference after you're done pulling parameters out, and before it hits your prompt encoder.

    Value not parsing as the type you expected. The parameter value has to be valid for the type the receiving pin wants - a numeric pin needs something like 1024, not a word. If a downstream node throws a type error, check that the value you wrote after the second colon actually matches what that pin expects.

    Forgot the parsing_key and got nothing back. If your table comes back empty, double-check the tag in your prompt actually uses the same key as parsing_key - <params:...> won't match if you set parsing_key to something else, and vice versa.

    Categoryparameter_list

    Inputs (3)

    NameTypeDefaultDescription
    parameter_listSTRING<params:my_string_variable:string> <params:my_number_variable: 0.5>
    parsing_keySTRINGparams
    overwriteBOOLEANfalseIf True, values at the bottom of the list will overwrite those at the top. If False, values at the top will be used.

    Outputs (2)

    NameTypeDescription
    passthroughSTRING
    parameter_tableJNODES_PARAMETER_TABLE