Nodes/ComfyUI Level Pixel/Find Value From File [LP]
ComfyUI Node

Find Value From File [LP]

Looking up a value by key, without crashing if it's missing

By LevelPixel·Created 2 years ago·Updated 5 months ago· 31
Find Value From File [LP]
    • Value STRING
    • Value received BOOL
    key
    input_path

    Give this node a key and a file path, and it looks up the matching value from that file. What makes it worth a second look isn't the lookup itself - it's the second output. Instead of just erroring when the key isn't found, it hands you back a boolean flag telling you whether the lookup actually succeeded, so you can branch on a missing value instead of watching your whole run die on it.

    Why the graceful-failure design matters

    A lot of this pack's conversion nodes are deliberately strict - feed StringToFloat-LP something unparseable and it throws, full stop. FindValueFromFile-LP takes the opposite approach, and it's the right call for this particular job: file-based lookups are exactly the kind of operation that's supposed to sometimes come up empty in a real automation pipeline - a config key that's only set for some runs, a per-item override file that doesn't exist for every item in a batch. Building in a boolean "did this actually work" output instead of throwing means you can wire a gate or switch node off that flag and keep the rest of the run moving, rather than wrapping every lookup in defensive logic yourself.

    The inputs and outputs that matter

    • key - the key to search for, plain text.
    • input_path - the file to search in, plain text.
    • Outputs: Value STRING (whatever was found, as text) and Value received BOOL (whether the lookup actually succeeded).

    The exact file format this node parses - whether it's expecting key=value lines, a JSON object, or something else - isn't spelled out in the pack's README or the node's own schema, so if the format matters to you, the safest path is testing it once against a small sample file before relying on it in a larger pipeline.

    How to install it

    ComfyUI Manager: search "ComfyUI Level Pixel" or ComfyUI-LevelPixel, install, restart - auto-updates via Manager's "Update ALL." Manual:

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

    Restart ComfyUI. No models, nothing else needed - it's reading a file directly off disk.

    Common issues & troubleshooting

    Value received BOOL keeps coming back false and you're sure the key exists. Double-check the file's actual format matches what this node expects, and that key matches exactly - case, spacing, and any surrounding punctuation in the source file can all cause a lookup to silently miss rather than error, which is precisely the situation the boolean output exists to catch.

    You're treating Value STRING as reliable without checking the boolean first. Don't. If the lookup failed, whatever comes out of Value STRING on a failed lookup isn't documented as a guaranteed empty string versus some other placeholder - always gate downstream logic on Value received BOOL rather than assuming the string output alone tells you whether the lookup worked.

    You need this to fail loudly instead of gracefully. It's built the opposite way on purpose - if you want a hard stop on a missing key, add an explicit check-and-error step downstream of the boolean output rather than expecting this node itself to throw.

    CategoryLevelPixel/IO

    Inputs (2)

    NameTypeDefaultDescription
    keySTRING
    input_pathSTRING

    Outputs (2)

    NameTypeDescription
    Value STRINGSTRING
    Value received BOOLBOOLEAN