Skip to content

feat(canvas): restore PiD decoding and the Anima inpaint adapter on Canvas - #9805

Open
joshistoast wants to merge 2 commits into
mainfrom
feat/parity-canvas-pid-anima
Open

joshistoast wants to merge 2 commits into
mainfrom
feat/parity-canvas-pid-anima

Conversation

@joshistoast

@joshistoast joshistoast commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Two Canvas generation paths the legacy frontend supported were missing from webv2.

PiD decoding on Canvas. The canvas compiler rejected every PiD mode ("not supported on the canvas yet"). It now compiles Canvas text-to-image and image-to-image, in both Fit and Native modes, on every base where Generate already supports PiD. Native image-to-image resizes the source to the quarter-size denoise resolution and decodes straight to the bounding box, as the legacy builders did; Fit keeps the full-size encode and resizes the decoded output. The encode VAE is resolved from the graph (the decode's VAE edge, or the model loader for the FLUX and SD3 decoders that take none). Inpaint/outpaint and Scale Before Processing that changes the processing size remain rejected with the legacy messages.

Anima inpaint adapter. Anima models get an optional four-channel inpaint/outpaint adapter slot (Anima LLLite models that are not three-channel) with a weight control. During Canvas inpaint and outpaint the graph adds the inverted gradient mask and an anima_lllite node fed by the resized/initial image (inpaint) or the infilled image (outpaint), joined to the shared control collector exactly as the legacy addInpaint/addOutpaint builders wired it. Ordinary control layers still reject four-channel models. The adapter and weight are recorded in metadata and restored by Recall All and Remix.

Graphs without PiD or without an adapter are unchanged.

Related Issues / Discussions

Follows up the legacy parity audit behind #9803.

QA Instructions

From invokeai/frontend/webv2 (Node 22.14, pnpm 10.12): pnpm check:release passes (lint, unit, browser, fixtures, performance, project-file journeys, accessibility). One browser suite unrelated to this change (gallery maintenance settings) timed out once under heavy machine load and passed on rerun. Python: pytest tests/app/invocations/test_frontend_anima_lllite_graphs.py tests/app/invocations/test_frontend_graph_node_types.py passes (474 passed, 2 skipped).

The mock backend has no Anima or PiD models, so UI behavior is covered by browser tests (GenerateSettingsForm.browser.test.tsx: the Inpaint Adapter slot lists only four-channel models, the weight control appears once one is picked, and the slot is absent for non-Anima models). Real-model verification was not performed. With a real install:

  1. Select an SDXL or FLUX model with a PiD decoder and Gemma-2 encoder, set PiD to Fit or Native, draw a bounding box on Canvas and invoke text-to-image and image-to-image: both run. Paint an inpaint mask: the error reads "PiD decode currently supports Text to Image and Image to Image only…". Set Scale Before Processing to Auto on a small box: "Turn off Scale Before Processing…".
  2. Select an Anima model, open Generate → Components → Inpaint Adapter: only the inpainting LLLite is listed; pick it and the weight control appears. Add an inpaint mask on Canvas and invoke: the queued graph contains anima_inpaint_adapter and invert_anima_inpaint_adapter_mask. Recall All on the result restores both.

Review

No material findings. Reviewers confirmed the compiled graphs match the legacy wiring field for field on every PiD base and both adapter paths, and that non-PiD and non-adapter graphs are unchanged. Follow-ups from review: compile tests for scaled outpaint and noise-mask inpaint with the adapter, a recall test for an uninstalled adapter, and the browser test above.

Limitations: no real-model execution; the Scale Before Processing rule compares grid-clamped sizes (webv2's auto scaling only grows), so an already-optimal box is accepted where legacy's auto mode would have rejected it.

Compatibility / Rollout

The new settings are optional with defaults and normalize on project load; no project-document migration. No API changes.

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)

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Canvas txt2img and img2img decode through PiD in fit and native modes, resolving the encode VAE from the PiD graph and encoding at the denoise size; inpaint/outpaint and Scale Before Processing keep the legacy rejections.
Anima inpaint/outpaint can add the optional 4-channel ControlNet-LLLite adapter with a weight, fed the raster image and inverted mask through the shared collector, recorded in metadata and restored by Recall All and Remix.
…picker

Compile tests pin the scaled outpaint mask and pre-noise image the Anima inpaint adapter reads, recall keeps an uninstalled adapter pick while restoring the weight, and a browser case covers the Anima-only slot, its 4-channel filter and the weight scrubber.
@github-actions github-actions Bot added frontend PRs that change frontend files python-tests PRs that change python tests docs PRs that change docs labels Oct 11, 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

docs PRs that change docs frontend PRs that change frontend files python-tests PRs that change python tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant