64#hhddlmZddlmZddlmZddlmZddlm Z m Z e e e fZ dede fdZ dedefd Zdede fd Zdede fd Zdede fd Zdede fd Z ddedeede fdZde deedede fdZdS))Enum) FieldInfo) BaseModel)PydanticUndefined)IOInputTypeOptions field_inforeturnci}t|dr|jtur |j|d<t|dr|j |j|d<|S)Ndefault descriptiontooltip)hasattrr rr )r configs CD:\ComfyUI_windows_portable\ComfyUI\comfy_api_nodes\mapper_utils.py_create_base_configr s` Fz9%%/**z/_model_field_to_combo_input..Fs"H"H"HF6<"H"H"Hroptions)rrCOMBO)r r-r" combo_configs r_model_field_to_combo_inputr8As_L"H"Hi"H"H"H Y  j ) ) L 8\ !!r input_type base_model field_namec t|j|}|tjkrt|fi|}n|tjkrt |fi|}nn|tjkrt|fi|}nP|tjkrt|fi|}n2|tj krt|fi|}nd|}t||S)a Maps a field from a Pydantic model to a Comfy node input. Args: input_type: The type of the input. base_model: The Pydantic model to map the field from. field_name: The name of the field to map. **kwargs: Additional key/values to include in the input options. Note: For combo inputs, pass an `Enum` to the `enum_type` keyword argument to populate the options automatically. Example: >>> model_field_to_node_input(IO.STRING, MyModel, "my_field", multiline=True) >>> model_field_to_node_input(IO.COMBO, MyModel, "my_field", enum_type=MyEnum) >>> model_field_to_node_input(IO.FLOAT, MyModel, "my_field", slider=True) zInvalid input type: ) model_fieldsrr r#r%r&r(r)r+r,r6r8 ValueError)r9r:r;r"r resultmessages rmodel_field_to_node_inputrAOs('3J?JRX,ZBB6BB ry -jCCFCC rx  ,ZBB6BB rv  *:@@@@ rx  ,ZBB6BB555!!! Mrr)enumrpydantic.fieldsrpydanticr pydantic_corercomfy.comfy_types.node_typingrrtuple NodeInputrdictrr#r&r)r,typer8strrAr0rrrLs%%%%%%++++++>>>>>>>> "&& ' I2B y T    IIYYII))48 " " "&*4j " " " " "%% $Y%=@%%%%%%%r