ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

The generation is "running on another tab" but it isn't

Open warACEs opened this issue 9 months ago • 6 comments

I have been experimenting with ComfyUI for a few weeks, but recently I got a problem, when doing some generations, there comes a point where it says “Idle” and the error says that the generation is being done in another window, but I don't have any other window, and when looking at the console, it only says that the promt was executed in 0.01 sec. Do you know how to solve this or at least where I could find a solution?

warACEs avatar May 01 '24 18:05 warACEs

I'm seeing the same issue

Specifically, I see the bar at the top say: Running... in another tab. And then sometimes the comfyui just says crashed. I thought it was me not having enough resources but I doubled everything (cpu, mem, gpu) and the model still crashes when I press the queue prompt.

AnkilP avatar May 29 '24 06:05 AnkilP

Same here - keeps happening since a few days. One thing I notice is that some of my primitives with "increment" in control_after_generate stop incrementing.

Quasimondo avatar Jun 01 '24 12:06 Quasimondo

Actually I just realized that in my case this is probably caused by a primitive "INT" being limited to a max of 2048 (since that was the maximum returned by the node it is connected to) and since that value stops increasing after that there is no change which is why the prompt immediately returns. So maybe check if you have a similar situation where you think that something should change but actually doesn't. I actually believe the "running ... in another tab" message is a bit confusing.

Quasimondo avatar Jun 01 '24 12:06 Quasimondo

I keep having this issue now and it is driving me crazy, as I am going through deleting nodes until it starts working, restarting comfy every time.

Sometimes it seems I can delete a node causing it, run a generation, then revert to the workflow before I deleted the node, and it continues to work for a while then starts to fail again?!

Also if I have RGThree optimization running I get this error:

[rgthree] Using rgthree's optimized recursive execution.
[rgthree] First run patching recursive_output_delete_if_changed and recursive_will_execute.
[rgthree] Note: If execution seems broken due to forward ComfyUI changes, you can disable the optimization from rgthree settings in ComfyUI.
Exception in thread Thread-12 (prompt_worker):
Traceback (most recent call last):
  File "threading.py", line 1016, in _bootstrap_inner
  File "threading.py", line 953, in run
  File "C:\SDAI\ComfyUI\ComfyUI\main.py", line 111, in prompt_worker
    e.execute(item[2], prompt_id, item[3], item[4])
  File "C:\SDAI\ComfyUI\ComfyUI\custom_nodes\rgthree-comfy\__init__.py", line 211, in rgthree_execute
    return self.rgthree_old_execute(*args, **kwargs)
  File "C:\SDAI\ComfyUI\ComfyUI\execution.py", line 385, in execute
    to_execute = sorted(list(map(lambda a: (len(recursive_will_execute(prompt, self.outputs, a[-1], memo)), a[-1]), to_execute)))
  File "C:\SDAI\ComfyUI\ComfyUI\execution.py", line 385, in <lambda>
    to_execute = sorted(list(map(lambda a: (len(recursive_will_execute(prompt, self.outputs, a[-1], memo)), a[-1]), to_execute)))
  File "C:\SDAI\ComfyUI\ComfyUI\custom_nodes\rgthree-comfy\__init__.py", line 246, in rgthree_recursive_will_execute
    will_execute.add(len(will_execute_value))
OverflowError: cannot fit 'int' into an index-sized integer

Without that enabled, yeah I just get "Running in another Tab" even though I'm not, and it hangs.

gobshyte avatar Jun 09 '24 01:06 gobshyte

@gobshyte - Your issue looks like it's directly related to the sheer number of paths you have in your workflow and ComfyUI isn't able to process it through its len call; that must be a big workflow. It's not an rgthree-comfy issue, but the rgthree-comfy optimization lets you see the error; otherwise you'd probably be waiting around for like an hour to get the same error any.

Good news/bad news: I may be able to help you find a solution that avoids len call when you're using the rgthree-comfy optimization. The bad news is, assuming it does work, it's not fixable in the repo since it required the rgthree-comfy optimizaion (and comfyui never responded to that PR). Regardless, we can continue to discuss in https://github.com/rgthree/rgthree-comfy/issues/246 and see if it works.


For all the others, assuming the "running on another tab" you're mentioning is in the top progress bar, that progress bar is from rgthree-comfy. Unfortunately, the ComfyUI API communication between the backend and the browser is not always robust enough for the progress bar to know the current workflow is executing at the very first step. The "Running in another tab" is the best shot the progress bar has to tell you "the backend is definitely working, but it doesn't appear it's from this tab... yet." I guess could update that text to be more ambiguous, but it also sounds like perhaps your workflows are either crashing or have no changes and execute in 0.01s. WDYT?

rgthree avatar Jun 09 '24 18:06 rgthree

I get this when I set KSampler (advanced) control after generate variable to "fixed" -- doesn't happen on "random"

0000F8 avatar Jun 19 '24 00:06 0000F8

BTW, if someone is running this on a server or in anyway through nginx or any other proxy then please make sure to allow websockets connection. I am sure for pretty much everyone here it's a ws connection issue.

Step1 : Check your browser console for errors. If there are errors related to web socket (ws) then go ahead with my suggestion otherwise please disregard my comment.

Step2: Now that you know it's a ws connection issue. please cross check your networj proxy if any or any other network related configuration.

As for nginx given your requests are indeed going through nginx, make sure your configuration is something like - For me, I am running on port 8188 so please replace with your comfy ui port

location /ws {
                proxy_pass http://localhost:8188/ws;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "Upgrade";
                proxy_set_header Host $host;
        }
location / {
                proxy_pass http://localhost:8188;
}

manish-baghel avatar Jul 17 '24 17:07 manish-baghel

BTW, if someone is running this on a server or in anyway through nginx or any other proxy then please make sure to allow websockets connection. I am sure for pretty much everyone here it's a ws connection issue.

Step1 : Check your browser console for errors. If there are errors related to web socket (ws) then go ahead with my suggestion otherwise please disregard my comment.

Step2: Now that you know it's a ws connection issue. please cross check your networj proxy if any or any other network related configuration.

As for nginx given your requests are indeed going through nginx, make sure your configuration is something like - For me, I am running on port 8188 so please replace with your comfy ui port

location /ws {
                proxy_pass http://localhost:8188/ws;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "Upgrade";
                proxy_set_header Host $host;
        }
location / {
                proxy_pass http://localhost:8188;
}

this save my life. Thanks so much

ivanberry avatar Aug 22 '24 04:08 ivanberry