Skip to content

feat(invoke): show "Use as Ref Image" button for any image when InvokeAI is configured#221

Merged
lstein merged 1 commit intomasterfrom
lstein/feature/use-ref-for-any-image
Apr 19, 2026
Merged

feat(invoke): show "Use as Ref Image" button for any image when InvokeAI is configured#221
lstein merged 1 commit intomasterfrom
lstein/feature/use-ref-for-any-image

Conversation

@lstein
Copy link
Copy Markdown
Owner

@lstein lstein commented Apr 19, 2026

Summary

  • The "Use as Ref Image" button only needs the image file itself (it uploads the file and asks InvokeAI to use it as a reference) — it doesn't need any recallable generation parameters in the image metadata.
  • So it is now exposed from every metadata-drawer path whenever an InvokeAI backend URL is configured: EXIF-only images, images with no metadata at all, scalar-only custom-workflow InvokeAI images, and images whose Invoke metadata fails to parse.
  • The Recall / Remix buttons still require recallable Invoke parameters and remain gated on a successful parse — only the standalone use-ref button follows this broader rule.

Implementation notes

  • Extracted the single-button markup into _USE_REF_BUTTON_HTML and added a public use_ref_button_html() helper that wraps it in its own .invoke-recall-controls container.
  • format_invoke_metadata now appends the standalone helper on the scalar-only and validation-error branches when show_recall_buttons=True; the fully-parsed path still renders the three-button group in a single container.
  • format_metadata computes invokeai_configured once, dispatches to the Invoke/EXIF/no-metadata renderer as before, and appends the standalone button for the non-Invoke paths when configured.

Test plan

  • ruff check photomap tests passes.
  • pytest tests/backend — 117 passed (new test_metadata_formatting.py covers the three dispatch paths × InvokeAI configured/not; new formatter tests cover scalar-only / validation-error + standalone helper).
  • npm test — 233 passed.
  • Manual: browse an album containing a non-Invoke (phone camera) image with InvokeAI configured and verify the "Use as Ref Image" button appears in the drawer and uploads the file.
  • Manual: clear the InvokeAI URL in settings and verify no recall buttons appear on any image.

🤖 Generated with Claude Code

…eAI is configured

The button only needs the image on disk — not recallable generation
parameters — so expose it from the EXIF, no-metadata, scalar-only, and
unknown-invoke-format paths whenever an InvokeAI backend URL is set.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@lstein lstein merged commit ff216bb into master Apr 19, 2026
5 checks passed
@lstein lstein deleted the lstein/feature/use-ref-for-any-image branch April 19, 2026 19:14
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.

1 participant