mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-08-24 08:44:27 +08:00
frp params
This commit is contained in:
parent
fee1fd8963
commit
3ac71aaa09
21
main.py
21
main.py
@ -144,18 +144,23 @@ def trigger_vercel_deploy():
|
|||||||
except requests.exceptions.RequestException as req_err:
|
except requests.exceptions.RequestException as req_err:
|
||||||
print(f"An error occurred: {req_err}")
|
print(f"An error occurred: {req_err}")
|
||||||
|
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
def start_frp():
|
||||||
|
# !cat /kaggle/working/frpc.toml
|
||||||
|
# subprocess.Popen(["sed", "-i", f"s/8188/{port}/g", "/kaggle/working/frpc.toml"],shell=False)
|
||||||
|
subprocess.run(['chmod', '+x', '/kaggle/working/frpc'], check=True)
|
||||||
|
time.sleep(3)
|
||||||
|
subprocess.Popen(['/kaggle/working/frpc', '-c', '/kaggle/working/frpc.toml'])
|
||||||
|
print(f'frp已经启动')
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
start_frp()
|
||||||
# 向 Notion 数据库插入记录:目前使用的frp服务商
|
# frp_remote_port_idx: 3, 4, 5, 6....
|
||||||
if args.frp_remote_port_idx is not None:
|
if args.frp_remote_port_idx is not None:
|
||||||
if str(args.frp_remote_port_idx) == "5":
|
notion.add_record_to_notion_database(f"http://111.170.148.226:2166{args.frp_remote_port_idx}/")
|
||||||
notion.add_record_to_notion_database(f"http://111.170.148.226:21665/")
|
|
||||||
if str(args.frp_remote_port_idx) == "6":
|
|
||||||
notion.add_record_to_notion_database(f"http://111.170.148.226:21666/")
|
|
||||||
else:
|
else:
|
||||||
notion.add_record_to_notion_database("http://111.170.148.226:21663/")
|
print("frp_remote_port_idx is None, no records will be added to notion database")
|
||||||
notion.add_record_to_notion_database("http://111.170.148.226:21664/")
|
|
||||||
|
|
||||||
print("disable_trigger_vercel_deploy: ", args.disable_trigger_vercel_deploy)
|
print("disable_trigger_vercel_deploy: ", args.disable_trigger_vercel_deploy)
|
||||||
if args.disable_trigger_vercel_deploy is None:
|
if args.disable_trigger_vercel_deploy is None:
|
||||||
|
|||||||
@ -112,7 +112,7 @@ cd /kaggle/ComfyUI
|
|||||||
|
|
||||||
REMOTE_PORT="$1"
|
REMOTE_PORT="$1"
|
||||||
|
|
||||||
# 传入参数1,2... 这样便于扩展,如果以后用了其他的frp,也好调整。
|
# 传入参数3,4,5,... 这样便于扩展,如果以后用了其他的frp,也好调整。
|
||||||
|
|
||||||
# frp execution binary only. 这里放frpc执行文件,如果版本有变也好改。配置文件模版,也在项目中, 模版文件名为template_frpc
|
# frp execution binary only. 这里放frpc执行文件,如果版本有变也好改。配置文件模版,也在项目中, 模版文件名为template_frpc
|
||||||
wget -O /kaggle/working/frp_0.54.0_linux_amd64.tar.gz https://github.com/fatedier/frp/releases/download/v0.54.0/frp_0.54.0_linux_amd64.tar.gz
|
wget -O /kaggle/working/frp_0.54.0_linux_amd64.tar.gz https://github.com/fatedier/frp/releases/download/v0.54.0/frp_0.54.0_linux_amd64.tar.gz
|
||||||
@ -123,9 +123,9 @@ cp -p /kaggle/ComfyUI/template_frpc /kaggle/working/frpc.toml
|
|||||||
# 1, 2 主要是为了兼容之前的comfyUI notebook(不想一个一个的去修改了)
|
# 1, 2 主要是为了兼容之前的comfyUI notebook(不想一个一个的去修改了)
|
||||||
FRP_CONFIG_FILE="/kaggle/working/frpc.toml"
|
FRP_CONFIG_FILE="/kaggle/working/frpc.toml"
|
||||||
CHOICE="$1"
|
CHOICE="$1"
|
||||||
if [ "$CHOICE" -eq 1 ]; then
|
if [ "$CHOICE" -eq 3 ]; then
|
||||||
TARGET_REMOTE_PORT="21663"
|
TARGET_REMOTE_PORT="21663"
|
||||||
elif [ "$CHOICE" -eq 2 ]; then
|
elif [ "$CHOICE" -eq 4 ]; then
|
||||||
TARGET_REMOTE_PORT="21664"
|
TARGET_REMOTE_PORT="21664"
|
||||||
|
|
||||||
elif [ "$CHOICE" -eq 5 ]; then
|
elif [ "$CHOICE" -eq 5 ]; then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user