Skip to content

Make selected tab configurable with UI config#9159

Merged
AUTOMATIC1111 merged 2 commits into
AUTOMATIC1111:devfrom
space-nuko:ui-config-tabs
Apr 29, 2023
Merged

Make selected tab configurable with UI config#9159
AUTOMATIC1111 merged 2 commits into
AUTOMATIC1111:devfrom
space-nuko:ui-config-tabs

Conversation

@space-nuko

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

Copy link
Copy Markdown
Contributor

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
Copy Markdown

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
Copy Markdown
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