Skip to content

feat: Append to InvokeAI reference image + capability-gated recall buttons#332

Merged
lstein merged 3 commits into
masterfrom
lstein/feature/append-to-invokeai
Jun 13, 2026
Merged

feat: Append to InvokeAI reference image + capability-gated recall buttons#332
lstein merged 3 commits into
masterfrom
lstein/feature/append-to-invokeai

Conversation

@lstein

@lstein lstein commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Summary

Adds an "Append to InvokeAI" reference-image button to the metadata drawer, a small alignment tweak to the metadata link, and a capability probe so the recall buttons only appear when the configured InvokeAI backend actually supports them.

This is the PhotoMap side of a two-part change. It depends on a matching InvokeAI backend change (append query parameter on POST /api/v1/recall/{queue_id}); against an older backend the new button is automatically hidden by the capability probe.

What's in here (three commits)

  1. fix(ui): left-align the "View Metadata (JSON)" link — both render slots (the standalone row below the recall buttons and the sticky cell at the bottom of the Image Details table) were right-aligned. Also removes a stray } in metadata-drawer.css that made the stylesheet syntactically invalid.

  2. feat(invoke): "Append to InvokeAI" button — sits to the right of "Send to InvokeAI". It runs the same upload + recall flow but sends ?append=true on the recall, asking InvokeAI to add the image to its existing reference-image list instead of replacing it. New append field on UseRefImageRequest; new append_ref button mode in invoke-recall.js.

  3. feat(invoke): gate the recall buttons on a backend capability probe — new GET /invokeai/capabilities probes the backend's OpenAPI schema for the recall route and its append query parameter (falling back to version thresholds — recall ≥ 6.13.0, append ≥ 6.13.5 — when the schema can't be fetched). The frontend reflects the result as body classes that CSS uses to reveal the buttons:

    • no recall router → no recall buttons at all
    • recall without append → Send to InvokeAI / Remix / Recall only
    • recall with append → all buttons

    Probing capabilities rather than comparing versions keeps a development backend working the moment the feature lands on its branch. Results are cached (5 min on success, 30 s on failure) and the cache is dropped when the InvokeAI settings are saved.

Testing

  • make test green: 436 backend (pytest) + 379 frontend (Jest) tests.
  • New coverage: capability tiers (OpenAPI + version fallback, unreachable, cache/refresh/invalidation), the append recall parameter, and the body-class gating.
  • ruff, eslint, and prettier all clean.

🤖 Generated with Claude Code

lstein and others added 3 commits June 13, 2026 09:25
Both slots of the link — the standalone row below the recall buttons and
the sticky cell at the bottom of the Image Details table — were
right-aligned. Also removes a stray closing brace after the
#descriptionText rule that made the stylesheet syntactically invalid.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds an "Append to InvokeAI" button to the right of "Send to InvokeAI"
in the metadata drawer. It runs the same upload + recall flow but sends
?append=true on the recall, which asks InvokeAI to add the image to its
existing reference-image list instead of replacing it.

Requires an InvokeAI backend whose recall endpoint understands the
append query parameter (lstein fork branch
lstein/feat/recall-append-ref-images); older backends ignore the
parameter and keep the replace behaviour.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The recall buttons now activate only after PhotoMap confirms the
configured InvokeAI backend supports them:

* no /recall router        -> no recall buttons at all
* recall without append    -> Send to InvokeAI / Remix / Recall only
* recall with append       -> all buttons

GET /invokeai/capabilities probes the backend's OpenAPI schema for the
recall route and its append query parameter — probing capabilities
rather than comparing versions keeps development backends working the
moment the feature exists on their branch. When the schema can't be
fetched it falls back to version thresholds (recall 6.13.0, append
6.13.5); an unreachable backend reports no capabilities. Successful
probes are cached for 5 minutes, failures for 30 seconds, and saving
the InvokeAI settings drops the cache.

The frontend fetches capabilities at startup and after settings saves,
reflecting the result as body classes that CSS uses to reveal the
buttons — the server still renders all of them into the drawer HTML.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lstein lstein merged commit cfdabe6 into master Jun 13, 2026
10 checks passed
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