feat(invoke): "Use as Ref Image" button + resilient auth fallback#220
Merged
feat(invoke): "Use as Ref Image" button + resilient auth fallback#220
Conversation
Adds a third button to the InvokeAI metadata drawer that uploads the current image to InvokeAI and sets it as a reference image parameter, without resetting any other generation parameters. Also reworks the JWT auth flow so PhotoMap stays in sync with InvokeAI when it is switched between single-user and multi-user modes: the first request always uses whatever token is cached (or none), a 401 triggers a login + retry with Bearer, and a 403 received with a token in hand triggers an anonymous retry and discards the stale cache. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /api/v1/images/uploadand then calls/api/v1/recall/{queue_id}withreference_images: [{image_name}]. The recall call intentionally omitsstrict=trueso other parameters already set in InvokeAI are preserved.show_recall_buttons, so none render when no InvokeAI URL is configured.Test plan
pytest tests/backend— 107 pass, including 5 new auth-fallback tests (test_invoke_router.py).npm test— 233 pass, including newsendUseRefImage+ button-click tests.ruff check photomap tests— clean.npm run lint+npm run format:check— clean.🤖 Generated with Claude Code