Nodes/smn_support_nodes/[SSN] JSON Get Key Value
ComfyUI Node

[SSN] JSON Get Key Value

A node that takes a JSON-formatted string (via a pin) and a key, then outputs the value associated with that key. Class methods ------------- INPUT_TYPES (dict): Defines the input fields for this node. In this case, a JSON string (single-line pin) and a key string. Attributes ---------- RETURN_TYPES (`tuple`): The type of the output tuple. Here, it is a single STRING. RETURN_NAMES (`tuple`): Optional: The name of the output ("value"). FUNCTION (`str`): The name of the entry-point method. This node uses "execute". CATEGORY (`str`): The category under which this node appears in the UI ("JSON"). execute(json_string, key) -> tuple: Parses the JSON from the pin and returns the value for the given key as a JSON-formatted string. If the key is not found or parsing fails, returns an empty string.

By SummonTheCat·Created about a year ago·Updated about a year ago· 0
[SSN] JSON Get Key Value
    • value
    json_string{}
    key
    CategoryJSON

    Inputs (2)

    NameTypeDefaultDescription
    json_stringSTRING{}
    keySTRING

    Outputs (1)

    NameTypeDescription
    valueSTRING