mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-03-12 12:47:45 +08:00
feat: support typed wrapper format for widget values
This commit is contained in:
parent
54e3783931
commit
8b44ca92bf
17
execution.py
17
execution.py
@ -876,12 +876,17 @@ async def validate_inputs(prompt_id, prompt, item, validated):
|
|||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
# Unwraps values wrapped in __value__ key. This is used to pass
|
# Unwraps values wrapped in __value__ key or typed wrapper.
|
||||||
# list widget value to execution, as by default list value is
|
# This is used to pass list widget values to execution,
|
||||||
# reserved to represent the connection between nodes.
|
# as by default list value is reserved to represent the
|
||||||
if isinstance(val, dict) and "__value__" in val:
|
# connection between nodes.
|
||||||
val = val["__value__"]
|
if isinstance(val, dict):
|
||||||
inputs[x] = val
|
if "__value__" in val:
|
||||||
|
val = val["__value__"]
|
||||||
|
inputs[x] = val
|
||||||
|
elif "__type" in val and "value" in val:
|
||||||
|
val = val["value"]
|
||||||
|
inputs[x] = val
|
||||||
|
|
||||||
if input_type == "INT":
|
if input_type == "INT":
|
||||||
val = int(val)
|
val = int(val)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user