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

feat(ui): Deeplinks for StudioInitAction #7277

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

JanThomasUP
Copy link

Summary

This feature provides a way to link into specific elements of the UI. Utilizing InvokeAIUI component's StudioInitAction to be called trough a hashbang.

this way e.g.

loadWorkflow #!loadWorkflow&workflowId={WORKFOLW_ID}

will load the workflow WORKFOLW_ID

selectBoard #!loadWorkflow&selectBoard={BOARD_ID}

e.g. http://localhost:9090/#!selectBoard&boardId=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeee01
will select the board with id aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeee01

selectImage#!selectImage&imageName={IMG_NAME}

e.g. http://localhost:9090/#!selectImage&imageName=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeee02.png
will select the image aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeee02.png, also select the corresponding board and images/asset tab
NYI: needs some more work to be ready, also should be a seperate PR (in my optionion)

selectStylePreset #!selectStylePreset&stylePresetId={PRESET_ID}

e.g. http://localhost:9090/#!selectStylePreset&stylePresetId=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeee03
will select the preset with ID aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeee03

sendToCanvas #!sendToCanvas&imageName={IMG_NAME}

e.g. http://localhost:9090/#!sendToCanvas&imageName=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeee04.png
will setup a canvas where the given image (aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeee04.png) is added as a raster layer

useAllParameters #!useAllParameters&imageName={IMG_NAME}

e.g. http://localhost:9090/#!useAllParameters&imageName=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeee05.png
will load all parameters of the given image aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeee05.png

goToDestination

canvas #!goToDestination&destination=canvas

Go to the canvas tab, close the image viewer, and disable send-to-gallery mode

generation #!goToDestination&destination=generation

Go to the canvas tab, open the image viewer, and enable send-to-gallery mode

upscaling #!goToDestination&destination=upscaling

Go to the upscaling tab

workflows #!goToDestination&destination=workflows

will navigate to workflows

viewAllWorkflows #!goToDestination&destination=viewAllWorkflows

Go to the workflows tab and open the workflow library modal

viewAllStylePresets #!goToDestination&destination=viewAllStylePresets

Go to the canvas tab and open the style presets menu

Related Issues / Discussions

Discussed with @psychedelicious starting here on Discord

QA Instructions

For now the action will only executed on startup. So a reload is needed. To test, you can edit the hash part of the URL or navigate to them by pasting them into the URL. Right now there is no history change event so if edited manually (or changed on site) you will need to reload the page.

Merge Plan

Please take into consideration: This PR contains some change to the InvokeAIUI.tsx - as minimal as possible but still the parent of all that follows. The type definitions of the StudioInitAction are now zod schemas to validate them.

e.g.: http://localhost:9090/#!useAllParameter&imageName={image-hash}.png will result in a startup using all parameters of that Image
…brary

comments of the original removed.
This enables the address to have a hash without trowing the system off.
selectBoard now a StudioInitAction
optional hashbang clear on fill
@github-actions github-actions bot added the frontend PRs that change frontend files label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend PRs that change frontend files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant