Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ddPn08 committed Dec 20, 2022
1 parent bd69b5b commit bfdeb5f
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions automatic1111.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@
"# @markdown  \n",
"# @markdown ## Command line arguments\n",
"\n",
"import os\n",
"\n",
"no_half = False # @param {type:\"boolean\"}\n",
"no_half_vae = False # @param {type:\"boolean\"}\n",
"allow_code = False # @param {type:\"boolean\"}\n",
Expand Down Expand Up @@ -239,15 +241,15 @@
"if os.path.exists(f\"{data_dir}/ngrok.txt\") and use_ngrok:\n",
" with open(f\"{data_dir}/ngrok.txt\", mode=\"r\") as f:\n",
" lines = f.readlines()\n",
" if not ngrok_auth_token:\n",
" ngrok_auth_token = lines[0]\n",
" if ngrok_region == \"auto\":\n",
" ngrok_region = lines[1]\n",
" if not ngrok_auth_token and len(lines) > 0:\n",
" ngrok_auth_token = lines[0].strip()\n",
" if ngrok_region == \"auto\" and len(lines) > 1:\n",
" ngrok_region = lines[1].strip()\n",
"\n",
"with open(f\"{data_dir}/ngrok.txt\", mode=\"w\") as f:\n",
" f.write(f\"{ngrok_auth_token}\\n{ngrok_region}\")\n",
"\n",
"if ngrok_region == \"auto\":\n",
"if not ngrok_region or ngrok_region == \"auto\":\n",
" ngrok_region = \"us\"\n",
"\n",
"# @markdown  \n",
Expand All @@ -274,16 +276,13 @@
"vars = \" \".join(advanced_options)\n",
"if not use_ngrok:\n",
" vars += \" --share\"\n",
"else:\n",
"elif ngrok_auth_token and ngrok_region:\n",
" vars += f\" --ngrok {ngrok_auth_token} --ngrok-region {ngrok_region}\"\n",
"\n",
"if use_gradio_auth:\n",
" vars += f\" --gradio-auth {gradio_auth_username}:{gradio_auth_password}\"\n",
"\n",
"\n",
"import os\n",
"\n",
"os.environ['COMMANDLINE_ARGS'] = f\"{vars} {custom_arguments}\"\n"
"os.environ['COMMANDLINE_ARGS'] = f\"{vars} {custom_arguments}\""
]
},
{
Expand Down

0 comments on commit bfdeb5f

Please sign in to comment.