Skip to content

fix(canvas): account for raster input in provider preflight - #10258

Draft
renningg wants to merge 1 commit into
invoke-ai:mainfrom
renningg:fix/canvas-external-preflight
Draft

renningg wants to merge 1 commit into
invoke-ai:mainfrom
renningg:fix/canvas-external-preflight

Conversation

@renningg

@renningg renningg commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Canvas preflight treated dual-mode external image providers as text-to-image even when raster content supplied an init image. This could allow a reference-image configuration that exceeded the provider's total image budget.

Use the existing in-frame raster-content check when selecting the Canvas preflight mode, and pass the same signal into the Generate form. For example, Seedream's 14 references + 1 output are valid on an empty canvas, but adding an init image now reports the 16 > 15 budget error before invocation. Compose and local-model behavior are unchanged.

Related Issues / Discussions

Follow-up to the Canvas preflight feedback on #10240. This shared fix is based directly on current main and does not depend on the unmerged MiniMax provider implementation.

QA Instructions

  • pnpm lint: passed (including types and architecture checks).
  • pnpm test src/features/generation/core/baseGenerationPolicies.test.ts src/workbench/invocation.test.ts: 213 passed.
  • pnpm test:browser src/features/generation/ui/GenerateSettingsForm.browser.test.tsx: 35 passed.
  • pnpm test:fixtures: 80 passed.
  • Manual mock UI: selected Seedream with 14 reference images, painted a raster stroke in the generation frame, and observed the total-image warning in Guidance and Invoke preflight. Hiding the raster layer removed the budget warning immediately. No paid/provider generation was performed.
  • pnpm check:release: not green. Unit tests: 13,997 passed, 2 failed in shortcutHints.test.ts and palette/entries.test.ts (macOS modifier ordering/platform expectations). Both failures reproduce on clean main at 5de896f2e8a03277ea15bfbd10b3f889b020b790.
  • Separately ran full browser suite: 4,627 passed, 50 failed, 1 skipped across 450 files. Failures include shortcut/focus expectations and Vite filesystem allowlist errors from reused dependency symlinks; not all failures have been baseline-triaged.
  • pnpm test:performance:architecture: contract tests and production build completed; browser sampling failed on aborted mock gallery requests (net::ERR_ABORTED). No performance pass or improvement is claimed.

GitHub CI subsequently passed the full release completion gates in a clean runner, including the frontend tests and performance checks: https://github.com/invoke-ai/InvokeAI/actions/runs/43369086170 . All current PR checks passed or were conditionally skipped. The local-environment failures above are retained for transparency. This PR remains draft for initial review.

Review

No blocking correctness findings remain in the scoped change. Raster scanning is gated to Canvas external-provider models so local-model form updates do not pay that cost. The existing geometry-based raster check is intentionally reused: it skips text-only bounds and does not inspect individual transparent pixels. Actual rasterization remains authoritative at submission time.

Compatibility / Rollout

No API, generated schema, or persisted-state changes. No migration or deployment ordering requirement.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Meaningful regression coverage added / updated where needed; obsolete tests/code removed
  • Persisted-state and API changes include required migrations / compatibility validation
  • Relevant performance/efficiency opportunities considered; material claims have evidence
  • Material review findings resolved and relevant checks rerun
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

@github-actions github-actions Bot added the frontend PRs that change frontend files label Nov 13, 2026

This branch has not been deployed

No deployments
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