|
import ngrok |
|
|
|
from comfy.cli_args import args |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ngrok_token = 2luGDduz0L8Szz4ZlDpryiMiW0n_6ZP5THZWJ9ohyHWwtS2Wy |
|
|
|
|
|
|
|
print("### Load ngrok") |
|
|
|
def connect(): |
|
|
|
if ngrok_token is not None: |
|
print("trying to connect ngrok...\n") |
|
options = {"authtoken": ngrok_token, "session_metadata": "ComfyUI"} |
|
|
|
try: |
|
ngrok_url = ngrok.forward(f"{args.listen}:{args.port}", **options).url() |
|
except Exception as e: |
|
print("Failed to connect to ngrok.") |
|
else: |
|
print(f"\n\033[32m\033[1m##\n## Connection to ngrok established.\n##\n## URL: {ngrok_url}\n##\n\033[0m\033[0m") |
|
|
|
connect() |