Skip to content

feat(invoke): add image-board selector for reference uploads#222

Merged
lstein merged 2 commits intomasterfrom
lstein/feature/invoke-board-selector
Apr 19, 2026
Merged

feat(invoke): add image-board selector for reference uploads#222
lstein merged 2 commits intomasterfrom
lstein/feature/invoke-board-selector

Conversation

@lstein
Copy link
Copy Markdown
Owner

@lstein lstein commented Apr 19, 2026

Summary

  • Reveals the InvokeAI username/password fields and a new "Upload to Image Board" dropdown in the settings dialog only after the configured URL probes as a working InvokeAI backend.
  • Reference images uploaded via Use as Ref Image are placed in the selected board; if the board can't be fetched at settings-load time, or the configured board rejects the upload at runtime, the image lands in Uncategorized and the response carries a warning.
  • Independent of feat(invoke): show "Use as Ref Image" button for any image when InvokeAI is configured #221 (no overlapping files) — branched off master so the two PRs can land in either order.

Backend

  • Config.invokeai_board_id field; to_dict / load_config / get_invokeai_settings / set_invokeai_settings round-trip it.
  • GET /invokeai/status probes the unauthenticated /api/v1/app/version. Returns {reachable, version, detail}. Used by the settings UI to decide whether to reveal the auth section. Treats a 200 without a version field as not-InvokeAI.
  • GET /invokeai/boards fetches /api/v1/boards/?all=true through the existing auth-fallback helper (renamed _post_with_auth_fallback_request_with_auth_fallback since it's now used for GET as well). Returns a flat [{board_id, board_name}] list; handles paginated responses too. Any failure surfaces as 502.
  • GET /invokeai/config adds board_id to the response. POST /invokeai/config round-trips it with the same preserve-on-null / clear-on-empty-string semantics as the password field.
  • _upload_image_to_invokeai accepts board_id and retries without it on a 4xx, returning a warning string the caller surfaces. /use_ref_image includes warning in the response on fallback.

Frontend

  • settings.html: wraps username/password rows + new <select id="invokeaiBoardSelect"> in #invokeaiAuthSection (hidden by default).
  • settings.js: load → /invokeai/status → conditional reveal → /invokeai/boards. URL/user/pass autosave (debounced) and re-probe; board selection autosaves on change. On boards fetch failure the dropdown is disabled and shows only "Uncategorized".

Test plan

  • ruff check photomap tests clean.
  • pytest tests/backend — 119 passed (+12 new: status reachable / unreachable / non-InvokeAI / paginated boards / board_id round-trip / preserve-on-null / clear-on-empty / boards 502 / upload uses board_id / fallback to Uncategorized + warning).
  • npm test — 239 passed (+6 new in invokeai-settings.test.js covering reveal/hide, board population, and fallback).
  • npm run lint and npm run format:check clean.
  • Manual: enter a valid InvokeAI URL → username/password/board fields appear, dropdown populates.
  • Manual: enter junk URL → fields stay hidden.
  • Manual: pick a board, click Use as Ref Image → image lands in that board in InvokeAI.
  • Manual: delete the board in InvokeAI without updating settings → next Use as Ref Image lands in Uncategorized and surfaces the warning.

🤖 Generated with Claude Code

lstein and others added 2 commits April 19, 2026 15:14
Reveals the InvokeAI username/password and a new "Upload to Image
Board" dropdown only after /invokeai/status confirms the configured
URL points to a working backend.  Reference-image uploads target the
selected board, falling back to Uncategorized when the board can't be
fetched at config time or rejects the upload at runtime.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@lstein lstein enabled auto-merge (squash) April 19, 2026 19:23
@lstein lstein merged commit 422c864 into master Apr 19, 2026
6 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