Acly / comfyui-inpaint-nodes

Nodes for better inpainting with ComfyUI: Fooocus inpaint model for SDXL, LaMa, MAT, and various other tools for pre-filling inpaint & outpaint areas.
GNU General Public License v3.0
576 stars 41 forks source link

Startup Error: Cannot import comfyui-inpaint-nodes module for custom nodes #8

Closed camoody1 closed 7 months ago

camoody1 commented 7 months ago

I have installed your GitHub and downloaded the models you suggested. But when I restart Comfy, I get an error message about Fooocus Inpaint and when the workflow opens, your nodes are red saying that Comfy could not find them. If I look into Comfy Manager, it says that they are installed, but not able to be imported. Any ideas? Here is the error I see in the Comfy startup log:

Traceback (most recent call last):

File "H:\ComfyUI\ComfyUI_windows_portable\ComfyUI\[nodes.py](https://nodes.py/)", line 1893, in load_custom_node

module_spec.loader.exec_module(module)

File "<frozen importlib._bootstrap_external>", line 940, in exec_module

File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed

File "H:\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-inpaint-nodes\__init__.py", line 6, in <module>

)[1].extend([".pt", ".pth", ".safetensors", ".patch"])

^^^^^^

AttributeError: 'set' object has no attribute 'extend'

Cannot import H:\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-inpaint-nodes module for custom nodes: 'set' object has no attribute 'extend'
Acly commented 7 months ago

Probably caused by another custom node package which also registers an "inpaint" folder to models.

You can disable the other nodes, or try to modify comfyui-inpaint-nodes/__init__.py, line 6, replace extend with update

Let me know if it works or the name of the other custom nodes, then I can fix it

camoody1 commented 7 months ago

@Acly I have a custom node called "comfyui-art-venture" that has an inpaint folder in it. Is that what you're talking about? I'm guessing probably not. I don't really know how to determine which folders are registered to models. 🤷🏼‍♂️

Acly commented 7 months ago

The contention is about the the inpaint folder in ComfyUI\models\inpaint The other custom node would be one which also requires you to put files there. But it's not that easy to find out which one it is if you have a lot of them, just thought there's a chance you might know. If not, try the code change, if it works that's good enough.

camoody1 commented 7 months ago

@Acly I actually didn't have that folder even after installing your nodes. I had to create it myself. Does that tell you anything?

camoody1 commented 7 months ago

@Acly Okay. I changed the word from "extend" to "update" and, now, the nodes aren't red anymore. What does this mean for me going forward? What do I have to worry about because I made this change?

Acly commented 7 months ago

Nothing to worry about. Some other nodes are also using the inpaint folder, maybe optionally, seems like you never made use of it. But they register certain file extensions. The inpaint nodes also register certain file extensions. With the change it should now include the extensions from both node packages.

Acly commented 7 months ago

Should be fixed now, latest version should work without modification.

camoody1 commented 7 months ago

Thank you for your quick responses. Have a great day. :)