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

[bug] Cant load missing nodes (?) #49

Closed
YANGlattez opened this issue Aug 5, 2023 · 10 comments
Closed

[bug] Cant load missing nodes (?) #49

YANGlattez opened this issue Aug 5, 2023 · 10 comments
Labels
install issue type: 🐛 bug Something isn't working

Comments

@YANGlattez
Copy link

Describe the problem

No way to run your workflow. Because comfyui manager has some network connectivity bugs and can't load missing nodes

Describe the solution you'd like

Where to download the missing nodes

Alternatives considered

No response

Additional context

No response

@YANGlattez YANGlattez added the type: 🤚 feature request New feature or request label Aug 5, 2023
@melMass melMass added type: 🐛 bug Something isn't working install issue and removed type: 🤚 feature request New feature or request labels Aug 5, 2023
@melMass
Copy link
Owner

melMass commented Aug 5, 2023

Wrong issue type I corrected that.
I will need much more info to even start to help like you configuration, system, some logs...

@melMass melMass changed the title [feat] [bug] Cant load missing nodes (?) Aug 5, 2023
@Natotela
Copy link

Natotela commented Aug 6, 2023

I cloned comfy_mtb into custom_nodes
I downloaded a 02-film_interpolation & 01-faceswap json workflows
comfyUI installed some wheels, then got a problem with protobuf
I python(embedded) -m pip install --upgrade protobuf, ran into some versions issues but supposedly fixed it
now comfyui runs without errors, except somehow (perhaprs regardless) ControlNet preprocessors:
0.1 seconds (IMPORT FAILED): ...ComfyUI_windows_portable\ComfyUI\custom_nodes\comfy_controlnet_preprocessors

As I try to run the workflows I get

When loading the graph, the following node types were not found:
Restore Face (mtb)
Load Face Enhance Model (mtb)
Load Face Swap Model (mtb)
Load Face Analysis Model (mtb)
Face Swap (mtb)
Nodes that have failed to load will show as red on the graph.


@melMass
Copy link
Owner

melMass commented Aug 6, 2023

@Natotela when you say

comfyUI installed some wheels

Can you post the log? AFAIK only the Comfy-Manager is aware of install.py.
The main problematic dep I rely on is tensorflow_gpu on Windows as it's an "old" version since all versions after removed GPU support for windows (only possible using WSL 2).
99% of the filed issues are about install and all the time I could spend on the lib lately was mostly put into that... not really fun.

I'm probably going to split the library in two after #50

@Natotela
Copy link

Natotela commented Aug 6, 2023

Well sorry to hear it's a hassle to succumb to MS even here.
Here's one of the runs that says some nodes failed:
part1 boring run-up

PS ..\ComfyUI_windows_portable> .\run_nvidia_gpu.bat

..\ComfyUI_windows_portable>.\python_embeded\python.exe -s ComfyUI\main.py --normalvram --fp16-vae

Prestartup times for custom nodes:
   0.0 seconds: ..\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager

Total VRAM 8191 MB, total RAM 65445 MB
xformers version: 0.0.20
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3070 : cudaMallocAsync
Using xformers cross attention
Adding extra search path checkpoints ..\stable-diffusion-webui\models/Stable-diffusion
Adding extra search path configs ..\stable-diffusion-webui\models/Stable-diffusion
Adding extra search path vae ..\stable-diffusion-webui\models/VAE
Adding extra search path loras ..\stable-diffusion-webui\models/Lora
Adding extra search path upscale_models ..\stable-diffusion-webui\models/ESRGAN
Adding extra search path upscale_models ..\stable-diffusion-webui\models/RealESRGAN
Adding extra search path upscale_models ..\stable-diffusion-webui\models/SwinIR
Adding extra search path embeddings ..\stable-diffusion-webui\embeddings
Adding extra search path hypernetworks ..\stable-diffusion-webui\models/hypernetworks
Adding extra search path controlnet ..\stable-diffusion-webui\models/ControlNet
Total VRAM 8191 MB, total RAM 65445 MB
xformers version: 0.0.20
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3070 : cudaMallocAsync
### Loading: ComfyUI-Impact-Pack (V3.10.4)
### Loading: ComfyUI-Impact-Pack (Subpack: V0.2)
### Loading: ComfyUI-Manager (V0.20)
### ComfyUI Revision: 1315 [0ad0de1b]
Failed to auto update `Quality of Life Suit`
QualityOfLifeSuit_Omar92_DIR: ..\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-QualityOfLifeSuit_Omar92
Imported node: DT_Flatten_Colors
Imported node: DT_FontText
Imported node: DT_GenerateNoise
Imported node: DT_Glitch_This
Imported node: DT_Hue_Rotation
Imported node: DT_Load_Picture_Index
Imported node: DT_PILGram
Imported node: DT_Pixel_Sort
Imported node: DT_Play_Sound_At_Execution
Imported node: DT_PromptGen
Imported node: DT_Solid_Color
Imported node: DT_Swap_Color_Mode
Imported node: DT_Flatten_Colors
Imported node: DT_FontText
Imported node: DT_GenerateNoise
Imported node: DT_Glitch_This
Imported node: DT_Hue_Rotation
Imported node: DT_Load_Picture_Index
Imported node: DT_PILGram
Imported node: DT_Pixel_Sort
Imported node: DT_Play_Sound_At_Execution
Imported node: DT_PromptGen
Imported node: DT_Solid_Color
Imported node: DT_Swap_Color_Mode
Comfyroll Custom Nodes: Loaded
Davemane42 Custom Nodes: Loaded
Loading network distribution node pack
[tinyterraNodes] Loaded
Log level: 20
RestoreFace
LoadFaceEnhanceModel
FaceSwap
LoadFaceSwapModel
LoadFaceAnalysisModel
QrCode
UnsplashImage
LoadFilmModel
FilmInterpolation
ConcatImages
GetBatchFromHistory

part2 MTB-

[comfy_mtb] | INFO -> Some nodes failed to load:
        Failed to import module faceenhance because ModuleNotFoundError: No module named 'gfpgan'
        Failed to import module faceswap because ModuleNotFoundError: No module named 'sklearn'
        Failed to import module fun because ModuleNotFoundError: No module named 'qrcode'
        Failed to import module image_interpolation because ModuleNotFoundError: No module named 'frame_interpolation.eval'

Check that you properly installed the dependencies.
If you think this is a bug, please report it on the github page (https://github.com/melMass/comfy_mtb/issues)
[comfy_mtb] | INFO -> Loaded the following nodes:
        Animation Builder (mtb): Convenient way to manage basic animation maths at the core of many of my workflows
        Smart Step (mtb): Utils to control the steps start/stop of the KAdvancedSampler in percentage
        Text To Image (mtb): Utils to convert text to image using a font
        Styles Loader (mtb): Load csv files and populate a dropdown from the rows (à la A111)
        Bbox From Mask (mtb): From a mask extract the bounding box
        Bbox (mtb): The bounding box (BBOX) custom type used by other nodes
        Crop (mtb): Crops an image and an optional mask to a given bounding box
        Uncrop (mtb): Uncrops an image to a given bounding box
        Debug (mtb): Experimental node to debug any Comfy values, support for more types and widgets is planned
        Save Tensors (mtb): Save torch tensors (image, mask or latent) to disk, useful to debug things outside comfy
        Deep Bump (mtb): Normal & height maps generation from single pictures
        String Replace (mtb): Basic string replacement
        Fit Number (mtb): Fit the input float using a source and target range
        Color Correct (mtb): Various color correction methods
        Image Compare (mtb): Compare two images and return a difference image
        Blur (mtb): Blur an image using a Gaussian filter.
        Mask To Image (mtb): Converts a mask (alpha) to an RGB image with a color and background
        Colored Image (mtb): Constant color image of given size
        Image Premultiply (mtb): Premultiply image with mask
        Image Resize Factor (mtb): Extracted mostly from WAS Node Suite, with a few edits (most notably multiple image support) and less features.
        Save Image Grid (mtb): Save all the images in the input batch as a grid of images.
        Load Image From Url (mtb): Load an image from the given URL
        Save Gif (mtb): Save the images from the batch as a GIF
        Export To Prores (mtb): Export to ProRes 4444 (Experimental)
        Latent Lerp (mtb): Linear interpolation (blend) between two latent vectors
        Image Remove Background Rembg (mtb): Removes the background from the input using Rembg.
        Float To Number (mtb): Node addon for the WAS Suite. Converts a "comfy" FLOAT to a NUMBER.
        Int To Bool (mtb): Basic int to bool conversion
        Int To Number (mtb): Node addon for the WAS Suite. Converts a "comfy" INT to a NUMBER.
        Transform Image (mtb): Save torch tensors (image, mask or latent) to disk, useful to debug things outside comfy
        Load Image Sequence (mtb): Load an image sequence from a folder. The current frame is used to determine which image to load.
        Save Image Sequence (mtb): Save an image sequence to a folder. The current frame is used to determine which image to save.

3- reinstall mtb just in case

Starting server

To see the GUI go to: http://127.0.0.1:8188
Error: OpenAI API key is invalid OpenAI features wont work for you
QualityOfLifeSuit_Omar92::NSP ready
FECTH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
FECTH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
FECTH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
FECTH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
Uninstall custom node 'MTB Nodes'
uninstall: ['https://github.com/melMass/comfy_mtb']
Uninstallation was successful.
After restarting ComfyUI, please refresh the browser.
FECTH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
FECTH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
Install custom node 'MTB Nodes'
install: ['https://github.com/melMass/comfy_mtb']
Download: git clone 'https://github.com/melMass/comfy_mtb'
Install: install script
Installation was successful.
After restarting ComfyUI, please refresh the browser.
FECTH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
FECTH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
FECTH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json

and 4-rerun

        PS ..\ComfyUI_windows_portable> .\run_nvidia_gpu.bat

..\ComfyUI_windows_portable>.\python_embeded\python.exe -s ComfyUI\main.py --normalvram --fp16-vae

#######################################################################
[ComfyUI-Manager] Starting dependency installation/(de)activation for the extension


## Execute install/(de)activation script for '..\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfy_mtb'
[mtb install] Installing requirements-parser...
Collecting requirements-parser
Downloading requirements_parser-0.5.0-py3-none-any.whl (18 kB)
Collecting types-setuptools>=57.0.0 (from requirements-parser)
Obtaining dependency information for types-setuptools>=57.0.0 from https://files.pythonhosted.org/packages/d2/e9/810aea674967eb6e6064928dea9c61b0bfb0147b5d7c56533f30ac32f4b0/types_setuptools-68.0.0.3-py3-none-any.whl.metadata
Downloading types_setuptools-68.0.0.3-py3-none-any.whl.metadata (1.6 kB)
Downloading types_setuptools-68.0.0.3-py3-none-any.whl (50 kB)
---------------------------------------- 50.4/50.4 kB 638.1 kB/s eta 0:00:00
DEPRECATION: torchsde 0.2.5 has a non-standard dependency specifier numpy>=1.19.*; python_version >= "3.7". pip 23.3 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of torchsde or contact the author to suggest that they release a version with a conforming dependency specifiers. Discussion can be found at https://github.com/pypa/pip/issues/12063
Installing collected packages: types-setuptools, requirements-parser
Successfully installed requirements-parser-0.5.0 types-setuptools-68.0.0.3
Command executed successfully!
[mtb install] Done.
[mtb install] No arguments provided, doing a full install/update...
[mtb install] Detected environment: embeded
[mtb install] Downloading and installing release wheels since we are in a Comfy embeded environment
[mtb install] Downloading and installing release wheels since no arguments where provided
                ✅ Package onnxruntime-gpu already installed (import name: 'onnxruntime').
                ⛔ Package qrcode is missing (import name: 'qrcode').
                ✅ Package rembg already installed (import name: 'rembg').
                ✅ Package tensorflow already installed (import name: 'tensorflow').
                ✅ Package tb-nightly already installed (import name: 'tensorboard').
                ✅ Package tensorflow already installed (import name: 'tensorflow').
                ⛔ Package facexlib is missing (import name: 'facexlib').
                ✅ Package insightface already installed (import name: 'insightface').
                ⛔ Package basicsr is missing (import name: 'basicsr').
[mtb install] ⚙️ Sorting the release wheels using wheels order
Collecting pycocotools==2.0.6
Downloading https://github.com/melMass/comfy_mtb/releases/download/v0.1.3/pycocotools-2.0.6-cp310-cp310-win_amd64.whl (84 kB)
-------------------------------------- 84.4/84.4 kB 680.0 kB/s eta 0:00:00
Collecting future==0.18.3
Downloading https://github.com/melMass/comfy_mtb/releases/download/v0.1.3/future-0.18.3-py3-none-any.whl (492 kB)
-------------------------------------- 492.1/492.1 kB 3.1 MB/s eta 0:00:00
Collecting filterpy==1.4.5
Downloading https://github.com/melMass/comfy_mtb/releases/download/v0.1.3/filterpy-1.4.5-py3-none-any.whl (110 kB)
---------------------------------------- 110.5/110.5 kB ? eta 0:00:00
Collecting easydict==1.10
Downloading https://github.com/melMass/comfy_mtb/releases/download/v0.1.3/easydict-1.10-py3-none-any.whl (6.5 kB)
Collecting gdown==4.7.1
Downloading https://github.com/melMass/comfy_mtb/releases/download/v0.1.3/gdown-4.7.1-py3-none-any.whl (15 kB)
Collecting basicsr==1.4.2
Downloading https://github.com/melMass/comfy_mtb/releases/download/v0.1.3/basicsr-1.4.2-py3-none-any.whl (214 kB)
-------------------------------------- 214.8/214.8 kB 4.4 MB/s eta 0:00:00
Collecting mmcv==2.0.0
Downloading https://github.com/melMass/comfy_mtb/releases/download/v0.1.3/mmcv-2.0.0-py2.py3-none-any.whl (719 kB)
-------------------------------------- 719.3/719.3 kB 4.5 MB/s eta 0:00:00
Collecting insightface==0.7.3
Downloading https://github.com/melMass/comfy_mtb/releases/download/v0.1.3/insightface-0.7.3-cp310-cp310-win_amd64.whl (868 kB)
------------------------------------- 868.2/868.2 kB 11.0 MB/s eta 0:00:00
Collecting lit==16.0.6
Downloading https://github.com/melMass/comfy_mtb/releases/download/v0.1.3/lit-16.0.6-py3-none-any.whl (93 kB)
---------------------------------------- 93.6/93.6 kB 5.2 MB/s eta 0:00:00

then a lot of requirement already satisfied, then this thread of errors:

Requirement already satisfied: pyasn1<0.6.0,>=0.4.6 in ..\comfyui_windows_portable\python_embeded\lib\site-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tb-nightly==2.12.0a20230126->-r F:/Progz/ComfyUI_windows_portable/ComfyUI/custom_nodes/comfy_mtb/reqs.txt (line 6)) (0.5.0)
Requirement already satisfied: oauthlib>=3.0.0 in ..\comfyui_windows_portable\python_embeded\lib\site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tb-nightly==2.12.0a20230126->-r F:/Progz/ComfyUI_windows_portable/ComfyUI/custom_nodes/comfy_mtb/reqs.txt (line 6)) (3.2.2)
Downloading onnxruntime_gpu-1.15.1-cp310-cp310-win_amd64.whl (122.5 MB)
--------------------------------------- 122.5/122.5 MB 19.3 MB/s eta 0:00:00
Downloading rembg-2.0.50-py3-none-any.whl (26 kB)
DEPRECATION: torchsde 0.2.5 has a non-standard dependency specifier numpy>=1.19.*; python_version >= "3.7". pip 23.3 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of torchsde or contact the author to suggest that they release a version with a conforming dependency specifiers. Discussion can be found at https://github.com/pypa/pip/issues/12063
Installing collected packages: tensorboard-plugin-wit, pypng, keras, tensorflow-estimator, tensorboard-data-server, qrcode, protobuf, keras-preprocessing, onnx, onnxruntime-gpu, google-auth-oauthlib, tensorboard, tb-nightly, rembg, facexlib, tensorflow
Attempting uninstall: keras
Found existing installation: keras 2.12.0
Uninstalling keras-2.12.0:
Successfully uninstalled keras-2.12.0
Attempting uninstall: tensorflow-estimator
Found existing installation: tensorflow-estimator 2.12.0
Uninstalling tensorflow-estimator-2.12.0:
Successfully uninstalled tensorflow-estimator-2.12.0
Attempting uninstall: tensorboard-data-server
Found existing installation: tensorboard-data-server 0.7.1
Uninstalling tensorboard-data-server-0.7.1:
Successfully uninstalled tensorboard-data-server-0.7.1
Attempting uninstall: protobuf
Found existing installation: protobuf 3.20.3
Uninstalling protobuf-3.20.3:
Successfully uninstalled protobuf-3.20.3
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'F:\\Progz\\ComfyUI_windows_portable\\python_embeded\\Lib\\site-packages\\google\\~rotobuf\\internal\\_api_implementation.cp310-win_amd64.pyd'
Consider using the `--user` option or check the permissions.
Command failed with return code: 1
[mtb install] ✅ Successfully installed all dependencies.

[ComfyUI-Manager] Startup script completed.
#######################################################################


Prestartup times for custom nodes:
  76.8 seconds: ..\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager

Total VRAM 8191 MB, total RAM 65445 MB
xformers version: 0.0.20
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3070 : cudaMallocAsync
Using xformers cross attention
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ ..\ComfyUI_windows_portable\python_embeded\lib\site-packages\transformers\utils\import_uti │
│ ls.py:1084 in _get_module                                                                        │
│                                                                                                  │
│   1081 │                                                                                         │
│   1082 │   def _get_module(self, module_name: str):                                              │
│   1083 │   │   try:                                                                              │
│ ❱ 1084 │   │   │   return importlib.import_module("." + module_name, self.__name__)              │
│   1085 │   │   except Exception as e:                                                            │
│   1086 │   │   │   raise RuntimeError(                                                           │
│   1087 │   │   │   │   f"Failed to import {self.__name__}.{module_name} because of the followin  │
│                                                                                                  │
│ in import_module:126                                                                             │
│ in _gcd_import:1050                                                                              │
│ in _find_and_load:1027                                                                           │
│ in _find_and_load_unlocked:1006                                                                  │
│ in _load_unlocked:688                                                                            │
│ in exec_module:883                                                                               │
│ in _call_with_frames_removed:241                                                                 │
│                                                                                                  │
│ ..\ComfyUI_windows_portable\python_embeded\lib\site-packages\transformers\models\clip\imag │
│ e_processing_clip.py:22 in <module>                                                              │
│                                                                                                  │
│    19 import numpy as np                                                                         │
│    20                                                                                            │
│    21 from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict      │
│ ❱  22 from ...image_transforms import (                                                          │
│    23 │   center_crop,                                                                           │
│    24 │   convert_to_rgb,                                                                        │
│    25 │   get_resize_output_image_size,                                                          │
│                                                                                                  │
│ ..\ComfyUI_windows_portable\python_embeded\lib\site-packages\transformers\image_transforms │
│ .py:48 in <module>                                                                               │
│                                                                                                  │
│    45 │   import torch                                                                           │
│    46                                                                                            │
│    47 if is_tf_available():                                                                      │
│ ❱  48 │   import tensorflow as tf                                                                │
│    49                                                                                            │
│    50 if is_flax_available():                                                                    │
│    51 │   import jax.numpy as jnp                                                                │
│                                                                                                  │
│ ..\ComfyUI_windows_portable\python_embeded\lib\site-packages\tensorflow\__init__.py:37 in  │
│ <module>                                                                                         │
│                                                                                                  │
│    34 import sys as _sys                                                                         │
│    35 import typing as _typing                                                                   │
│    36                                                                                            │
│ ❱  37 from tensorflow.python.tools import module_util as _module_util                            │
│    38 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader                   │
│    39                                                                                            │
│    40 # Make sure code inside the TensorFlow codebase can use tf2.enabled() at import.           │
│                                                                                                  │
│ ..\ComfyUI_windows_portable\python_embeded\lib\site-packages\tensorflow\python\__init__.py │
│ :37 in <module>                                                                                  │
│                                                                                                  │
│    34 # pylint: disable=wildcard-import,g-bad-import-order,g-import-not-at-top                   │
│    35                                                                                            │
│    36 from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow                      │
│ ❱  37 from tensorflow.python.eager import context                                                │
│    38                                                                                            │
│    39 # pylint: enable=wildcard-import                                                           │
│    40                                                                                            │
│                                                                                                  │
│ ..\ComfyUI_windows_portable\python_embeded\lib\site-packages\tensorflow\python\eager\conte │
│ xt.py:28 in <module>                                                                             │
│                                                                                                  │
│     25 from absl import logging                                                                  │
│     26 import numpy as np                                                                        │
│     27                                                                                           │
│ ❱   28 from tensorflow.core.framework import function_pb2                                        │
│     29 from tensorflow.core.protobuf import config_pb2                                           │
│     30 from tensorflow.core.protobuf import rewriter_config_pb2                                  │
│     31 from tensorflow.python import pywrap_tfe                                                  │
│                                                                                                  │
│ ..\ComfyUI_windows_portable\python_embeded\lib\site-packages\tensorflow\core\framework\fun │
│ ction_pb2.py:5 in <module>                                                                       │
│                                                                                                  │
│    2 # Generated by the protocol buffer compiler.  DO NOT EDIT!                                  │
│    3 # source: tensorflow/core/framework/function.proto                                          │
│    4 """Generated protocol buffer code."""                                                       │
│ ❱  5 from google.protobuf.internal import builder as _builder                                    │
│    6 from google.protobuf import descriptor as _descriptor                                       │
│    7 from google.protobuf import descriptor_pool as _descriptor_pool                             │
│    8 from google.protobuf import symbol_database as _symbol_database                             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ImportError: cannot import name 'builder' from 'google.protobuf.internal' (..\ComfyUI_windows_portable\python_embeded\lib\site-packages\google\protobuf\internal\__init__.py)

The above exception was the direct cause of the following exception:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ ..\ComfyUI_windows_portable\ComfyUI\main.py:69 in <module>                                 │
│                                                                                                  │
│    66 import comfy.utils                                                                         │
│    67 import yaml                                                                                │
│    68                                                                                            │
│ ❱  69 import execution                                                                           │
│    70 import server                                                                              │
│    71 from server import BinaryEventTypes                                                        │
│    72 from nodes import init_custom_nodes                                                        │
│                                                                                                  │
│ ..\ComfyUI_windows_portable\ComfyUI\execution.py:11 in <module>                            │
│                                                                                                  │
│     8 import gc                                                                                  │
│     9                                                                                            │
│    10 import torch                                                                               │
│ ❱  11 import nodes                                                                               │
│    12                                                                                            │
│    13 import comfy.model_management                                                              │
│    14                                                                                            │
│                                                                                                  │
│ ..\ComfyUI_windows_portable\ComfyUI\nodes.py:20 in <module>                                │
│                                                                                                  │
│     17 sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "comfy"))    │
│     18                                                                                           │
│     19                                                                                           │
│ ❱   20 import comfy.diffusers_load                                                               │
│     21 import comfy.samplers                                                                     │
│     22 import comfy.sample                                                                       │
│     23 import comfy.sd                                                                           │
│                                                                                                  │
│ ..\ComfyUI_windows_portable\ComfyUI\comfy\diffusers_load.py:6 in <module>                  │
│                                                                                                  │
│    3 import yaml                                                                                 │
│    4                                                                                             │
│    5 import folder_paths                                                                         │
│ ❱  6 from comfy.sd import load_checkpoint                                                        │
│    7 import os.path as osp                                                                       │
│    8 import re                                                                                   │
│    9 import torch                                                                                │
│                                                                                                  │
│ ..\ComfyUI_windows_portable\ComfyUI\comfy\sd.py:14 in <module>                             │
│                                                                                                  │
│     11 from .t2i_adapter import adapter                                                          │
│     12                                                                                           │
│     13 from . import utils                                                                       │
│ ❱   14 from . import clip_vision                                                                 │
│     15 from . import gligen                                                                      │
│     16 from . import diffusers_convert                                                           │
│     17 from . import model_base                                                                  │
│                                                                                                  │
│ ..\ComfyUI_windows_portable\ComfyUI\comfy\clip_vision.py:1 in <module>                     │
│                                                                                                  │
│ ❱  1 from transformers import CLIPVisionModelWithProjection, CLIPVisionConfig, CLIPImageProce    │
│    2 from .utils import load_torch_file, transformers_convert                                    │
│    3 import os                                                                                   │
│    4 import torch                                                                                │
│ in _handle_fromlist:1075                                                                         │
│                                                                                                  │
│ ..\ComfyUI_windows_portable\python_embeded\lib\site-packages\transformers\utils\import_uti │
│ ls.py:1075 in __getattr__                                                                        │
│                                                                                                  │
│   1072 │   │   │   value = self._get_module(name)                                                │
│   1073 │   │   elif name in self._class_to_module.keys():                                        │
│   1074 │   │   │   module = self._get_module(self._class_to_module[name])                        │
│ ❱ 1075 │   │   │   value = getattr(module, name)                                                 │
│   1076 │   │   else:                                                                             │
│   1077 │   │   │   raise AttributeError(f"module {self.__name__} has no attribute {name}")       │
│   1078                                                                                           │
│                                                                                                  │
│ ..\ComfyUI_windows_portable\python_embeded\lib\site-packages\transformers\utils\import_uti │
│ ls.py:1074 in __getattr__                                                                        │
│                                                                                                  │
│   1071 │   │   if name in self._modules:                                                         │
│   1072 │   │   │   value = self._get_module(name)                                                │
│   1073 │   │   elif name in self._class_to_module.keys():                                        │
│ ❱ 1074 │   │   │   module = self._get_module(self._class_to_module[name])                        │
│   1075 │   │   │   value = getattr(module, name)                                                 │
│   1076 │   │   else:                                                                             │
│   1077 │   │   │   raise AttributeError(f"module {self.__name__} has no attribute {name}")       │
│                                                                                                  │
│ ..\ComfyUI_windows_portable\python_embeded\lib\site-packages\transformers\utils\import_uti │
│ ls.py:1086 in _get_module                                                                        │
│                                                                                                  │
│   1083 │   │   try:                                                                              │
│   1084 │   │   │   return importlib.import_module("." + module_name, self.__name__)              │
│   1085 │   │   except Exception as e:                                                            │
│ ❱ 1086 │   │   │   raise RuntimeError(                                                           │
│   1087 │   │   │   │   f"Failed to import {self.__name__}.{module_name} because of the followin  │
│   1088 │   │   │   │   f" traceback):\n{e}"                                                      │
│   1089 │   │   │   ) from e                                                                      │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
RuntimeError: Failed to import transformers.models.clip.image_processing_clip because of the following error (look up to see its traceback):
cannot import name 'builder' from 'google.protobuf.internal' (..\ComfyUI_windows_portable\python_embeded\lib\site-packages\google\protobuf\internal\__init__.py)

..\ComfyUI_windows_portable>pause

then I tried to update myself some packages of the embedded_python's pip (not sure which part is this now) and ran again, got these errors/warnings

Traceback (most recent call last):
  File "...ComfyUI_windows_portable\ComfyUI\nodes.py", line 1647, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "...ComfyUI_windows_portable\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\__init__.py", line 1, in <module>
    from custom_nodes.comfy_controlnet_preprocessors.nodes import edge_line, normal_depth_map, pose, semseg, others
  File "...ComfyUI_windows_portable\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\__init__.py", line 1, in <module>
    from custom_nodes.comfy_controlnet_preprocessors.nodes import edge_line, normal_depth_map, pose, semseg, others
  File "...ComfyUI_windows_portable\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\nodes\pose.py", line 5, in <module>
    from .. import mp_pose_hand
  File "...ComfyUI_windows_portable\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\mp_pose_hand\__init__.py", line 2, in <module>
    import mediapipe as mp
  File "...ComfyUI_windows_portable\python_embeded\lib\site-packages\mediapipe\__init__.py", line 16, in <module>
    import mediapipe.python.solutions as solutions
  File "...ComfyUI_windows_portable\python_embeded\lib\site-packages\mediapipe\python\solutions\__init__.py", line 17, in <module>
    import mediapipe.python.solutions.drawing_styles
  File "...ComfyUI_windows_portable\python_embeded\lib\site-packages\mediapipe\python\solutions\drawing_styles.py", line 20, in <module>
    from mediapipe.python.solutions.drawing_utils import DrawingSpec
  File "...ComfyUI_windows_portable\python_embeded\lib\site-packages\mediapipe\python\solutions\drawing_utils.py", line 24, in <module>
    from mediapipe.framework.formats import detection_pb2
  File "...ComfyUI_windows_portable\python_embeded\lib\site-packages\mediapipe\framework\formats\detection_pb2.py", line 16, in <module>
    from mediapipe.framework.formats import location_data_pb2 as mediapipe_dot_framework_dot_formats_dot_location__data__pb2
  File "...ComfyUI_windows_portable\python_embeded\lib\site-packages\mediapipe\framework\formats\location_data_pb2.py", line 16, in <module>
    from mediapipe.framework.formats.annotation import rasterization_pb2 as mediapipe_dot_framework_dot_formats_dot_annotation_dot_rasterization__pb2
  File "...ComfyUI_windows_portable\python_embeded\lib\site-packages\mediapipe\framework\formats\annotation\rasterization_pb2.py", line 36, in <module>
    _descriptor.FieldDescriptor(
  File "...ComfyUI_windows_portable\python_embeded\lib\site-packages\google\protobuf\descriptor.py", line 561, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates

Cannot import ...ComfyUI_windows_portable\ComfyUI\custom_nodes\comfy_controlnet_preprocessors module for custom nodes: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
Log level: 20
[comfy_mtb] | WARNING -> Web extensions folder at ...ComfyUI_windows_portable\ComfyUI\web\extensions\mtb is not a symlink, if updating please delete it before
RestoreFace
LoadFaceEnhanceModel
FaceSwap
LoadFaceSwapModel
LoadFaceAnalysisModel
[comfy_mtb] | INFO -> Some nodes failed to load:
        Failed to import module faceenhance because ModuleNotFoundError: No module named 'facexlib'
        Failed to import module faceswap because ModuleNotFoundError: No module named 'sklearn'

Check that you properly installed the dependencies.
If you think this is a bug, please report it on the github page (https://github.com/melMass/comfy_mtb/issues)
[comfy_mtb] | INFO -> Loaded the following nodes:
        Animation Builder (mtb): Convenient way to manage basic animation maths at the core of many of my workflows
        Smart Step (mtb): Utils to control the steps start/stop of the KAdvancedSampler in percentage
        Text To Image (mtb): Utils to convert text to image using a font
        Styles Loader (mtb): Load csv files and populate a dropdown from the rows (à la A111)
        Bbox From Mask (mtb): From a mask extract the bounding box
        Bbox (mtb): The bounding box (BBOX) custom type used by other nodes
        Crop (mtb): Crops an image and an optional mask to a given bounding box
        Uncrop (mtb): Uncrops an image to a given bounding box
        Debug (mtb): Experimental node to debug any Comfy values, support for more types and widgets is planned
        Save Tensors (mtb): Save torch tensors (image, mask or latent) to disk, useful to debug things outside comfy
        Deep Bump (mtb): Normal & height maps generation from single pictures
        Qr Code (mtb): Basic QR Code generator
        Unsplash Image (mtb): Unsplash Image given a keyword and a size
        String Replace (mtb): Basic string replacement
        Fit Number (mtb): Fit the input float using a source and target range
        Load Film Model (mtb): Loads a FILM model
        Film Interpolation (mtb): Google Research FILM frame interpolation for large motion
        Concat Images (mtb): Add images to batch
        Get Batch From History (mtb): Very experimental node to load images from the history of the server.
        Color Correct (mtb): Various color correction methods
        Image Compare (mtb): Compare two images and return a difference image
        Blur (mtb): Blur an image using a Gaussian filter.
        Mask To Image (mtb): Converts a mask (alpha) to an RGB image with a color and background
        Colored Image (mtb): Constant color image of given size
        Image Premultiply (mtb): Premultiply image with mask
        Image Resize Factor (mtb): Extracted mostly from WAS Node Suite, with a few edits (most notably multiple image support) and less features.
        Save Image Grid (mtb): Save all the images in the input batch as a grid of images.
        Load Image From Url (mtb): Load an image from the given URL
        Save Gif (mtb): Save the images from the batch as a GIF
        Export To Prores (mtb): Export to ProRes 4444 (Experimental)
        Latent Lerp (mtb): Linear interpolation (blend) between two latent vectors
        Image Remove Background Rembg (mtb): Removes the background from the input using Rembg.
        Float To Number (mtb): Node addon for the WAS Suite. Converts a "comfy" FLOAT to a NUMBER.
        Int To Bool (mtb): Basic int to bool conversion
        Int To Number (mtb): Node addon for the WAS Suite. Converts a "comfy" INT to a NUMBER.
        Transform Image (mtb): Save torch tensors (image, mask or latent) to disk, useful to debug things outside comfy
        Load Image Sequence (mtb): Load an image sequence from a folder. The current frame is used to determine which image to load.
        Save Image Sequence (mtb): Save an image sequence to a folder. The current frame is used to determine which image to save.
WARNING: Ignoring invalid distribution -rotobuf (...comfyui_windows_portable\python_embeded\lib\site-packages)

@melMass
Copy link
Owner

melMass commented Aug 6, 2023

@Natotela Thanks that log is quite insightful!

This in particular:

ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 
"F:\\Progz\\ComfyUI_windows_portable\\python_embeded\\Lib\\site-packages\\google\\~rotobuf\\internal\\_api_implementation.cp310-win_amd64.pyd"

I don't know why pip on windows does that exactly but I've seen it before, Windows file locking make it fail to overwrite the file.

Can you try:

python_embedded/python.exe -m pip install  protobuf==3.19.6

I removed it recently but it's actually fixing the wrong version the old tensorflow library installs.

I will add a controlnet preprocessors to the test CI before installing mtb, this might help to diagnose it from my side since it all works for me (I'm testing colab, embedded regularly and personally venv daily)

In #50 I will also add some more functionalities to /mtb/status so that models and deps can be downloaded separately, FaceSwap / FaceRestore and FILM will be the only nodes affected by this since they are the ones with problematic libraries.

@Natotela

This comment was marked as outdated.

@Natotela
Copy link

Natotela commented Aug 7, 2023

used the download_models.py to download all models
YET, I cannot seem to get the onnx model listed in the faceSwap node;

when running I get:

[comfy_mtb] | INFO -> Some nodes failed to load:
        Failed to import module faceswap because ModuleNotFoundError: No module named 'sklearn'

when loading in ComfyUI
03-animation_builder-condition-lerp.json & 04-animation_builder-deforum.json :

Loading aborted due to error reloading workflow data

TypeError: Cannot read properties of undefined (reading 'type')
TypeError: Cannot read properties of undefined (reading 'type')
    at Module.hideWidgetForGood (http://127.0.0.1:8188/extensions/mtb/comfy_shared.js:202:28)
    at nodeType.onNodeCreated (http://127.0.0.1:8188/extensions/mtb/mtb_widgets.js:701:18)
    at nodeType.onNodeCreated (http://127.0.0.1:8188/extensions/ZZZ-Bmad-DirtyUndoRedo/DirtyUndoRedo.js:37:53)
    at Object.createNode (http://127.0.0.1:8188/lib/litegraph.core.js:478:22)
    at LGraph.configure (http://127.0.0.1:8188/lib/litegraph.core.js:2215:38)
    at ComfyApp.loadGraphData (http://127.0.0.1:8188/scripts/app.js:1222:15)
    at reader.onload (http://127.0.0.1:8188/scripts/app.js:1530:10)
This may be due to the following script:
/extensions/mtb/comfy_shared.js

@melMass
Copy link
Owner

melMass commented Aug 7, 2023

[comfy_mtb] | INFO -> Some nodes failed to load:
        Failed to import module faceswap because ModuleNotFoundError: No module named 'sklearn'

This is strange since sickit-learn is a direct dependency of insightface (see here), so it should get installed at the same time.

TypeError: Cannot read properties of undefined (reading 'type')
This may be due to the following script:
/extensions/mtb/comfy_shared.js

For this it might be due to a comfy update, I will update now to see

@Natotela
Copy link

Natotela commented Aug 8, 2023

sickit-learn is a direct dependency of insightface

and I actually have it

.\python_embeded\python.exe -m pip show scikit-learn
WARNING: Ignoring invalid distribution -rotobuf (f:\progz\comfyui_windows_portable\python_embeded\lib\site-packages)
Name: scikit-learn
Version: 1.2.2
Summary: A set of python modules for machine learning and data mining
Home-page: http://scikit-learn.org
Author:
Author-email:
License: new BSD
Location: c:\users\proxy1\appdata\roaming\python\python310\site-packages
Requires: joblib, numpy, scipy, threadpoolctl
Required-by: insightface, qudida

@melMass
Copy link
Owner

melMass commented Aug 8, 2023

@Natotela Its a bit hard to follow the remaining issues and the OP never added any details or answer so I'm going to close this, feel free to open a clear issue!
Thanks

@melMass melMass closed this as not planned Won't fix, can't repro, duplicate, stale Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
install issue type: 🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants