Skip to content

feat(generation): restore the SDXL Refiner in Generate and Canvas - #9810

Open
joshistoast wants to merge 3 commits into
mainfrom
feat/parity-sdxl-refiner
Open

joshistoast wants to merge 3 commits into
mainfrom
feat/parity-sdxl-refiner

Conversation

@joshistoast

@joshistoast joshistoast commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The SDXL Refiner had no path through webv2 Generate or Canvas, so legacy SDXL + refiner recipes could not be reproduced.

A Refiner section (SDXL main models only) offers a refiner model picker limited to sdxl-refiner models (which remain unselectable as main models), scheduler, steps, CFG, start fraction and positive/negative aesthetic scores with the legacy defaults. When a refiner is picked, the graph adds the refiner loader, refiner conditioning (aesthetic scores, prompts wired by edge), a second denoise stage from the start fraction to the end with the base stage ending at the hand-over, and routes the refined latents into decode; seamless is applied to the refiner too. Canvas image-to-image, inpaint and outpaint use start = min(refiner start, 1 − strength) and keep masks, control, IP-adapter and regional guidance on the base stage; the refiner pass receives the same gradient denoise mask. PiD + refiner is rejected. A start fraction of 1 means off. The refiner is recorded in metadata and restored by Recall All and Remix (key, then hash, then name+base); an uninstalled or ambiguous refiner is reported in the recall notice.

Two deliberate deviations from the current legacy builder were confirmed correct by review against the backend scheduler: the base pass ends at the hand-over (current legacy regressed this for text-to-image), and the refiner's style conditioning receives the prompt by edge (legacy copied an undefined value).

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. Mock fixtures now cycle main models over sd-1 / sdxl / sdxl-refiner, so the UI can be exercised against the mock (representative profile):

  1. Home → Generate from text → model picker → SDXL chip → pick an SDXL fixture: a Refiner section appears before Advanced with its controls disabled.
  2. Open "Refiner model": only refiner fixtures are listed; pick one: the badge shows its name and the controls enable.
  3. Switch the main model to an SD 1.x fixture: the confirm dialog lists "Refiner" and the section disappears.
  4. Submitted graphs cannot be inspected on the mock (no enqueue route); graph shape is covered by compile tests. A real SDXL model plus refiner is required to see output.

Review

No material findings. Reviewers compiled 59 graph shapes from the base and head commits and found non-refiner graphs byte-identical. Follow-ups applied from review: the refiner denoise now receives the gradient mask on inpaint/outpaint; one owner for the base denoise range; recall reports an unresolved refiner; the picker's empty state no longer double-messages; start fraction 1 is treated as off; legacy input caps; docs note the Canvas strength cap.

Compatibility / Rollout

New generate settings are optional with defaults and normalize on 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)

🤖 Generated with Claude Code


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

Add refiner settings (model, steps, CFG, scheduler, start, aesthetic scores) with legacy defaults, a Refiner section shown for SDXL mains, and a refiner denoise stage grafted before the decode for Generate txt2img and Canvas img2img/inpaint/outpaint, with PiD rejected alongside it.
Record refiner metadata and restore it through Recall All and Remix, resolving the model by key, hash or name and base.
Extend the mock fixture with SDXL and refiner mains, the backend graph contract, and the Generate and SDXL docs.
…r states

The base denoise range has one owner, so Canvas grafts keep the hand-over, and inpaint/outpaint feed the gradient mask to the refiner pass too.
A start of 1 skips the refiner instead of loading it for an empty pass; recall reports an uninstalled or ambiguous refiner instead of silently keeping the current one.
The refiner picker owns its empty and loading states, steps/CFG use the legacy input limits, and docs describe the Canvas strength cap.
…nd section

Request counts and chunk sets are unchanged; the refiner settings and graph cores join the
editor's generation source set and the section joins the Generate widget's.
@github-actions github-actions Bot added frontend PRs that change frontend files 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant