comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
58.73k stars 6.23k forks source link

Queueing fails with "RecursionError: maximum recursion depth exceeded" #2182

Open FaRihr opened 12 months ago

FaRihr commented 12 months ago

This is the error I got. Just ran a Comfy update and restarted the server, now this.

got prompt
Exception in thread Thread-21 (prompt_worker):
Traceback (most recent call last):
  File "threading.py", line 1045, in _bootstrap_inner
  File "threading.py", line 982, in run
  File "D:\stable-diffusion\comfy\ComfyUI\main.py", line 105, in prompt_worker
    e.execute(item[2], prompt_id, item[3], item[4])
  File "D:\stable-diffusion\comfy\ComfyUI\custom_nodes\rgthree-comfy\__init__.py", line 168, in rgthree_execute
    return self.old_execute(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\stable-diffusion\comfy\ComfyUI\execution.py", line 371, in execute
    to_execute = sorted(list(map(lambda a: (len(recursive_will_execute(prompt, self.outputs, a[-1])), a[-1]), to_execute)))
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\stable-diffusion\comfy\ComfyUI\execution.py", line 371, in <lambda>
    to_execute = sorted(list(map(lambda a: (len(recursive_will_execute(prompt, self.outputs, a[-1])), a[-1]), to_execute)))
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\stable-diffusion\comfy\ComfyUI\custom_nodes\rgthree-comfy\__init__.py", line 190, in rgthree_recursive_will_execute
    will_execute_value = execution.recursive_will_execute(prompt, outputs, input_unique_id, *args, **kwargs)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\stable-diffusion\comfy\ComfyUI\custom_nodes\rgthree-comfy\__init__.py", line 190, in rgthree_recursive_will_execute
    will_execute_value = execution.recursive_will_execute(prompt, outputs, input_unique_id, *args, **kwargs)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\stable-diffusion\comfy\ComfyUI\custom_nodes\rgthree-comfy\__init__.py", line 190, in rgthree_recursive_will_execute
    will_execute_value = execution.recursive_will_execute(prompt, outputs, input_unique_id, *args, **kwargs)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  [Previous line repeated 988 more times]
  File "D:\stable-diffusion\comfy\ComfyUI\custom_nodes\rgthree-comfy\__init__.py", line 174, in rgthree_recursive_will_execute
    will_execute = RgthreePatchRecursiveExecute_Set_patch_recursive_execution_to_false_if_not_working(unique_id)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RecursionError: maximum recursion depth exceeded

Oh, and this is the error if I deactivate the rgthree patching:

got prompt
Exception in thread Thread-5 (prompt_worker):
Traceback (most recent call last):
  File "threading.py", line 1045, in _bootstrap_inner
  File "threading.py", line 982, in run
  File "D:\stable-diffusion\comfy\ComfyUI\main.py", line 105, in prompt_worker
    e.execute(item[2], prompt_id, item[3], item[4])
  File "D:\stable-diffusion\comfy\ComfyUI\execution.py", line 371, in execute
    to_execute = sorted(list(map(lambda a: (len(recursive_will_execute(prompt, self.outputs, a[-1])), a[-1]), to_execute)))
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\stable-diffusion\comfy\ComfyUI\execution.py", line 371, in <lambda>
    to_execute = sorted(list(map(lambda a: (len(recursive_will_execute(prompt, self.outputs, a[-1])), a[-1]), to_execute)))
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\stable-diffusion\comfy\ComfyUI\execution.py", line 211, in recursive_will_execute
    will_execute += recursive_will_execute(prompt, outputs, input_unique_id)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\stable-diffusion\comfy\ComfyUI\execution.py", line 211, in recursive_will_execute
    will_execute += recursive_will_execute(prompt, outputs, input_unique_id)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\stable-diffusion\comfy\ComfyUI\execution.py", line 211, in recursive_will_execute
    will_execute += recursive_will_execute(prompt, outputs, input_unique_id)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  [Previous line repeated 991 more times]
RecursionError: maximum recursion depth exceeded
ltdrdata commented 12 months ago

Is your workflow huge? If not, attach the workflow you are using.

FaRihr commented 12 months ago

workflow.json Here's the workflow, not big at all, as I'm still learning. Funnily enough, when I removed the Controlnet stacks (they weren't muted before), it now took the prompt and started generating, but now I have a weird new error. All of a sudden it stops the flow and the "Reconnecting..." popup appears, here's the log:

D:\stable-diffusion\comfy>.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build
** ComfyUI start up time: 2023-12-05 09:15:40.796952

Prestartup times for custom nodes:
   0.0 seconds: D:\stable-diffusion\comfy\ComfyUI\custom_nodes\rgthree-comfy
   0.0 seconds: D:\stable-diffusion\comfy\ComfyUI\custom_nodes\ComfyUI-Manager

Total VRAM 12282 MB, total RAM 32530 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 4070 Ti : cudaMallocAsync
VAE dtype: torch.bfloat16
Using pytorch cross attention
### Loading: ComfyUI-Impact-Pack (V4.38.1)
### Loading: ComfyUI-Impact-Pack (Subpack: V0.3.2)
### Loading: ComfyUI-Manager (V1.6.4)
### ComfyUI Revision: 1779 [9b655d4f] | Released on '2023-12-04'
Comfyroll Custom Nodes: Loaded
[comfyui_controlnet_aux] | INFO -> Using ckpts path: D:\stable-diffusion\comfy\ComfyUI\custom_nodes\comfyui_controlnet_aux\ckpts
[comfyui_controlnet_aux] | INFO -> Using symlinks: False
[comfyui_controlnet_aux] | INFO -> Using ort providers: ['CUDAExecutionProvider', 'DirectMLExecutionProvider', 'OpenVINOExecutionProvider', 'ROCMExecutionProvider', 'CPUExecutionProvider']
D:\stable-diffusion\comfy\ComfyUI\custom_nodes\comfyui_controlnet_aux\node_wrappers\dwpose.py:25: UserWarning: DWPose: Onnxruntime not found or doesn't come with acceleration providers, switch to OpenCV with CPU device. DWPose might run very slowly
  warnings.warn("DWPose: Onnxruntime not found or doesn't come with acceleration providers, switch to OpenCV with CPU device. DWPose might run very slowly")
Efficiency Nodes: Attempting to add Control Net options to the 'HiRes-Fix Script' Node (comfyui_controlnet_aux add-on)...Success!

[rgthree] Loaded 18 exciting nodes.

WAS Node Suite: OpenCV Python FFMPEG support is enabled
WAS Node Suite Warning: `ffmpeg_bin_path` is not set in `D:\stable-diffusion\comfy\ComfyUI\custom_nodes\was-node-suite-comfyui\was_suite_config.json` config file. Will attempt to use system ffmpeg binaries if available.
WAS Node Suite: Finished. Loaded 197 nodes successfully.

        "Art is the triumph over chaos." - John Cheever

Import times for custom nodes:
   0.0 seconds: D:\stable-diffusion\comfy\ComfyUI\custom_nodes\sdxl-recommended-res-calc
   0.0 seconds: D:\stable-diffusion\comfy\ComfyUI\custom_nodes\comfyui-fitsize
   0.0 seconds: D:\stable-diffusion\comfy\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale
   0.0 seconds: D:\stable-diffusion\comfy\ComfyUI\custom_nodes\rgthree-comfy
   0.0 seconds: D:\stable-diffusion\comfy\ComfyUI\custom_nodes\efficiency-nodes-comfyui
   0.0 seconds: D:\stable-diffusion\comfy\ComfyUI\custom_nodes\Derfuu_ComfyUI_ModdedNodes
   0.0 seconds: D:\stable-diffusion\comfy\ComfyUI\custom_nodes\ComfyUI_essentials
   0.0 seconds: D:\stable-diffusion\comfy\ComfyUI\custom_nodes\ComfyUI_Comfyroll_CustomNodes
   0.3 seconds: D:\stable-diffusion\comfy\ComfyUI\custom_nodes\comfyui-dynamicprompts
   0.3 seconds: D:\stable-diffusion\comfy\ComfyUI\custom_nodes\ComfyUI-Manager
   0.3 seconds: D:\stable-diffusion\comfy\ComfyUI\custom_nodes\comfyui_controlnet_aux
   0.4 seconds: D:\stable-diffusion\comfy\ComfyUI\custom_nodes\ComfyUI-Impact-Pack
   1.2 seconds: D:\stable-diffusion\comfy\ComfyUI\custom_nodes\was-node-suite-comfyui

Starting server

To see the GUI go to: http://127.0.0.1:8188
FETCH DATA from: D:\stable-diffusion\comfy\ComfyUI\custom_nodes\ComfyUI-Manager\extension-node-map.json
got prompt
New prompt: Photo of a cat wearing sunglasses and a leather jacket while sitting on a motorbike
Requested to load SDXLClipModel
Loading 1 new model
Requested to load SDXLClipModel
Loading 1 new model
----------------------------------------
Eff. Loader SDXL Models Cache:
Ckpt:
  [1] RealVisXL
Refn:
  [1] RealVisXL
Lora:
  [1] base_ckpt: RealVisXL
      lora(mod,clip): PolyhedronDetails(0.6,0.6)
Requested to load AutoencoderKL
Loading 1 new model
Requested to load SDXL
Loading 1 new model
100%|██████████████████████████████████████████████████████████████████████████████████████| 28/28 [00:07<00:00,  3.61it/s]
Requested to load SDXL
Loading 1 new model

D:\stable-diffusion\comfy>pause
Drücken Sie eine beliebige Taste...

The last sentence states "Push any button...", upon doing so the log window simply closes itself.