WASasquatch / was-node-suite-comfyui

An extensive node suite for ComfyUI with over 210 new nodes
MIT License
1.09k stars 163 forks source link

Paperspace / Colab Workaround? #18

Closed Yggdrasil777 closed 1 year ago

Yggdrasil777 commented 1 year ago

Thanks! Saw your CivitAI post. Below is the error that appears when trying to load this custom_node:

Traceback (most recent call last): File "/notebooks/ComfyUI/nodes.py", line 1050, in load_custom_node module_spec.loader.exec_module(module) File "", line 850, in exec_module File "", line 228, in _call_with_frames_removed File "/notebooks/ComfyUI/custom_nodes/was-node-suite-comfyui/init.py", line 1, in from .WAS_Node_Suite import NODE_CLASS_MAPPINGS File "/notebooks/ComfyUI/custom_nodes/was-node-suite-comfyui/WAS_Node_Suite.py", line 711 match style: ^ SyntaxError: invalid syntax

Cannot import /notebooks/ComfyUI/custom_nodes/was-node-suite-comfyui module for custom nodes: invalid syntax (WAS_Node_Suite.py, line 711)

Here is the git pull from this repository:

/notebooks/ComfyUI/custom_nodes fatal: destination path 'was-node-suite-comfyui' already exists and is not an empty directory. /notebooks/ComfyUI/custom_nodes/was-node-suite-comfyui remote: Enumerating objects: 63, done. remote: Counting objects: 100% (62/62), done. remote: Compressing objects: 100% (38/38), done. remote: Total 53 (delta 33), reused 32 (delta 15), pack-reused 0 Unpacking objects: 100% (53/53), 1.63 MiB | 1.37 MiB/s, done. From https://github.com/WASasquatch/was-node-suite-comfyui b8d52ab..8fe4e23 main -> origin/main Updating b8d52ab..8fe4e23 Fast-forward README.md | 4 ++ WAS_Node_Suite.py | 75 ++++++++++++++++++++++++----- workflows/Bloom_Image_Workflow.png | Bin 0 -> 442218 bytes workflows/High_Pass_Sharpening.png | Bin 0 -> 841241 bytes workflows/README.md | 9 ++++ workflows/Wildcard_Replacement_Example.png | Bin 0 -> 498883 bytes 6 files changed, 76 insertions(+), 12 deletions(-) create mode 100644 workflows/Bloom_Image_Workflow.png create mode 100644 workflows/High_Pass_Sharpening.png create mode 100644 workflows/Wildcard_Replacement_Example.png

Here is the command that pulled it:

!git clone https://github.com/WASasquatch/was-node-suite-comfyui.git %cd was-node-suite-comfyui !git pull %cd ../

Original request below:

Any good tips on getting it to load on Paperspace? Or Google Colab? I have it cloned into Paperspace, but it just errors out on loading.

Quite a few of the custom nodes don't load, haven't quite figured out what is going wrong. It loads on the desktop, but I'm looking to get it working on the much faster cloud.

WASasquatch commented 1 year ago

It seems to be the Python versions. ComfyUI/WAS Node Suite is for Python 3.10

Specifically the match switch operator was added in Python 3.10

I'll replace the match cases with if/else statements. I was just trying to be up to date and optimized with some of latest Python logic.

WASasquatch commented 1 year ago

I've updated (or downgraded? Lol) the suite to use if / else statements. Hopefully that's the only paperspace/colab issue.

Yggdrasil777 commented 1 year ago

It almost worked:

WAS Node Suite: Running At: /notebooks/ComfyUI/custom_nodes/was-node-suite-comfyui/WAS_Node_Suite.py WAS Node Suite: Running From: /notebooks/ComfyUI/custom_nodes/was-node-suite-comfyui Traceback (most recent call last): File "/notebooks/ComfyUI/nodes.py", line 1050, in load_custom_node module_spec.loader.exec_module(module) File "", line 850, in exec_module File "", line 228, in _call_with_frames_removed File "/notebooks/ComfyUI/custom_nodes/was-node-suite-comfyui/init.py", line 1, in from .WAS_Node_Suite import NODE_CLASS_MAPPINGS File "/notebooks/ComfyUI/custom_nodes/was-node-suite-comfyui/WAS_Node_Suite.py", line 1385, in class WAS_Load_Image_Batch: File "/notebooks/ComfyUI/custom_nodes/was-node-suite-comfyui/WAS_Node_Suite.py", line 1406, in WAS_Load_Image_Batch def load_batch_images(self, path, pattern='*', index=0, mode="single_image", label='Batch 001') -> tuple[torch.Tensor] | tuple: TypeError: unsupported operand type(s) for |: 'types.GenericAlias' and 'type'

Cannot import /notebooks/ComfyUI/custom_nodes/was-node-suite-comfyui module for custom nodes: unsupported operand type(s) for |: 'types.GenericAlias' and 'type'

Yggdrasil777 commented 1 year ago

FYI: Found a way to upgrade the Python to 3.10.10

By disabling lines #1406-1417, I was able to get ComfyUI to load the nodes.

WASasquatch commented 1 year ago

Looks like that's the definition returns being formatted from VSCode patch. Older pythons probably dont take the alias types (to ensure input/output is correct)

Silversith commented 1 year ago

@Yggdrasil777 could you create a branch that works on colab or a workbook file? I just ran into the same issues as you did with my colab being Python 3.8

WASasquatch commented 1 year ago

@Yggdrasil777 could you create a branch that works on colab or a workbook file? I just ran into the same issues as you did with my colab being Python 3.8

I just pushed another patch and removed VSCode formatting that seemed to have formatted some definitions for Python 3.10 only.

Report any new errors and I'll try and work them out so the suite is compatible with Colab/Paperspace. If someone could try Kaggle, as well, that would be awesome. I honestly can't figure that place out.

Yggdrasil777 commented 1 year ago

@Yggdrasil777 could you create a branch that works on colab or a workbook file? I just ran into the same issues as you did with my colab being Python 3.8 @Silversith You will need to update the Python to 3.10.10 (use pyenv and follow the instructions on their Github). Then you can paste the file in, make any changes and go to town.

Need to establish pyenv so that the Python version can be changed.

%cd /root/.pyenv !git pull !/root/.pyenv/bin/pyenv global 3.10.10 # Set the global Python to 3.10.10 to satisfy ComfyUI. %cd /notebooks/ !git clone https://github.com/comfyanonymous/ComfyUI %cd ComfyUI # Go into ComfyUI and git pull the latest updates from the Github. !git pull !pip install xformers -r requirements.txt %cd custom_nodes # Start getting the latest updates from Github for the extensions. !git clone https://github.com/lilly1987/ComfyUI_node_Lilly.git %cd ComfyUI_node_Lilly !git pull %cd ../ !git clone https://github.com/Derfuu/Derfuu_ComfyUI_ModdedNodes.git %cd Derfuu_ComfyUI_ModdedNodes !git pull %cd ../ !git clone https://github.com/WASasquatch/was-node-suite-comfyui.git %cd was-node-suite-comfyui !git pull %cd ../ !git clone https://github.com/pythongosssss/ComfyUI-Custom-Scripts.git %cd ComfyUI-Custom-Scripts !git pull %cd ../ !git clone https://github.com/Fannovel16/FN16-ComfyUI-nodes.git %cd FN16-ComfyUI-nodes !git pull %cd ../ !git clone https://github.com/omar92/ComfyUI-extra-nodes---quality-of-life.git %cd ComfyUI-extra-nodes---quality-of-life !git pull %cd ../ !git clone https://github.com/guoyk93/yk-node-suite-comfyui.git %cd yk-node-suite-comfyui !git pull %cd ../ !git clone https://github.com/gamert/ComfyUI_tagger.git %cd ComfyUI_tagger !git pull %cd ../ !git clone https://github.com/m957ymj75urz/ComfyUI-Custom-Nodes.git %cd ComfyUI-Custom-Nodes !git pull %cd ../ !git clone https://github.com/Davemane42/ComfyUI_Dave_CustomNode.git %cd ComfyUI_Dave_CustomNode !git pull %cd ../

%cd ../web/extensions !git clone https://github.com/diffus3/ComfyUI-extensions ./web/extensions/diffus3

%cd ../../script_examples !git clone https://github.com/lilly1987/ComfyUI-script.git !git clone https://github.com/lilly1987/ComfyUI_script2.git

%cd ../

WASasquatch commented 1 year ago

@Yggdrasil777 could you create a branch that works on colab or a workbook file? I just ran into the same issues as you did with my colab being Python 3.8 @Silversith You will need to update the Python to 3.10.10 (use pyenv and follow the instructions on their Github). Then you can paste the file in, make any changes and go to town.

Need to establish pyenv so that the Python version can be changed.

%cd /root/.pyenv !git pull !/root/.pyenv/bin/pyenv global 3.10.10 # Set the global Python to 3.10.10 to satisfy ComfyUI. %cd /notebooks/ !git clone https://github.com/comfyanonymous/ComfyUI %cd ComfyUI # Go into ComfyUI and git pull the latest updates from the Github. !git pull !pip install xformers -r requirements.txt %cd custom_nodes # Start getting the latest updates from Github for the extensions. !git clone https://github.com/lilly1987/ComfyUI_node_Lilly.git %cd ComfyUI_node_Lilly !git pull %cd ../ !git clone https://github.com/Derfuu/Derfuu_ComfyUI_ModdedNodes.git %cd Derfuu_ComfyUI_ModdedNodes !git pull %cd ../ !git clone https://github.com/WASasquatch/was-node-suite-comfyui.git %cd was-node-suite-comfyui !git pull %cd ../ !git clone https://github.com/pythongosssss/ComfyUI-Custom-Scripts.git %cd ComfyUI-Custom-Scripts !git pull %cd ../ !git clone https://github.com/Fannovel16/FN16-ComfyUI-nodes.git %cd FN16-ComfyUI-nodes !git pull %cd ../ !git clone https://github.com/omar92/ComfyUI-extra-nodes---quality-of-life.git %cd ComfyUI-extra-nodes---quality-of-life !git pull %cd ../ !git clone https://github.com/guoyk93/yk-node-suite-comfyui.git %cd yk-node-suite-comfyui !git pull %cd ../ !git clone https://github.com/gamert/ComfyUI_tagger.git %cd ComfyUI_tagger !git pull %cd ../ !git clone https://github.com/m957ymj75urz/ComfyUI-Custom-Nodes.git %cd ComfyUI-Custom-Nodes !git pull %cd ../ !git clone https://github.com/Davemane42/ComfyUI_Dave_CustomNode.git %cd ComfyUI_Dave_CustomNode !git pull %cd ../

%cd ../web/extensions !git clone https://github.com/diffus3/ComfyUI-extensions ./web/extensions/diffus3

%cd ../../script_examples !git clone https://github.com/lilly1987/ComfyUI-script.git !git clone https://github.com/lilly1987/ComfyUI_script2.git

%cd ../

WAS Node Suite shouldn't need Python 3.10 anymore (that I am aware of) and should be compatible to install right away. Can someone confirm?

Silversith commented 1 year ago

Yup, seems to work, thank you

My output & and I've got it in the Nodes Menu; Using xformers cross attention WAS Node Suite: Running At: /content/ComfyUI/custom_nodes/was-node-suite-comfyui/WAS_Node_Suite.py WAS Node Suite: Running From: /content/ComfyUI/custom_nodes/was-node-suite-comfyui WAS Node Suite: Loaded

ComfyUI finished loading, trying to launch localtunnel (if it gets stuck here localtunnel is having issues)

WASasquatch commented 1 year ago

Awesome! That's good to hear. This should be compatible with any 3rd party services so that people can use it free or on hardware they don't have.

WASasquatch commented 1 year ago

I made a colab for ComfyUI + WAS Node Suite to make things a little easier: https://colab.research.google.com/github/WASasquatch/comfyui-colab-was-node-suite/blob/main/ComfyUI_%2B_WAS_Node_Suite.ipynb

Silversith commented 1 year ago

I made a colab for ComfyUI + WAS Node Suite to make things a little easier: https://colab.research.google.com/github/WASasquatch/comfyui-colab-was-node-suite/blob/main/ComfyUI_%2B_WAS_Node_Suite.ipynb

Very cool, you've got some nice extras in there. I wanted to share the one I normally use. It's a bit incomplete, so excuse some of the junk in there. I just wanted to share the two extra bits;

https://colab.research.google.com/github/Silversith/ComfyUI/blob/master/comfy_extras/Comfy%20UI.ipynb

Silversith commented 1 year ago

@WASasquatch I've finally added my output directory solution and removed the SaveImageList node from my fork. Have a look and see what you think. https://github.com/Silversith/ComfyUI/blob/master/web/extensions/core/imageFeed.js It's essentially an image drawer that will load all the files in the output dir on browser refresh, and on Image Save trigger, it will add the image to the drawer. The code was partially copied from https://github.com/pythongosssss/ComfyUI-Custom-Scripts and then modified.