Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running comfyui-rector-node #42

Closed
jmorbit opened this issue Sep 22, 2023 · 12 comments
Closed

Error running comfyui-rector-node #42

jmorbit opened this issue Sep 22, 2023 · 12 comments

Comments

@jmorbit
Copy link

jmorbit commented Sep 22, 2023

I am using the ComfyUI_windows_portable version now but tried the manual install also and get the same results.

ReActor Node Error-1

I installed and deleted and re-installed about 6 times trying to get it working properly but it always gives this error once it hits the FaceSwap Node. I went through the "onnxruntime_inference_collection.py" file and can't find anywhere that it sets the provider to ['AzureExecutionProvider', 'CPUExecutionProvider']. it is a bit frustrating but a found a work around after going through the file for hours on end, (I do not know how to write Python Code by the way).

I got it to work by opening the "onnxruntime_inference_collection.py" file in the "...\ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnxruntime\capi directory and changing the section at the following line numbers:

177 def disable_fallback(self):
178 """
179 Disable session.run() fallback mechanism.
180 """
181 self._enable_fallback = False

to:

177 def disable_fallback(self):
178 """
179 Disable session.run() fallback mechanism.
180 """
181 self._enable_fallback = True

In the CMD Console it throws the following error:

EP Error This ORT build has ['AzureExecutionProvider', 'CPUExecutionProvider'] enabled. Since ORT 1.9, you are required to explicitly set the providers parameter when instantiating InferenceSession. For example, onnxruntime.InferenceSession(..., providers=['AzureExecutionProvider', 'CPUExecutionProvider'], ...) when using None
Falling back to ['CPUExecutionProvider'] and retrying.

but the process continues through to completion and swaps the face.

I am not sure how to fix it without doing it this quick and dirty way, I tried all of the other possible solutions that I can find and this is the only thing that works for me,

ps: It is probably a good idea to edit System Enviroment Variables and add the "ComfyUI_windows_portable\python_embeded" and "ComfyUI_windows_portable\python_embeded\Scripts" directory addresses to "Path." I kept getting "python_embeded" not on path during node installs, those went away after editing the system environmental variables.

Thank you.

@zejacky
Copy link

zejacky commented Sep 22, 2023

Hello @jmorbit
Maybe you can take a look at #41
I had the same error message.

@jmorbit
Copy link
Author

jmorbit commented Sep 22, 2023

Hey thanks I tried that earlier and no change, it turns out that it was a combination of three things, #41, #21, and then when trying #41 again it corrupted my python somehow and I could not pip anything. I had to completely uninstall Python again and reinstall it, then run get-pip.py under python_embeded to restore pip abilities. It works normally again. :-)

@Kinglord
Copy link

Kinglord commented Sep 23, 2023

Hey, I think this is related to the issue I brought up here #35 - I was trying to help someone fix the above issue tonight and we checked all the dependencies but even with the right version of onnxruntime at 1.15.1 it does not work with the portable version of comfy. Doesn't read like it but maybe it is a protobuf error afterall? I think the real sticking point right now is that this isn't working for a lot of comfyUI portable users with the current requirements.txt and I'm also not sure how to tell people to fix it in a way that doesn't get blown out when they update or get new nodes :D

@Gourieff
Copy link
Owner

This is the source of 'AzureExecutionProvider' Issue: microsoft/onnxruntime#17631
I edited requirements.txt to install ORT 1.15.1 strictly - until Microsoft will fix this moment with 1.16.1 patch

@jmorbit
Copy link
Author

jmorbit commented Sep 23, 2023

This is the source of 'AzureExecutionProvider' Issue: microsoft/onnxruntime#17631 I edited requirements.txt to install ORT 1.15.1 strictly - until Microsoft will fix this moment with 1.16.1 patch

Thanks for the information, that was driving me crazy trying to figure out where it was getting that Provider.

@jmorbit
Copy link
Author

jmorbit commented Sep 23, 2023

Hey, I think this is related to the issue I brought up here #35 - I was trying to help someone fix the above issue tonight and we checked all the dependencies but even with the right version of onnxruntime at 1.15.1 it does not work with the portable version of comfy. Doesn't read like it but maybe it is a protobuf error afterall? I think the real sticking point right now is that this isn't working for a lot of comfyUI portable users with the current requirements.txt and I'm also not sure how to tell people to fix it in a way that doesn't get blown out when they update or get new nodes :D

On my system the "~rotobuf" folder was in my system install of Python not the embedded Python. Does the person you were trying to help have Python installed on their system other than the embedded python with the ComfyUI Portable Version? If it is a PC, and they do have Python installed, try taking it off path and adding the embedded python on path, so that the installer for ReActor will pull from the embedded python. That is what I had to do. I had to do the opposite when I installed Kohya_SS, it kept trying to find venv in the embedded python of ComfyUI Portable Install.

@Thanh1122kkll
Copy link

Is there any way to fix the code on Colab? I haven't been able to run it for 3 days now. I have a similar error to yours, but I don't have something like this to open: \ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnxruntime.

@Kinglord
Copy link

This is the source of 'AzureExecutionProvider' Issue: microsoft/onnxruntime#17631
I edited requirements.txt to install ORT 1.15.1 strictly - until Microsoft will fix this moment with 1.16.1 patch

Do we have a fix for the people that this doesn't work for? Sorry if I wasn't clear but right now even if portable users manually install ORT 1.15.1 it's not working right. I think it has to do with some other custom nodes installed like Impact, which is one of the most popular custom nodes that use protobuf.

@Kinglord
Copy link

Hey, I think this is related to the issue I brought up here #35 - I was trying to help someone fix the above issue tonight and we checked all the dependencies but even with the right version of onnxruntime at 1.15.1 it does not work with the portable version of comfy. Doesn't read like it but maybe it is a protobuf error afterall? I think the real sticking point right now is that this isn't working for a lot of comfyUI portable users with the current requirements.txt and I'm also not sure how to tell people to fix it in a way that doesn't get blown out when they update or get new nodes :D

On my system the "~rotobuf" folder was in my system install of Python not the embedded Python. Does the person you were trying to help have Python installed on their system other than the embedded python with the ComfyUI Portable Version? If it is a PC, and they do have Python installed, try taking it off path and adding the embedded python on path, so that the installer for ReActor will pull from the embedded python. That is what I had to do. I had to do the opposite when I installed Kohya_SS, it kept trying to find venv in the embedded python of ComfyUI Portable Install.

They do but they didn't want to mess with protobuf to get this working since it's used by other things. Even after doing all that with some of my nodes I would get a protobuf error due to the loading order of some custom nodes. (As far as I could tell) that appears to be portable only, venv is smart enough to not do that. There's a trick you can use around install order but that can go out the windows as soon as you install a new node that touches those libs, etc. This is one of those times I hate python, it's not the author's fault, this stuff is just a PITA :D

@alenknight
Copy link

this isn't working for me either... getting same error.
i'm running the portable windows version as well. i tried running 'reqs_windows.txt' install and it brought in the 1.15.1 and protobuf 3.19.6... but still same error.

i was going to try updating "onnxruntime_inference_collection.py" file in the "...\ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnxruntime\capi directory as @jmorbit stated.... but the line numbers no longer match so i'm not sure where to update now.....

@jmorbit
Copy link
Author

jmorbit commented Sep 27, 2023

this isn't working for me either... getting same error. i'm running the portable windows version as well. i tried running 'reqs_windows.txt' install and it brought in the 1.15.1 and protobuf 3.19.6... but still same error.

i was going to try updating "onnxruntime_inference_collection.py" file in the "...\ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnxruntime\capi directory as @jmorbit stated.... but the line numbers no longer match so i'm not sure where to update now.....

In your code editor use "Find Next" to locate "def disable_fallback(self):" section, the section that follows immediately after is the "self._enable_fallback = False" that I changed to "self._enable_fallback = True". The other fix worked for me, give this a try to see if it will let you run it.

@Thanh1122kkll
Copy link

Thanh1122kkll commented Sep 27, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants