chrisgoringe / Comfy-Custom-Node-How-To

An unofficial practical guide to getting started developing custom nodes for ComfyUI
GNU General Public License v3.0
153 stars 6 forks source link

What are hidden inputs? #5

Closed chrisgoringe closed 1 year ago

Lerc commented 1 year ago

Hidden Inputs are inputs that do not need to be explicitly provided, They behave as inputs for the purposes of the execution function declared in the FUNCTION field of a node class.

The values for the hidden inputs are automatically filled out.

https://github.com/comfyanonymous/ComfyUI/blob/77c124c5a17534e347bdebbc1ace807d61416147/execution.py#L32

        h = valid_inputs["hidden"]
        for x in h:
            if h[x] == "PROMPT":
                input_data_all[x] = [prompt]
            if h[x] == "EXTRA_PNGINFO":
                if "extra_pnginfo" in extra_data:
                    input_data_all[x] = [extra_data['extra_pnginfo']]
            if h[x] == "UNIQUE_ID":
                input_data_all[x] = [unique_id]
chrisgoringe commented 1 year ago

Thanks - merged this into another answer!