added a cli argument that skips creating a new browser window or tab

This commit is contained in:
Pete Myron 2023-05-03 22:27:29 -05:00
parent fcf513e0b6
commit 226f913ec1
4 changed files with 4 additions and 3 deletions

View File

@ -1,2 +1,2 @@
.\python_embeded\python.exe -s ComfyUI\main.py --cpu --windows-standalone-build
.\python_embeded\python.exe -s ComfyUI\main.py --cpu --windows-standalone-build %*
pause

View File

@ -1,2 +1,2 @@
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build %*
pause

View File

@ -11,6 +11,7 @@ parser.add_argument("--cuda-device", type=int, default=None, metavar="DEVICE_ID"
parser.add_argument("--dont-upcast-attention", action="store_true", help="Disable upcasting of attention. Can boost speed but increase the chances of black images.")
parser.add_argument("--force-fp32", action="store_true", help="Force fp32 (If this makes your GPU work better please report it).")
parser.add_argument("--directml", type=int, nargs="?", metavar="DIRECTML_DEVICE", const=-1, help="Use torch-directml.")
parser.add_argument("--disable-new-tab", type=bool, const = True, nargs="?", help="Disable creating a new browser window/tab when starting--reuse an existing browser tab.")
attn_group = parser.add_mutually_exclusive_group()
attn_group.add_argument("--use-split-cross-attention", action="store_true", help="Use the split cross attention optimization instead of the sub-quadratic one. Ignored when xformers is used.")

View File

@ -107,7 +107,7 @@ if __name__ == "__main__":
exit(0)
call_on_start = None
if args.windows_standalone_build:
if args.windows_standalone_build and not args.disable_new_tab:
def startup_server(address, port):
import webbrowser
webbrowser.open("http://{}:{}".format(address, port))