melMass / comfy_mtb

Animation oriented nodes pack for ComfyUI
MIT License
408 stars 45 forks source link

[question] Custom extensions colliding with each other? #75

Closed milksteak1111 closed 11 months ago

milksteak1111 commented 1 year ago

Describe the bug

I'm sure this is just an issue on my end but was just wondering if it was a simple fix. Most stuff is working but my custom scripts nodes aren't loading and these are the last errors i'm seeing. Face swap, bbox and stuff are working fine

Reproduction

No response

Expected behavior

No response

Platform and versions

Windows 10 local install

Console output


Microsoft Windows [Version 10.0.19045.3324]
(c) Microsoft Corporation. All rights reserved.

A:\ComfyUI>cd A:\ComfyUI\VIRTUAL_INSANITY\Scripts

A:\ComfyUI\VIRTUAL_INSANITY\Scripts>activate

(VIRTUAL_INSANITY) A:\ComfyUI\VIRTUAL_INSANITY\Scripts>cd A:\ComfyUI

(VIRTUAL_INSANITY) A:\ComfyUI>python main.py
** ComfyUI start up time: 2023-08-25 09:52:22.472932

Prestartup times for custom nodes:
   0.0 seconds: A:\ComfyUI\custom_nodes\rgthree-comfy
   0.0 seconds: A:\ComfyUI\custom_nodes\ComfyUI-Manager

Total VRAM 8192 MB, total RAM 32585 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3070 Ti : cudaMallocAsync
Using pytorch cross attention
Total VRAM 8192 MB, total RAM 32585 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3070 Ti : cudaMallocAsync
### Copying: BilboX web...
### ComfyUI-FaceSwap: Check dependencies
### ComfyUI-FaceSwap: Check basic models
### Loading: ComfyUI-Impact-Pack (V3.24.3)
### Loading: ComfyUI-Impact-Pack (Subpack: V0.2)
### Loading: ComfyUI-Manager (V0.26.2)
### ComfyUI Revision: 1340 [30eb92c3]
Failed to auto update `Quality of Life Suit`
QualityOfLifeSuit_Omar92_DIR: A:\ComfyUI\custom_nodes\ComfyUI-QualityOfLifeSuit_Omar92
09:52:27 - ReActor Node - STATUS - Running v0.1.1b in ComfyUI
### Loading: Save as Webp
Copying JS files for Workflow loading
Comfyroll Custom Nodes: Loaded
Registered sys.path: ['A:\\ComfyUI\\custom_nodes\\comfyui_controlnet_aux\\src\\__init__.py', 'A:\\ComfyUI\\custom_nodes\\comfyui_controlnet_aux\\src\\custom_pycocotools', 'A:\\ComfyUI\\custom_nodes\\comfyui_controlnet_aux\\src\\custom_oneformer', 'A:\\ComfyUI\\custom_nodes\\comfyui_controlnet_aux\\src\\custom_mmpkg', 'A:\\ComfyUI\\custom_nodes\\comfyui_controlnet_aux\\src\\custom_midas_repo', 'A:\\ComfyUI\\custom_nodes\\comfyui_controlnet_aux\\src\\custom_detectron2', 'A:\\ComfyUI\\custom_nodes\\comfyui_controlnet_aux\\src\\controlnet_aux', 'A:\\ComfyUI\\custom_nodes\\comfyui_controlnet_aux\\src', 'A:\\ComfyUI\\custom_nodes\\ComfyUI_Comfyroll_CustomNodes\\comfy', 'A:\\ComfyUI\\custom_nodes\\ComfyUI-Advanced-ControlNet\\comfy', 'A:\\ComfyUI\\VIRTUAL_INSANITY\\lib\\site-packages\\git\\ext\\gitdb', 'A:\\ComfyUI\\custom_nodes\\ComfyUI-Advanced-ControlNet\\comfy', 'A:\\ComfyUI\\comfy', 'A:\\ComfyUI', 'C:\\Users\\bitch ass nigga\\AppData\\Local\\Programs\\Python\\Python310\\python310.zip', 'C:\\Users\\bitch ass nigga\\AppData\\Local\\Programs\\Python\\Python310\\DLLs', 'C:\\Users\\bitch ass nigga\\AppData\\Local\\Programs\\Python\\Python310\\lib', 'C:\\Users\\bitch ass nigga\\AppData\\Local\\Programs\\Python\\Python310', 'A:\\ComfyUI\\VIRTUAL_INSANITY', 'A:\\ComfyUI\\VIRTUAL_INSANITY\\lib\\site-packages', 'A:\\ComfyUI\\VIRTUAL_INSANITY\\lib\\site-packages\\win32', 'A:\\ComfyUI\\VIRTUAL_INSANITY\\lib\\site-packages\\win32\\lib', 'A:\\ComfyUI\\VIRTUAL_INSANITY\\lib\\site-packages\\Pythonwin', 'A:\\ComfyUI\\custom_nodes\\ambw_comfyui', 'A:\\ComfyUI\\custom_nodes\\ComfyUI-FaceSwap\\modules', '../..', 'A:\\ComfyUI\\custom_nodes\\ComfyUI-Impact-Pack\\modules', 'A:\\ComfyUI\\custom_nodes\\ComfyUI-Impact-Pack\\subpack', '../..']
Davemane42 Custom Nodes: Loaded
Fooocus combined KSampler: loaded
2023-08-25 09:52:29,449 - roop - STATUS - roop v0.0.2
[tinyterraNodes] Loaded
Traceback (most recent call last):
  File "A:\ComfyUI\nodes.py", line 1693, 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 "A:\ComfyUI\custom_nodes\comfy_mtb\__init__.py", line 59, in <module>
    for filename in (here / "nodes").iterdir():
  File "C:\Users\fffff\AppData\Local\Programs\Python\Python310\lib\pathlib.py", line 1015, in iterdir
    for name in self._accessor.listdir(self):
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'nodes'

Cannot import A:\ComfyUI\custom_nodes\comfy_mtb module for custom nodes: [WinError 3] The system cannot find the path specified: 'nodes'
!! Trying to start the node
A:\ComfyUI\custom_nodes\failfast-comfyui-extensions\extensions
A:\ComfyUI\web\extensions\failfast-comfyui-extensions
rgthree's comfy nodes: Loaded 13 exciting nodes.
WAS Node Suite: OpenCV Python FFMPEG support is enabled
WAS Node Suite: `ffmpeg_bin_path` is set to: C:♀fmpein
WAS Node Suite: Finished. Loaded 192 nodes successfully.

        "Art is a harmony parallel with nature." - Paul Cézanne

Import times for custom nodes:
   0.0 seconds: A:\ComfyUI\custom_nodes\imageflip_ally.py
   0.0 seconds: A:\ComfyUI\custom_nodes\sdxl_utility.py
   0.0 seconds: A:\ComfyUI\custom_nodes\histogram_equalization.py
   0.0 seconds: A:\ComfyUI\custom_nodes\Pseudo_HDR_ally.py
   0.0 seconds: A:\ComfyUI\custom_nodes\gaussian_blur_ally.py
   0.0 seconds: A:\ComfyUI\custom_nodes\bsz-auto-hires.py
   0.0 seconds: A:\ComfyUI\custom_nodes\ksampler_sdxl.py
   0.0 seconds: A:\ComfyUI\custom_nodes\fcSuite.py
   0.0 seconds: A:\ComfyUI\custom_nodes\saturation_ally.py
   0.0 seconds: A:\ComfyUI\custom_nodes\brightness_contrast_ally.py
   0.0 seconds: A:\ComfyUI\custom_nodes\sharpness_ally.py
   0.0 seconds: A:\ComfyUI\custom_nodes\LoadLoraWithTags
   0.0 seconds: A:\ComfyUI\custom_nodes\sdxl_prompt_styler
   0.0 seconds: A:\ComfyUI\custom_nodes\Mile_High_Styler
   0.0 seconds: A:\ComfyUI\custom_nodes\sdxl-recommended-res-calc
   0.0 seconds: A:\ComfyUI\custom_nodes\ComfyUI-GPU-temperature-protection
   0.0 seconds: A:\ComfyUI\custom_nodes\pfaeff-comfyui
   0.0 seconds: A:\ComfyUI\custom_nodes\ComfyUI-Custom-Scripts
   0.0 seconds: A:\ComfyUI\custom_nodes\ComfyUI_JPS-Nodes
   0.0 seconds: A:\ComfyUI\custom_nodes\comfyui_lora_tag_loader
   0.0 seconds: A:\ComfyUI\custom_nodes\masquerade-nodes-comfyui
   0.0 seconds: A:\ComfyUI\custom_nodes\MergeBlockWeighted_fo_ComfyUI
   0.0 seconds: A:\ComfyUI\custom_nodes\Artists_Compendium
   0.0 seconds: A:\ComfyUI\custom_nodes\ComfyUI-Coziness
   0.0 seconds: A:\ComfyUI\custom_nodes\ComfyUI-Advanced-ControlNet
   0.0 seconds: A:\ComfyUI\custom_nodes\ComfyUI_Cutoff
   0.0 seconds: A:\ComfyUI\custom_nodes\ComfyUI_TiledKSampler
   0.0 seconds: A:\ComfyUI\custom_nodes\ControlNet-LLLite-ComfyUI
   0.0 seconds: A:\ComfyUI\custom_nodes\sdxl_model_merging.py
   0.0 seconds: A:\ComfyUI\custom_nodes\ComfyUI_Load_Image_With_Metadata
   0.0 seconds: A:\ComfyUI\custom_nodes\wlsh_nodes
   0.0 seconds: A:\ComfyUI\custom_nodes\mikey_nodes
   0.0 seconds: A:\ComfyUI\custom_nodes\ComfyUI-post-processing-nodes
   0.0 seconds: A:\ComfyUI\custom_nodes\SeargeSDXL
   0.0 seconds: A:\ComfyUI\custom_nodes\ComfyUI_Dave_CustomNode
   0.0 seconds: A:\ComfyUI\custom_nodes\facedetailer
   0.0 seconds: A:\ComfyUI\custom_nodes\ComfyUI_NestedNodeBuilder
   0.0 seconds: A:\ComfyUI\custom_nodes\ComfyUI-Saveaswebp
   0.0 seconds: A:\ComfyUI\custom_nodes\ComfyUI_SeeCoder
   0.0 seconds: A:\ComfyUI\custom_nodes\ComfyUI_Fooocus_KSampler
   0.0 seconds (IMPORT FAILED): A:\ComfyUI\custom_nodes\comfy_mtb
   0.0 seconds: A:\ComfyUI\custom_nodes\ComfyUI-QualityOfLifeSuit_Omar92
   0.0 seconds: A:\ComfyUI\custom_nodes\failfast-comfyui-extensions
   0.0 seconds: A:\ComfyUI\custom_nodes\OneButtonPrompt
   0.0 seconds: A:\ComfyUI\custom_nodes\rgthree-comfy
   0.0 seconds: A:\ComfyUI\custom_nodes\ambw_comfyui
   0.0 seconds: A:\ComfyUI\custom_nodes\comfy-image-saver
   0.0 seconds: A:\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale
   0.0 seconds: A:\ComfyUI\custom_nodes\comfyui-reactor-node
   0.0 seconds: A:\ComfyUI\custom_nodes\ComfyUI_roop
   0.0 seconds: A:\ComfyUI\custom_nodes\comfyui_controlnet_aux
   0.0 seconds: A:\ComfyUI\custom_nodes\ComfyUI_Comfyroll_CustomNodes
   0.0 seconds: A:\ComfyUI\custom_nodes\Derfuu_ComfyUI_ModdedNodes
   0.0 seconds: A:\ComfyUI\custom_nodes\facerestore
   0.0 seconds: A:\ComfyUI\custom_nodes\ComfyI2I
   0.0 seconds: A:\ComfyUI\custom_nodes\bilbox-comfyui
   0.1 seconds: A:\ComfyUI\custom_nodes\ComfyUI_Custom_Nodes_AlekPet
   0.1 seconds: A:\ComfyUI\custom_nodes\comfyui-PromptAttention
   0.2 seconds: A:\ComfyUI\custom_nodes\clipseg.py
   0.3 seconds: A:\ComfyUI\custom_nodes\ComfyUI-FaceSwap
   0.3 seconds: A:\ComfyUI\custom_nodes\ComfyUI-Manager
   0.5 seconds: A:\ComfyUI\custom_nodes\ComfyUI_tinyterraNodes
   0.5 seconds: A:\ComfyUI\custom_nodes\efficiency-nodes-comfyui
   0.9 seconds: A:\ComfyUI\custom_nodes\was-node-suite-comfyui
   0.9 seconds: A:\ComfyUI\custom_nodes\ComfyUI-Impact-Pack
   1.5 seconds: A:\ComfyUI\custom_nodes\ComfyUI_Inpaint

Starting server
melMass commented 1 year ago

This happens when you add your own custom nodes right? From the log it seems that no nodes are loaded at all since for filename in (here / "nodes").iterdir(): is the line that starts the node registration loop

milksteak1111 commented 1 year ago

Yeah mostly everything loads, just not custom scripts and various other nodes. But I have added some lesser known people's smaller custom nodes that are probably the culprit(or some syntax error or something, im new with python). I'm just not sure which node would be causing it so I can delete it since none others are failing

melMass commented 1 year ago

If you can try to start Comfy with MTB_DEBUG=true it can help further, you have some instructions here for setting it in the UI or endpoint: https://github.com/melMass/comfy_mtb/wiki/Debugging

If you can't access these you can try to specify it on the command line or bat script:

These are just examples adapt to your own run commands:

Unix: MTB_DEBUG=true python main.py

Windows cmd cmd /C "set "MTB_DEBUG=true" && python main.py

milksteak1111 commented 1 year ago

Im not really sure how to set it to true, I dont see it in the json files anywhere and I cant get the commands right for cmd

melMass commented 1 year ago

I'm not sure what json you refer too, depending on how you launch comfy just add this there, so in the bat file or if you use cmd.exe you can run something like this:

set MTB_DEBUG=true && <YOUR-COMFYCOMMAND-HERE>

So for instance

set MTB_DEBUG=true && ../python-embedded/python.exe main.py
melMass commented 11 months ago

I know it's been a long time but I just uncovered a behaviour I wasn't aware of and could be linked to this:

Comfy doesn't actually know what to do if two nodes class name are exactly the same (in python)...

This has the effect of replacing the last imported python node if that makes sense, but this creates a strange thing where the web definition is taken from one, but on execution it calls the other one... For mtb I just fixed this by appending underscore for class names that could be too common with other extension pack. (see https://github.com/melMass/comfy_mtb/blob/3e8c2fe789925e7017c2f8c8d9164c139588aba4/nodes/image_processing.py#L183)