ComfyUI Node

setdefault

Returns the value for a key, setting a default if the key doesn't exist. This node takes a dictionary, a key, and a default value. If the key exists in the dictionary, the corresponding value is returned. If the key doesn't exist, the default value is inserted for the key and returned.

By StableLlama·Created about a year ago·Updated 25 days ago· 45
setdefault
  • input_dict
  • default_value
  • DICT
  • value
key
CategoryBasic/DICT

Inputs (3)

NameTypeDefaultDescription
input_dictDICT
keySTRING
default_value*

Outputs (2)

NameTypeDescription
DICTDICT
value*