yolain / ComfyUI-Easy-Use

In order to make it easier to use the ComfyUI, I have made some optimizations and integrations to some commonly used nodes.
GNU General Public License v3.0
537 stars 34 forks source link

Bug: not considering API mode, add one line check #220

Closed YacratesWyh closed 2 days ago

YacratesWyh commented 1 week ago

custom_nodes/ComfyUI-Easy-Use/py/logic.py 480line should have check on extra_pnginfo[0], as in api it wouldn't have a [0] if extra_pnginfo[0] is not None:

The full should be:


def log_input(self, unique_id=None, extra_pnginfo=None, **kwargs):

        values = []
        if "anything" in kwargs:
            for val in kwargs['anything']:
                try:
                    if type(val) is str:
                        values.append(val)
                    else:
                        val = json.dumps(val)
                        values.append(str(val))
                except Exception:
                    values.append(str(val))
                    pass
####add change here
        if extra_pnginfo[0] is not None:
####
            if unique_id and extra_pnginfo and "workflow" in extra_pnginfo[0]:
                workflow = extra_pnginfo[0]["workflow"]
                node = next((x for x in workflow["nodes"] if str(x["id"]) == unique_id[0]), None)
                if node:
                    node["widgets_values"] = [values]

        return {"ui": {"text": values}}
yolain commented 1 week ago

Thanks for the feedback.