fix logs
parent
ee4a820465
commit
a657689c10
|
|
@ -83,11 +83,14 @@ class ComfyApp:
|
|||
with open(file, "r") as file:
|
||||
cur_prompt_id = file.read().strip()
|
||||
if cur_prompt_id:
|
||||
sys.stdout.write(f"{self.name}-prompt-{cur_prompt_id}: {line}")
|
||||
logger.info(f"{self.name}-prompt-{cur_prompt_id}: {line.strip()}")
|
||||
# sys.stdout.write(f"{self.name}-prompt-{cur_prompt_id}: {line}")
|
||||
else:
|
||||
sys.stdout.write(f"{self.name}: {line}")
|
||||
logger.info(f"{self.name}: {line.strip()}")
|
||||
# sys.stdout.write(f"{self.name}: {line}")
|
||||
else:
|
||||
sys.stdout.write(f"{self.name}: {line}")
|
||||
logger.info(f"{self.name}: {line.strip()}")
|
||||
# sys.stdout.write(f"{self.name}: {line}")
|
||||
|
||||
def start(self):
|
||||
cmd = ["python", "main.py",
|
||||
|
|
@ -101,14 +104,18 @@ class ComfyApp:
|
|||
|
||||
logger.info(f"Starting comfy app on {self.port}")
|
||||
logger.info(f"Command: {cmd}")
|
||||
try:
|
||||
self.process = subprocess.Popen(
|
||||
cmd,
|
||||
cwd=self.cwd,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
text=True
|
||||
)
|
||||
logger.info(f"Comfy app started with PID: {self.process.pid}")
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to start comfy app: {e}")
|
||||
|
||||
self.process = subprocess.Popen(
|
||||
cmd,
|
||||
cwd=self.cwd,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
text=True
|
||||
)
|
||||
os.environ['ALREADY_INIT'] = 'true'
|
||||
|
||||
self.stdout_thread = threading.Thread(target=self._handle_output, args=(self.process.stdout, "STDOUT"))
|
||||
|
|
@ -387,8 +394,8 @@ def start_comfy_servers():
|
|||
logger.info(f"start comfy server by device_id: {gpu_num}")
|
||||
port = start_port + gpu_num
|
||||
comfy_app = ComfyApp(host=LOCALHOST, port=port, device_id=gpu_num)
|
||||
comfy_app.start()
|
||||
available_apps.append(comfy_app)
|
||||
comfy_app.start()
|
||||
|
||||
|
||||
def get_available_app(need_check_busy: bool):
|
||||
|
|
|
|||
Loading…
Reference in New Issue