Nodes/Comfyroll Studio/βš™οΈ CR Get Parameter From Prompt
ComfyUI Node Runs on cloud

βš™οΈ CR Get Parameter From Prompt

Pull a value out of your prompt text and route it downstream

By Suzie1Β·Created 3 years agoΒ·Updated 2 years agoΒ· 1,288
βš™οΈ CR Get Parameter From Prompt
    • prompt
    • text
    • float
    • boolean
    • show_help
    β—„promptpromptβ–Ί
    β—„search_string!findmeβ–Ί

    Here's a neat trick this node unlocks: instead of the prompt and the settings living in separate widgets, you smuggle a setting inside the prompt text and pull it back out mid-graph. Tag a value with a marker like !findme, and CR Get Parameter From Prompt finds it, hands you the value in a few different types, and gives you back the prompt with the tag stripped off.

    Why bother? Because prompts are the thing that travels. If you're driving generations from a wildcard file, a spreadsheet, or an LLM, being able to say "and by the way, use this CFG / this flag / this label" in the same line of text - and have the workflow act on it - is genuinely powerful. It's a small node with a real "oh, that's clever" payoff, which is probably why it's one of the few in this batch that actually gets clicked through in search.

    How it works

    You feed it a prompt and a search string (the marker). It scans the prompt for that marker, grabs whatever value follows it, and emits that value cast to multiple types at once - text, float, boolean - so you can wire it into whatever expects that type without a separate converter. It also returns the prompt with the marker-and-value removed, so the cleaned prompt is safe to send to your CLIP encoder.

    The inputs and outputs that matter

    • prompt (multiline STRING) - the text to search, usually wired from a wildcard/loader node.
    • search_string (STRING, default !findme) - the marker you're hunting for. Put the same marker plus your value in the prompt.

    Outputs:

    • prompt (STRING) - the cleaned prompt, marker removed. This is what goes to your text encode.
    • text, float, boolean - the extracted value in three flavors. Use whichever the downstream input needs; ignore the rest.
    • show_help - the usual wiki-link string.

    Installing it

    Comfyroll Studio (Suzie1 / RockOfFire) is a large, established utility pack. Grab it in ComfyUI Manager - search "Comfyroll Studio," install, restart - or clone it:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes.git
    

    and restart. No models, no heavy dependencies.

    Common issues

    The value has to actually be present and formatted the way the downstream type expects. Ask for float when the text after your marker is a word, and you'll get a fallback (typically 0), not an error you'll notice - so wire the extracted value into a display node while you're setting this up and confirm it's what you think. Same for boolean: it expects something truthy/falsy after the marker.

    Pick a marker that won't collide with real prompt words - !findme is deliberately weird for that reason. And this is one node's worth of parsing, not a scripting language: it grabs a value after a marker, that's it. For anything richer you're better off computing the value in a proper logic node. If Comfyroll won't load at startup (a NameError traceback about Graphics or Utility nodes), that's an install problem - reinstall cleanly through Manager and restart.

    Category🧩 Comfyroll Studio/πŸ› οΈ Utils/βš™οΈ Other

    Inputs (2)

    NameTypeDefaultDescription
    promptSTRINGpromptβ€”
    search_stringSTRING!findmeβ€”

    Outputs (5)

    NameTypeDescription
    promptSTRINGβ€”
    text*β€”
    floatFLOATβ€”
    booleanBOOLEANβ€”
    show_helpSTRINGβ€”