add: open webbrowser when server got started

This commit is contained in:
Noxy 2025-08-27 18:23:37 +03:00 committed by GitHub
parent 88aee596a3
commit b51bfaf4e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,6 +21,7 @@ from io import BytesIO
import aiohttp
from aiohttp import web
import logging
import webbrowser
import mimetypes
from comfy.cli_args import args
@ -943,6 +944,7 @@ class PromptServer():
port = addr[1]
site = web.TCPSite(runner, address, port, ssl_context=ssl_ctx)
await site.start()
webbrowser.open(f"{scheme}://{address}:{port}")
if not hasattr(self, 'address'):
self.address = address #TODO: remove this