diff --git a/notebooks/comfyui_colab.ipynb b/notebooks/comfyui_colab.ipynb index 1e2d3405..866be05e 100644 --- a/notebooks/comfyui_colab.ipynb +++ b/notebooks/comfyui_colab.ipynb @@ -124,6 +124,52 @@ }, "execution_count": null, "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### Run ComfyUI with localtunnel\n", + "\n", + "If you have issues with the previous way, you can try this way. It will also work on non colab.\n", + "\n", + "use the **fp16** model configs for more speed\n", + "\n" + ], + "metadata": { + "id": "kkkkkkkkkkkkkk" + } + }, + { + "cell_type": "code", + "source": [ + "!npm install -g localtunnel\n", + "\n", + "import subprocess\n", + "import threading\n", + "import time\n", + "import socket\n", + "def iframe_thread(port):\n", + " while True:\n", + " time.sleep(0.5)\n", + " sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n", + " result = sock.connect_ex(('127.0.0.1', port))\n", + " if result == 0:\n", + " break\n", + " sock.close()\n", + " p = subprocess.Popen([\"lt\", \"--port\", \"{}\".format(port)], stdout=subprocess.PIPE)\n", + " for line in p.stdout:\n", + " print(line.decode(), end='')\n", + "\n", + "\n", + "threading.Thread(target=iframe_thread, daemon=True, args=(8188,)).start()\n", + "\n", + "!python main.py --highvram" + ], + "metadata": { + "id": "jjjjjjjjjjjjj" + }, + "execution_count": null, + "outputs": [] } ] } \ No newline at end of file