Giter VIP home page Giter VIP logo

comfyui-profiler's Introduction

ComfyUI Profiler

Calculate the execution time of all nodes.

Welcome to use my another ComfyUI extension: ComfyUI Browser.

Preview

comfyui_profiler.mov
image image

comfyui-profiler's People

Contributors

tzwm avatar amorano avatar comfy-pr-bot avatar cillyfly avatar

Stargazers

smallersoup avatar  avatar buggsi avatar 1NV1CTU5 avatar Nikolai avatar Gabriel Guerreiro avatar Robert avatar Noodles avatar Eris2025 avatar Mac avatar sweety pea@_@ avatar ZHUANG, WEI-HAO avatar  avatar  avatar  avatar  avatar Aklis avatar Dmitriy Kripakov avatar Kichinto avatar 万里 avatar 爱可可-爱生活 avatar gn0st1c avatar Steph Meslin-Weber avatar  avatar  avatar  avatar UglyStupidHonest avatar  avatar  avatar George S avatar Sam avatar zhaoqi avatar  avatar Patrick Armstrong avatar Tosh Velaga avatar small bird avatar BennyKok avatar  avatar  avatar Ryan Mesaros avatar  avatar  avatar  avatar  avatar  avatar Alexander Mitov avatar Hong Phuc Nguyen avatar Krtolica Vujadin avatar  avatar V avatar  avatar  avatar Akash Chowdhury avatar drbaph avatar Gurvan avatar Paragoner avatar Stanislav Ursache avatar Vivek Kumar Poddar avatar Dan Zavy avatar Ženja Cheskidova avatar Antonio Vaca Cozar avatar  avatar 倪谷戢 / Nichtprimzahl avatar  avatar ma8u avatar  avatar Zekaryas avatar toyxyz avatar mat1eo avatar Dickson avatar  avatar FengWen avatar s1p avatar Jefferson Phillips avatar  avatar laishi avatar makeitrad avatar Derek  avatar  avatar  avatar Mitch Not Mitchell avatar Ronan avatar Cesarkon avatar Faruk avatar  avatar  avatar chenxueqiang avatar Eric Rollei avatar  avatar Alex avatar Thales Fernandes avatar  avatar  avatar  avatar  avatar  avatar Daria Yakovleva avatar hehe-github-support avatar SUNNYS avatar Laminar Rainbow avatar

Watchers

 avatar Changyi Wan avatar  avatar

comfyui-profiler's Issues

requestola - seconds to minutes

if you see 276s for everything, you gotta mentally do the math to get minutes every time you look at one.

can you string replace the s, then divide the resulting number by 60, then add an m, and print that if the number of seconds is over 60?

so
32s if less than 60s
1.6m if its whatever that is in seconds.
etc.

may seem like a dumb request but some of us are not great at mental math.

KSampler stuck at 100% after installing this extension

Installing and enabling this extension rendered the KSampler unusable. It works but get stuck at 100% and never outputs the result.
Nothing gets loged to the terminal output.
Uninstalling the extension fixes the issue.

Induces error "asyncio.locks.Lock object...is bound to a different event loop"

This happened immediately after installing the node. We're in here:

  File "ComfyUI/custom_nodes/comfyui-profiler/__init__.py", line 27, in send_message
    await s.send_json('profiler', data)

Note that the Comfy-Dev-Utils package is installed and we're also inside that thing's profiler, it looks like. Perhaps they are incompatible?

0: 448x640 1 face, 3.4ms
0: 448x640 1 face, 3.4ms
Speed: 0.9ms preprocess, 3.4ms inference, 0.5ms postprocess per image at shape (1, 3, 448, 640)
Speed: 0.9ms preprocess, 3.4ms inference, 0.5ms postprocess per image at shape (1, 3, 448, 640)
Detailer: segment upscale for ((92.86456, 129.08794)) | crop region (278, 387) x 2.6464346796206093 -> (735, 1024)
Requested to load SDXL
Loading 1 new model
100%|██████████████████████████████████████████████████████████████████████████████████████████████| 50/50 [00:06<00:00,  7.16it/s]
#995 [FaceDetailer]: 7.52s
#987 [PreviewImage]: 0.01s
#988 [PreviewImage]: 0.01s
#957 [Image Batch]: 0.00s
#918 [PreviewImage]: 0.28s
Exception in thread Thread-4 (prompt_worker):
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "ComfyUI/main.py", line 111, in prompt_worker
    e.execute(item[2], prompt_id, item[3], item[4])
  File "ComfyUI/custom_nodes/ComfyUI-0246/utils.py", line 381, in new_func
    res_value = old_func(*final_args, **kwargs)
  File "ComfyUI/custom_nodes/comfyui-profiler/__init__.py", line 93, in new_prompt_executor_execute
    ret = exist_PromptExecutor_execute(self, prompt, prompt_id, extra_data=extra_data, execute_outputs=execute_outputs)
  File "ComfyUI/custom_nodes/rgthree-comfy/__init__.py", line 211, in rgthree_execute
    return self.rgthree_old_execute(*args, **kwargs)
  File "ComfyUI/execution.py", line 391, in execute
    self.success, error, ex = recursive_execute(self.server, prompt, self.outputs, output_node_id, extra_data, executed, prompt_id, self.outputs_ui, self.object_storage)
  File "ComfyUI/custom_nodes/ComfyUI-Dev-Utils/nodes/execution_time.py", line 32, in swizzle_origin_recursive_execute
    result = origin_recursive_execute(server, prompt, outputs, current_item, extra_data, executed, prompt_id,
  File "ComfyUI/custom_nodes/comfyui-profiler/__init__.py", line 65, in new_recursive_execute
    ret = exist_recursive_execute(server, prompt, outputs, current_item, extra_data, executed, prompt_id, outputs_ui, object_storage)
  File "ComfyUI/execution.py", line 134, in recursive_execute
    result = recursive_execute(server, prompt, outputs, input_unique_id, extra_data, executed, prompt_id, outputs_ui, object_storage)
  File "ComfyUI/custom_nodes/ComfyUI-Dev-Utils/nodes/execution_time.py", line 32, in swizzle_origin_recursive_execute
    result = origin_recursive_execute(server, prompt, outputs, current_item, extra_data, executed, prompt_id,
  File "ComfyUI/custom_nodes/comfyui-profiler/__init__.py", line 73, in new_recursive_execute
    asyncio.run(send_message({
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "ComfyUI/custom_nodes/comfyui-profiler/__init__.py", line 27, in send_message
    await s.send_json('profiler', data)
  File "ComfyUI/server.py", line 621, in send_json
    await send_socket_catch_exception(ws.send_json, message)
  File "ComfyUI/server.py", line 36, in send_socket_catch_exception
    await function(message)
  File "ComfyUI/venv/lib/python3.10/site-packages/aiohttp/web_ws.py", line 351, in send_json
    await self.send_str(dumps(data), compress=compress)
  File "ComfyUI/venv/lib/python3.10/site-packages/aiohttp/web_ws.py", line 335, in send_str
    await self._writer.send(data, binary=False, compress=compress)
  File "ComfyUI/venv/lib/python3.10/site-packages/aiohttp/http_websocket.py", line 729, in send
    await self._send_frame(message, WSMsgType.TEXT, compress)
  File "ComfyUI/venv/lib/python3.10/site-packages/aiohttp/http_websocket.py", line 644, in _send_frame
    message = await compressobj.compress(message)
  File "ComfyUI/venv/lib/python3.10/site-packages/aiohttp/compression_utils.py", line 71, in compress
    async with self._compress_lock:
  File "/usr/lib/python3.10/asyncio/locks.py", line 14, in __aenter__
    await self.acquire()
  File "/usr/lib/python3.10/asyncio/locks.py", line 106, in acquire
    fut = self._get_loop().create_future()
  File "/usr/lib/python3.10/asyncio/mixins.py", line 30, in _get_loop
    raise RuntimeError(f'{self!r} is bound to a different event loop')
RuntimeError: <asyncio.locks.Lock object at 0x7f110dce5f00 [locked]> is bound to a different event loop

Crash with comfyui-profiler

[profiler] #142 PreviewImage: 0.2367 seconds, total 13.0739 seconds(#141)
[profiler] #64 SaveImage: 0.4078 seconds, total 13.245 seconds(#141)
Prompt executed in 13.51 seconds
[rgthree] Using rgthree's optimized recursive execution.
Traceback (most recent call last):
File "C:\Users\anime\Documents\Coding\Stability Matrix\Data\Packages\ComfyUI\main.py", line 254, in
loop.run_until_complete(run(server, address=args.listen, port=args.port, verbose=not args.dont_print_server, call_on_start=call_on_start))
File "asyncio\base_events.py", line 649, in run_until_complete
File "C:\Users\anime\Documents\Coding\Stability Matrix\Data\Packages\ComfyUI\main.py", line 149, in run
await asyncio.gather(server.start(address, port, verbose, call_on_start), server.publish_loop())
File "C:\Users\anime\Documents\Coding\Stability Matrix\Data\Packages\ComfyUI\server.py", line 622, in publish_loop
await self.send(*msg)
File "C:\Users\anime\Documents\Coding\Stability Matrix\Data\Packages\ComfyUI\server.py", line 557, in send
await self.send_json(event, data, sid)
File "C:\Users\anime\Documents\Coding\Stability Matrix\Data\Packages\ComfyUI\server.py", line 608, in send_json
await send_socket_catch_exception(ws.send_json, message)
File "C:\Users\anime\Documents\Coding\Stability Matrix\Data\Packages\ComfyUI\server.py", line 36, in send_socket_catch_exception
await function(message)
File "C:\Users\anime\Documents\Coding\Stability Matrix\Data\Packages\ComfyUI\venv\lib\site-packages\aiohttp\web_ws.py", line 351, in send_json
await self.send_str(dumps(data), compress=compress)
File "C:\Users\anime\Documents\Coding\Stability Matrix\Data\Packages\ComfyUI\venv\lib\site-packages\aiohttp\web_ws.py", line 335, in send_str
await self._writer.send(data, binary=False, compress=compress)
File "C:\Users\anime\Documents\Coding\Stability Matrix\Data\Packages\ComfyUI\venv\lib\site-packages\aiohttp\http_websocket.py", line 729, in send
await self._send_frame(message, WSMsgType.TEXT, compress)
File "C:\Users\anime\Documents\Coding\Stability Matrix\Data\Packages\ComfyUI\venv\lib\site-packages\aiohttp\http_websocket.py", line 644, in _send_frame
message = await compressobj.compress(message)
File "C:\Users\anime\Documents\Coding\Stability Matrix\Data\Packages\ComfyUI\venv\lib\site-packages\aiohttp\compression_utils.py", line 71, in compress
async with self._compress_lock:
File "asyncio\locks.py", line 14, in aenter
File "asyncio\locks.py", line 106, in acquire
File "asyncio\mixins.py", line 30, in _get_loop
RuntimeError: <asyncio.locks.Lock object at 0x000001F21C304760 [unlocked, waiters:1]> is bound to a different event loop

An error occurred after the update COMFYUI

Whenever the workflow is imported, an error is reported, the missing node is no longer prompted, and the contained partial section stack is stacked on top of each other,The node becomes normal only after it is deleted
3e69decef25cc43df0dc768982d501ae

Error after KSampler execution.

I thought there was a problem with Comfyui, but it was with this extension. I get this error after KSampler execution:

Traceback (most recent call last): File "H:\ComfyUI_windows_portable\ComfyUI\main.py", line 241, in <module> loop.run_until_complete(run(server, address=args.listen, port=args.port, verbose=not args.dont_print_server, call_on_start=call_on_start)) File "asyncio\base_events.py", line 653, in run_until_complete File "H:\ComfyUI_windows_portable\ComfyUI\main.py", line 143, in run await asyncio.gather(server.start(address, port, verbose, call_on_start), server.publish_loop()) File "H:\ComfyUI_windows_portable\ComfyUI\server.py", line 627, in publish_loop await self.send(*msg) File "H:\ComfyUI_windows_portable\ComfyUI\server.py", line 562, in send await self.send_json(event, data, sid) File "H:\ComfyUI_windows_portable\ComfyUI\server.py", line 613, in send_json await send_socket_catch_exception(ws.send_json, message) File "H:\ComfyUI_windows_portable\ComfyUI\server.py", line 41, in send_socket_catch_exception await function(message) File "H:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\aiohttp\web_ws.py", line 352, in send_json await self.send_str(dumps(data), compress=compress) File "H:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\aiohttp\web_ws.py", line 336, in send_str await self._writer.send(data, binary=False, compress=compress) File "H:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\aiohttp\http_websocket.py", line 729, in send await self._send_frame(message, WSMsgType.TEXT, compress) File "H:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\aiohttp\http_websocket.py", line 644, in _send_frame message = await compressobj.compress(message) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "H:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\aiohttp\compression_utils.py", line 71, in compress async with self._compress_lock: File "asyncio\locks.py", line 15, in __aenter__ File "asyncio\locks.py", line 106, in acquire File "asyncio\mixins.py", line 20, in _get_loop RuntimeError: <asyncio.locks.Lock object at 0x000001E8A59BD290 [unlocked, waiters:1]> is bound to a different event loop

Crash when doing Ctrl+Z

When trying to undo with Ctrl+Z the extension causes an error which leads to the workflow being erased.
I already had my workflow erased twice, since it seems to reload some default workflow and overwrite the workflow with it...

please fix by changing this line (adding '?' to '_overwrite')
if (node.onDrawForeground?._overwrited) {

if (node.onDrawForeground._overwrited) {

thank you

Getting this error when trying to load a basic workflow

TypeError: Cannot read properties of undefined (reading '_overwrited')
Screenshot 2024-08-12 at 19 30 56

Workflow:
{"last_node_id":16,"last_link_id":16,"nodes":[{"id":6,"type":"EmptyLatentImage","pos":[1228,109],"size":{"0":315,"1":106},"flags":{},"order":0,"mode":0,"outputs":[{"name":"LATENT","type":"LATENT","links":[6],"shape":3}],"properties":{"Node name for S&R":"EmptyLatentImage"},"widgets_values":[512,512,1]},{"id":7,"type":"VAEDecode","pos":[2061,97],"size":{"0":210,"1":46},"flags":{},"order":7,"mode":0,"inputs":[{"name":"samples","type":"LATENT","link":7},{"name":"vae","type":"VAE","link":9,"slot_index":1}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[12],"shape":3,"slot_index":0}],"properties":{"Node name for S&R":"VAEDecode"}},{"id":9,"type":"VAELoader","pos":[1617,246],"size":[372.47609881882,58],"flags":{},"order":1,"mode":0,"outputs":[{"name":"VAE","type":"VAE","links":[9],"shape":3}],"properties":{"Node name for S&R":"VAELoader"},"widgets_values":["vae-ft-mse-840000-ema-pruned.safetensors"]},{"id":15,"type":"BNK_CLIPTextEncodeAdvanced","pos":[1135,831],"size":{"0":400,"1":200},"flags":{},"order":5,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":14}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[16],"shape":3}],"title":"CLIP Text Encode (Advanced) - NEGATIVE","properties":{"Node name for S&R":"BNK_CLIPTextEncodeAdvanced"},"widgets_values":["ugly, deformed","mean","compel"]},{"id":3,"type":"CheckpointLoaderSimple","pos":[789,389],"size":{"0":315,"1":98},"flags":{},"order":2,"mode":0,"outputs":[{"name":"MODEL","type":"MODEL","links":[1],"shape":3},{"name":"CLIP","type":"CLIP","links":[13,14],"shape":3,"slot_index":1},{"name":"VAE","type":"VAE","links":null,"shape":3}],"properties":{"Node name for S&R":"CheckpointLoaderSimple"},"widgets_values":["deliberate_v2.safetensors"]},{"id":2,"type":"KSampler","pos":[1618,389],"size":{"0":315,"1":262},"flags":{},"order":6,"mode":0,"inputs":[{"name":"model","type":"MODEL","link":1,"slot_index":0},{"name":"positive","type":"CONDITIONING","link":15,"slot_index":1},{"name":"negative","type":"CONDITIONING","link":16,"slot_index":2},{"name":"latent_image","type":"LATENT","link":6,"slot_index":3}],"outputs":[{"name":"LATENT","type":"LATENT","links":[7],"shape":3,"slot_index":0}],"properties":{"Node name for S&R":"KSampler"},"widgets_values":[515687388721624,"randomize",25,6,"dpmpp_2m","karras",1]},{"id":14,"type":"BNK_CLIPTextEncodeAdvanced","pos":[1134,552],"size":{"0":400,"1":200},"flags":{},"order":4,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":13}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[15],"shape":3}],"title":"CLIP Text Encode (Advanced) - POSITIVE","properties":{"Node name for S&R":"BNK_CLIPTextEncodeAdvanced"},"widgets_values":["(\"A dream of a distant galaxy, by Caspar David Friedrich, matte painting\", \"trending on artstation, HQ\").and()","mean","compel"]},{"id":12,"type":"PreviewImage","pos":[2341,255],"size":[550.953125,566.02734375],"flags":{},"order":8,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":12}],"properties":{"Node name for S&R":"PreviewImage"}},{"id":13,"type":"Show Metadata [Crystools]","pos":{"0":2356,"1":891,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0},"size":[527.3515625,304.8125],"flags":{"collapsed":false},"order":3,"mode":0,"inputs":[],"outputs":[],"title":"🪛 Show Metadata ","properties":{}}],"links":[[1,3,0,2,0,"MODEL"],[6,6,0,2,3,"LATENT"],[7,2,0,7,0,"LATENT"],[9,9,0,7,1,"VAE"],[12,7,0,12,0,"IMAGE"],[13,3,1,14,0,"CLIP"],[14,3,1,15,0,"CLIP"],[15,14,0,2,1,"CONDITIONING"],[16,15,0,2,2,"CONDITIONING"]],"groups":[],"config":{},"extra":{"ds":{"scale":1,"offset":[-737.83984375,50.8125]},"info":{"name":"workflow","author":"","description":"","version":"1","created":"2024-08-12T16:42:33.669Z","modified":"2024-08-12T17:08:10.662Z","software":"ComfyUI"},"workspace_info":{"id":"s-fF6wnqkkVOTOcRqrHOu","saveLock":false,"cloudID":null,"coverMediaPath":null}},"version":0.4}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.