Upload 3 files
Browse files- README.md +14 -0
- __init__.py +31 -0
- requirements.txt +1 -0
README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ComfyUI-ngrok
|
| 2 |
+
Use ngrok to allow external access to ComfyUI.
|
| 3 |
+
|
| 4 |
+
*It is not a custom node.
|
| 5 |
+
|
| 6 |
+
## Installation:
|
| 7 |
+
|
| 8 |
+
1. Use `git clone https://github.com/pkpkTech/ComfyUI-ngrok` in your ComfyUI custom nodes directory
|
| 9 |
+
2. Use `pip install -r requirements.txt` in ComfyUI-ngrok directory
|
| 10 |
+
3. Open the __init__.py file in a text editor, replace None on line 12 with your ngrok Authtoken and save.
|
| 11 |
+
|
| 12 |
+
If the preparation is successful, you will find the URL in the console when you start ComfyUI.
|
| 13 |
+
|
| 14 |
+
If this does not work, adding `--enable-cors-header` to the ComfyUI execution argument may help.
|
__init__.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import ngrok
|
| 2 |
+
|
| 3 |
+
from comfy.cli_args import args
|
| 4 |
+
|
| 5 |
+
# #########################################################
|
| 6 |
+
# Replace None on the line below this with your Authtoken.
|
| 7 |
+
# Your Authtoken can be found at https://dashboard.ngrok.com/get-started/your-authtoken
|
| 8 |
+
# Don't forget to enclose it in quotation marks!
|
| 9 |
+
# Example:
|
| 10 |
+
# ngrok_token = "DuMMyTOk3n38ty38nhbvgjbb_HEhdpnojhrbdpnrmE0jt"
|
| 11 |
+
|
| 12 |
+
ngrok_token = 2luGDduz0L8Szz4ZlDpryiMiW0n_6ZP5THZWJ9ohyHWwtS2Wy
|
| 13 |
+
|
| 14 |
+
# #########################################################
|
| 15 |
+
|
| 16 |
+
print("### Load ngrok")
|
| 17 |
+
|
| 18 |
+
def connect():
|
| 19 |
+
# Connect if ngrok token is set
|
| 20 |
+
if ngrok_token is not None:
|
| 21 |
+
print("trying to connect ngrok...\n")
|
| 22 |
+
options = {"authtoken": ngrok_token, "session_metadata": "ComfyUI"}
|
| 23 |
+
|
| 24 |
+
try:
|
| 25 |
+
ngrok_url = ngrok.forward(f"{args.listen}:{args.port}", **options).url()
|
| 26 |
+
except Exception as e:
|
| 27 |
+
print("Failed to connect to ngrok.")
|
| 28 |
+
else:
|
| 29 |
+
print(f"\n\033[32m\033[1m##\n## Connection to ngrok established.\n##\n## URL: {ngrok_url}\n##\n\033[0m\033[0m")
|
| 30 |
+
|
| 31 |
+
connect()
|
requirements.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
ngrok
|