ComfyScript icon indicating copy to clipboard operation
ComfyScript copied to clipboard

[Bug Report] Misrecognition of nodes with same name

Open rxy1212 opened this issue 1 year ago • 6 comments

Thanks for your great job, but I found a bug that really confuse me.

It seems like that ComfyScript can't recognize some nodes correctly. In my workflow, I have a node (Image Resize from Image Resize for ComfyUI) image In the output script, it gave me "image, _ = ImageResize(image, 'crop to ratio', 0, 1024, 0, 'any', '9:16', 0.5, 0, None)" Run it, error occurred: "Traceback (most recent call last): File "/home/ruanxy/work/gen_tools/main.py", line 10, in image, _ = ImageResize(image, 'crop to ratio', 0, 1024, 0, 'any', '9:16', 0.5, 0, None) ValueError: too many values to unpack (expected 2) " I tried to fix it to add a return value like this: "image, _ = ImageResize(image, 'crop to ratio', 0, 1024, 0, 'any', '9:16', 0.5, 0, None)" new error occurred: " ERROR:root:Failed to validate prompt for output SaveImage.0: ERROR:root:* ImageResize+ ImageResize+.0: ERROR:root: - Failed to convert an input value to a INT value: width, crop to ratio, invalid literal for int() with base 10: 'crop to ratio' ERROR:root: - Value not in list: interpolation: '1024' not in ['nearest', 'bilinear', 'bicubic', 'area', 'nearest-exact', 'lanczos'] ERROR:root: - Value not in list: condition: 'any' not in ['always', 'only if bigger', 'only if smaller'] " Through the error infomation I realized that ComfyScript recognized the node as (Image Resize from ComfyUI Essentials) image

I want to know how to deal with this kind of situation. Thank you.

rxy1212 avatar Mar 08 '24 07:03 rxy1212

Replacing ImageResize with ImageResize_ should work:

image

Chaoses-Ib avatar Mar 08 '24 08:03 Chaoses-Ib

This bug is caused by the fact that the transpiler doesn't really assign class IDs to nodes. Doing the same assignment as the runtime could solve this problem. However, it's still possible to misrecognize nodes because the transpiler may be in a different environment of the runtime, so they may assign different IDs to the same node.

Chaoses-Ib avatar Mar 08 '24 08:03 Chaoses-Ib

感谢回复,我刚才自己也是这么处理的,现在 workflow 可以跑起来了。

rxy1212 avatar Mar 08 '24 08:03 rxy1212

另外我对你这个项目很感兴趣,我目前在一家游戏公司担任算法工程师也经常使用 comfyui 但是对他的代码库不熟悉,如果后续我也想一起来维护这个项目你这边有什么建议吗?

rxy1212 avatar Mar 08 '24 08:03 rxy1212

你有什么想做的方面吗?目前我计划中但还没实现的功能还有这些:

  • 内置从 CivitAI URL 加载模型的节点

    https://github.com/Chaoses-Ib/civitai_comfy_nodes 已经基本实现了,但是只支持 checkpoint 和 lora。

  • All-in-one pipelines,类似 sd-webui 的接口

  • 对常见类型的互操作,以及代码回调节点和 eval code 节点(#29)

  • 支持 diff workflow,输出简短差异,实现在 SaveImage 时将 workflow 变化记录进文件名,方便试验

  • 一些 Jupyter Notebook 的 widgets,可以用 Solara 或者 ipyreact 实现

    已经有了一个基本的 metadata viewer。

  • Photoshop 集成

    支持从 PS 获取编辑中的图像,之后再进一步集成,比如从图层名读取 regional prompt。

  • Transpiler 配置,支持禁用元数据(#27),或者调整转译风格(#16)

  • Real mode 自动缓存/模型管理(#22)

  • 对缺失节点进行提示或自动安装(#17)

    https://github.com/Chaoses-Ib/comfyui-legacy 支持将节点转为 pip 包,不过还没实现自动化。

Chaoses-Ib avatar Mar 08 '24 08:03 Chaoses-Ib

我还需要再研究下代码,看看后面有哪些可以贡献的Sent from my iPhoneOn Mar 8, 2024, at 16:56, Chaoses-Ib @.***> wrote: 你有什么想做的方面吗?目前我计划中但还没实现的功能还有这些:

内置从 CivitAI URL 加载模型的节点 https://github.com/Chaoses-Ib/civitai_comfy_nodes 已经基本实现了,但是只支持 checkpoint 和 lora。

All-in-one pipelines,类似 sd-webui 的接口

对常见类型的互操作,以及代码回调节点和 eval code 节点(#29)

支持 diff workflow,输出简短差异,实现在 SaveImage 时将 workflow 变化记录进文件名,方便试验

一些 Jupyter Notebook 的 widgets,可以用 Solara 或者 ipyreact 实现 已经有了一个基本的 metadata viewer。

Photoshop 集成 支持从 PS 获取编辑中的图像,之后再进一步集成,比如从图层名读取 regional prompt。

Transpiler 配置,支持禁用元数据(#27),或者调整转译风格(#16)

Real mode 自动缓存/模型管理(#22)

对缺失节点进行提示或自动安装(#17) https://github.com/Chaoses-Ib/comfyui-legacy 支持将节点转为 pip 包,不过还没实现自动化。

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

rxy1212 avatar Mar 09 '24 00:03 rxy1212