Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically open webui in browser when running "locally" #12254

Merged
merged 2 commits into from
Aug 8, 2023

Conversation

w-e-w
Copy link
Collaborator

@w-e-w w-e-w commented Aug 2, 2023

Update

image

no --disable-auto-autolaunch


Description

Automatically open webui in system browser when user is running "locally"

if (--listen or --share or --ngrok) and --disable-auto-autolaunch is NOT used, automatically open webui in browser
new arg --disable-auto-autolaunch for disabling this behavior

a ease of use for new users that my mistakenly think thatwebui is not launched
example #12251

--autolaunch behavior not changed, it will still launch in browser even if auto autolaunch it's not triggered

I think the auto autolaunch logic covers most users use case
but ther might be a group of people that launch web UI in normal browser mode with API enabled
but don't want to open in browser as they interact with you are back and primarily through API
that might be annoyed by this, this group of people would need to use --disable-auto-autolaunch
I assume that this group of user is the minority and are advanced users

Checklist:

@w-e-w w-e-w changed the title auto autolaunch Automatically autolaunch webui in browser if running "locally" Aug 2, 2023
@w-e-w w-e-w changed the title Automatically autolaunch webui in browser if running "locally" Automatically open webui in browser if running "locally" Aug 2, 2023
@w-e-w w-e-w changed the title Automatically open webui in browser if running "locally" Automatically open webui in browser when running "locally" Aug 2, 2023
@AUTOMATIC1111
Copy link
Owner

Make disabling it a UI setting rather than commandline arg ("Automatically open browser if running locally", on by default).

The condition is crowded. Maybe:

if opts.auto_autolaunch and not any([cmd_opts.listen or cmd_opts.share or cmd_opts.ngrok]):
    cmd_opts.autolaunch = True

before launch()?

@w-e-w
Copy link
Collaborator Author

w-e-w commented Aug 7, 2023

ok, I will add the setting to the UI
in face I initially did consider doing that

but similar to logic to disabling extensions, I believe there are use cases that will be more convenient for this behavior to be controllable val arg

like use we might constantly relaunching webui and it sometimes becomes a nuisance
but other times it's also convenient for it to Auto launch

so it is more convenient than this behavior is controllable by a areg as opposed to switching between two configs

I didn't put it in UI because I didn't want to duplicate the setting
but I suppose in this case there is merit in duplicate it

@w-e-w w-e-w marked this pull request as draft August 7, 2023 06:13
@w-e-w
Copy link
Collaborator Author

w-e-w commented Aug 7, 2023

I forgot about SD_WEBUI_RESTARTING so maybe arg not necessary

@w-e-w w-e-w force-pushed the auro-autolaunch branch 4 times, most recently from 0c43cf1 to b645381 Compare August 8, 2023 02:27
@w-e-w
Copy link
Collaborator Author

w-e-w commented Aug 8, 2023

image

@w-e-w w-e-w marked this pull request as ready for review August 8, 2023 02:40
@w-e-w
Copy link
Collaborator Author

w-e-w commented Aug 8, 2023

--autolaunch behavior is not change, it just a another way to specify the Remote option

if a user wish to disable auto launch regardless of option they can set SD_WEBUI_RESTARTING = 1

on the other hand if they wish to trigger Auto launch even when reloading or restarting they can set SD_WEBUI_RESTARTING = 0 (any thing non 1)

@AUTOMATIC1111 AUTOMATIC1111 merged commit 902f8cf into dev Aug 8, 2023
6 checks passed
@AUTOMATIC1111 AUTOMATIC1111 deleted the auro-autolaunch branch August 8, 2023 03:44
@w-e-w w-e-w mentioned this pull request Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants