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.
setdefault
- input_dict
- default_value
- DICT
- value
◄key►
CategoryBasic/DICT
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| input_dict | DICT | — | |
| key | STRING | — | |
| default_value | * | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| DICT | DICT | — |
| value | * | — |