@@ -98,12 +98,20 @@ def validate_param(param):
98
98
outputs = builder (** builder_inputs )
99
99
100
100
# Create the output sockets
101
- for i , result in enumerate (_as_iterable (outputs )):
102
- if not issubclass (type (result ), Type ):
103
- result = Type (value = result )
104
- # raise Exception(f"Return value '{result}' is not a valid 'Type' subclass.")
105
- node_group .outputs .new (result .socket_type , 'Result' )
106
- link = node_group .links .new (result ._socket , group_output_node .inputs [i ])
101
+ if isinstance (outputs , dict ):
102
+ # Use a dict to name each return value
103
+ for i , (k , v ) in enumerate (outputs .items ()):
104
+ if not issubclass (type (v ), Type ):
105
+ v = Type (value = v )
106
+ node_group .outputs .new (v .socket_type , k )
107
+ node_group .links .new (v ._socket , group_output_node .inputs [i ])
108
+ else :
109
+ for i , result in enumerate (_as_iterable (outputs )):
110
+ if not issubclass (type (result ), Type ):
111
+ result = Type (value = result )
112
+ # raise Exception(f"Return value '{result}' is not a valid 'Type' subclass.")
113
+ node_group .outputs .new (result .socket_type , 'Result' )
114
+ node_group .links .new (result ._socket , group_output_node .inputs [i ])
107
115
108
116
_arrange (node_group )
109
117
0 commit comments