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

Make selected tab configurable with UI config #9159

Merged
merged 2 commits into from
Apr 29, 2023

Conversation

space-nuko
Copy link
Contributor

@space-nuko space-nuko commented Mar 29, 2023

Describe what this pull request is trying to achieve.

A way to have a tab selected on startup with the ui-config.json file.

You can have a line like this

    "webui/Tabs@tabs/selected": "img2img"

and it will set img2img as the default tab. Works with other tabs in the interface also.

Also accepts the numeric index of the tab to select, if it has no Gradio ID

Additional notes and description of your changes

Sets selected on gr.Tabs elements

gr.Tabs doesn't have a label like most Gradio components, so instead the elem_id was used as a config key

Environment this was tested in

List the environment you have developed / tested this on. As per the contributing page, changes should be able to work on Windows out of the box.

  • OS: Windows
  • Browser: Chrome
  • Graphics card: NVIDIA RTX 3090

Screenshots or videos of your changes
N/A

@CapsAdmin
Copy link

Related to this, if we could make it so that localhost:7860/img2img points to the img2img tab and is also appended when manually going to the img2img tab we could just bookmark the page itself.

You could also take it further to make use of query parameters to store and load state, but that's probably a bigger job.

@space-nuko
Copy link
Contributor Author

Related to this, if we could make it so that localhost:7860/img2img points to the img2img tab and is also appended when manually going to the img2img tab we could just bookmark the page itself.

Best submitted to Gradio as a feature request I think

@AUTOMATIC1111 AUTOMATIC1111 changed the base branch from master to dev April 29, 2023 14:42
@AUTOMATIC1111 AUTOMATIC1111 merged commit f685fe7 into AUTOMATIC1111:dev Apr 29, 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.

3 participants