Finalized for testing today

This commit is contained in:
TheUnfocused 2024-08-04 11:11:28 -07:00
parent e387600505
commit 5c6ae0be5b
6 changed files with 22 additions and 53 deletions

View File

@ -211,54 +211,6 @@
"\n", "\n",
"!python main.py --dont-print-server" "!python main.py --dont-print-server"
] ]
},
{
"cell_type": "markdown",
"metadata": {
"id": "kkkkkkkkkkkkkk"
},
"source": [
"### Run ComfyUI with localtunnel\n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "jjjjjjjjjjjjj"
},
"outputs": [],
"source": [
"!npm install -g localtunnel\n",
"\n",
"import subprocess\n",
"import threading\n",
"import time\n",
"import socket\n",
"import urllib.request\n",
"\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",
" print(\"\\nComfyUI finished loading, trying to launch localtunnel (if it gets stuck here localtunnel is having issues)\\n\")\n",
"\n",
" print(\"The password/enpoint ip for localtunnel is:\", urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\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 --dont-print-server"
]
} }
], ],
"metadata": { "metadata": {

View File

@ -2,7 +2,9 @@
echo "Make sure you set up your branch name in colab_runner.ipynb" echo "Make sure you set up your branch name in colab_runner.ipynb"
python3 -m venv .venv if ! [ -d "./.venv" ]; then
python3 -m venv .venv
fi
source .venv/bin/activate source .venv/bin/activate
python3 -m pip install pydrive python3 -m pip install pydrive
sudo python3 connect_to_colab.py sudo python3 connect_to_colab.py

View File

@ -1,4 +1,11 @@
#!/bin/bash #!/bin/bash
echo "Make sure you set up your branch name in colab_runner.ipynb" echo "Make sure you set up your branch name in colab_runner.ipynb"
python3 -m venv .venv && source .venv/bin/activate && python3 -m pip install pydrive && sudo python3 connect_to_colab.py && deactivate
if ! [ -d "./.venv" ]; then
python3 -m venv .venv
fi
source .venv/bin/activate
python3 -m pip install pydrive
sudo python3 connect_to_colab.py
deactivate

View File

@ -1,6 +1,8 @@
echo Make sure you set up your branch name in colab_runner.ipynb echo Make sure you set up your branch name in colab_runner.ipynb
python -m venv .venv IF NOT EXIST ".venv" (
python -m venv .venv
)
call .venv\Scripts\activate.bat call .venv\Scripts\activate.bat
python -m pip install pydrive python -m pip install pydrive
python connect_to_colab.py python connect_to_colab.py

View File

@ -4,4 +4,7 @@ echo "Make sure you set up your branch name in colab_runner.ipynb"
if ! [ -d "./.venv" ]; then if ! [ -d "./.venv" ]; then
python3 -m venv .venv python3 -m venv .venv
fi fi
source .venv/bin/activate && python3 -m pip install -r requirements.txt && python3 main.py --dont-print-server && deactivate source .venv/bin/activate
python3 -m pip install -r requirements.txt
python3 main.py --dont-print-server
deactivate

View File

@ -5,4 +5,7 @@ echo "Make sure you set up your branch name in colab_runner.ipynb"
if ! [ -d "./.venv"]; then if ! [ -d "./.venv"]; then
python3 -m venv .venv python3 -m venv .venv
fi fi
source .venv/bin/activate && python3 -m pip install -r requirements.txt && python3 main.py --dont-print-server && deactivate source .venv/bin/activate
python3 -m pip install -r requirements.txt
python3 main.py --dont-print-server
deactivate