Skip to content

Commit

Permalink
fix: workflow hanging
Browse files Browse the repository at this point in the history
  • Loading branch information
larme committed Nov 11, 2024
1 parent d30f5ce commit cc58814
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/comfyui_idl/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import json
import logging
import os
import requests
import shutil
import subprocess
import tempfile
Expand All @@ -18,6 +19,13 @@
logger = logging.getLogger(__name__)


def _probe_comfyui_server():
url = 'http://127.0.0.1:8188/api/customnode/getmappings'
params = {'mode': 'nickname'}

_ = requests.get(url, params=params)


class WorkflowRunner:
"""
A class to manage and run ComfyUI workflows.
Expand Down Expand Up @@ -109,6 +117,7 @@ def start(self) -> None:
]
if subprocess.run(command, check=True):
self.is_running = True
_probe_comfyui_server()
logger.info("Successfully started ComfyUI in the background")
else:
logger.error("Failed to start ComfyUI in the background")
Expand Down

0 comments on commit cc58814

Please sign in to comment.