File size: 512 Bytes
8cd2170
 
 
6d974e6
8cd2170
 
6d85bdf
8cd2170
 
6d974e6
8cd2170
 
 
 
6d85bdf
8cd2170
 
6d85bdf
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import os
import subprocess

COMFYUI_PATH = "./ComfyUI"
PORT = 8000


def run_comfyui():
    """Launch ComfyUI with external access."""
    os.chdir(COMFYUI_PATH)
    print(f"🚀 Launching ComfyUI on port {PORT}...")

    subprocess.run(f"python main.py --listen 0.0.0.0 --port {PORT} --disable-auto-launch", shell=True)


if __name__ == "__main__":
    run_comfyui()
    print(
        f"Now run port-forwarding\nssh -L {PORT}:localhost:{PORT} root@[IP_ADDRESS] -p [RUNPOD_PORT] -i ~/.ssh/[PRIVATE_KEY_NAME]")