ssitu / ComfyUI_UltimateSDUpscale

ComfyUI nodes for the Ultimate Stable Diffusion Upscale script by Coyote-A.
GNU General Public License v3.0
859 stars 58 forks source link

Error after updating ComfyUI #62

Closed gonzalu closed 7 months ago

gonzalu commented 8 months ago

Node is failing to load today after updating ComfyUI and some modules:

Traceback (most recent call last):
  File "E:\ComfyUI\ComfyUI\nodes.py", line 1887, 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 "E:\ComfyUI\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale\__init__.py", line 24, in <module>
    from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
  File "E:\ComfyUI\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale\nodes.py", line 5, in <module>
    from usdu_patch import usdu
  File "E:\ComfyUI\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale\usdu_patch.py", line 2, in <module>
    from repositories import ultimate_upscale as usdu
  File "E:\ComfyUI\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale\repositories\__init__.py", line 14, in <module>
    spec.loader.exec_module(ultimate_upscale)
  File "E:\ComfyUI\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale\repositories\ultimate_sd_upscale\scripts\ultimate-upscale.py", line 4, in <module>
    from modules import processing, shared, images, devices, scripts
ImportError: cannot import name 'devices' from 'modules' (E:\ComfyUI\ComfyUI\custom_nodes\comfyui-reactor-node\modules\__init__.py)

Cannot import E:\ComfyUI\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale module for custom nodes: cannot import name 'devices' from 'modules' (E:\ComfyUI\ComfyUI\custom_nodes\comfyui-reactor-node\modules\__init__.py)

Tried re-installing but still fails to load.

Thank you

gonzalu commented 8 months ago

Seems that installing "reactor" breaks USDU :(

It is working after uninstalling Reactor

https://github.com/Gourieff/comfyui-reactor-node

ssitu commented 8 months ago

I am aware of this conflict. Surprisingly, I can load both without problems. What Python version are you using with ComfyUI?

gonzalu commented 8 months ago

If it helps, here is the startup info

E:\ComfyUI>.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build
** ComfyUI startup time: 2024-03-03 20:22:50.417324
** Platform: Windows
** Python version: 3.11.6 (tags/v3.11.6:8b6ee5b, Oct  2 2023, 14:57:12) [MSC v.1935 64 bit (AMD64)]
** Python executable: E:\ComfyUI\python_embeded\python.exe
** Log path: E:\ComfyUI\comfyui.log
[Maras IT] Initialization

Prestartup times for custom nodes:
   0.0 seconds: E:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Marigold
   0.0 seconds: E:\ComfyUI\ComfyUI\custom_nodes\rgthree-comfy
   0.0 seconds: E:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-MarasIT-Nodes
   0.1 seconds: E:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Manager

Total VRAM 24575 MB, total RAM 65478 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3090 : cudaMallocAsync
VAE dtype: torch.bfloat16
Using pytorch cross attention
BigUncle commented 8 months ago

It is likely that this project did not update the submodule: https://github.com/Coyote-A/ultimate-upscale-for-automatic1111

You can try my commit of this forked repo, https://github.com/BigUncle/ComfyUI_UltimateSDUpscale ,to see if it can be solved.

Or you enter this directory custom_nodes/ComfyUI_UltimateSDUpscale in the command line, and then run git submodule update --init --recursive

6sixteen commented 8 months ago

My Python version is 3.11. And the promblem is the modules is still from reactor module when import modules

from modules import processing, shared, images, devices, scripts 
from modules.processing import StableDiffusionProcessing
from modules.processing import Processed
from modules.shared import opts, state
from enum import Enum

And these code may not make sense

for module in modules_used:
    if module in sys.modules:
        original_imported_modules[module] = sys.modules.pop(module)

Maybe just change 'modules' (it successes) And I'm happy to know the reason.

mashiye commented 8 months ago

the same issue

Sarimae commented 8 months ago

Same issue: File "E:\ComfyUI\ComfyUI\nodes.py", line 1888, in load_custom_node module_spec.loader.exec_module(module) File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "E:\ComfyUI\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale__init.py", line 24, in from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS File "E:\ComfyUI\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale\nodes.py", line 5, in from usdu_patch import usdu File "E:\ComfyUI\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale\usdu_patch.py", line 2, in from repositories import ultimate_upscale as usdu File "E:\ComfyUI\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale\repositories__init__.py", line 14, in spec.loader.exec_module(ultimate_upscale) File "E:\ComfyUI\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale\repositories\ultimate_sd_upscale\scripts\ultimate-upscale.py", line 4, in from modules import processing, shared, images, devices, scripts ImportError: cannot import name 'devices' from 'modules' (E:\ComfyUI\ComfyUI\custom_nodes\comfyui-reactor-node\modules\init__.py)

Cannot import E:\ComfyUI\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale module for custom nodes: cannot import name 'devices' from 'modules' (E:\ComfyUI\ComfyUI\custom_nodes\comfyui-reactor-node\modules__init__.py) E:\ComfyUI\python_embeded\Lib\site-packages_distutils_hack__init__.py:26: UserWarning: Setuptools is replacing distutils.

Sarimae commented 8 months ago

tried reinstalling per git, tried updating, fixing from inside comfy and git, no success

ssitu commented 8 months ago

Does this still happen?