diff --git a/ai_diffusion/comfy_workflow.py b/ai_diffusion/comfy_workflow.py index bdb703c30..6c8fe5a4a 100644 --- a/ai_diffusion/comfy_workflow.py +++ b/ai_diffusion/comfy_workflow.py @@ -900,8 +900,12 @@ def _convert_ui_workflow(w: dict, node_inputs: dict): for field_name, field in fields.items(): field_type = field[0] if field_type in ["INT", "FLOAT", "BOOL", "STRING"] or isinstance(field_type, list): - inputs[field_name] = node["widgets_values"][widget_count] + values = node["widgets_values"] + inputs[field_name] = values[widget_count] widget_count += 1 + if len(values) > widget_count and values[widget_count] in _control_after_generate: + widget_count += 1 + for connection in node["inputs"]: if connection["name"] == field_name and connection["link"] is not None: link = next(l for l in links if l[0] == connection["link"]) @@ -914,3 +918,6 @@ def _convert_ui_workflow(w: dict, node_inputs: dict): r[id] = {"class_type": type, "inputs": inputs} return r + + +_control_after_generate = ["fixed", "increment", "decrement", "randomize"]