Skip to content

feat(generate): restore model-family tuning, Krea-2 style reference and output filters - #9809

Open
joshistoast wants to merge 2 commits into
mainfrom
feat/parity-model-tuning
Open

joshistoast wants to merge 2 commits into
mainfrom
feat/parity-model-tuning

Conversation

@joshistoast

@joshistoast joshistoast commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Model-family tuning controls and two output options from the legacy frontend were missing from webv2 Generate and Canvas.

  • FLUX.1 DyPE: preset (off, auto, area, 4K optimized, manual) with scale and exponent under Manual, sent to the FLUX denoise node only when set.
  • Z-Image: an optional timestep shift override and the seed-variance enhancer (strength and randomized channels), inserted between the positive conditioning and its collector exactly as legacy wired it.
  • Qwen-Image: timestep shift override and encoder quantization (none, int8, nf4) applied to both text encoders.
  • Krea-2 style reference: a new reference-image kind with a 0–2 style strength, compiled to krea2_style_reference fed by the (cropped) image and the model VAE and connected to denoising; strength 0 bypasses it. Krea-2 now advertises one reference image on the backend.
  • NSFW checker and invisible watermark: two project settings (Settings → Project, off by default) that chain img_nsfw / img_watermark after the final image of every built-in Generate and Canvas family, keeping the output flags and metadata on the last node.

Every control appears only for its model family; graphs at defaults are structurally unchanged. New settings are emitted in metadata and restored by Recall All and Remix.

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. Python: pytest tests/backend/architectures tests/app/invocations/test_frontend_graph_node_types.py passes.

The mock backend's representative profile has only SD 1.x main models, so the per-family controls are covered by browser tests (GenerateRenderSection, GenerateAdvancedFields) and compile tests. On the mock: open a project → Settings → Project: toggle NSFW checker and Invisible watermark; the Generate graph preview then ends … → img_nsfw → img_watermark. With a real install: select a FLUX.1 model → Render → DyPE = Manual shows λs/λt; Qwen-Image → Advanced → Encoder quantization; Z-Image → Shift override and Seed variance; Krea-2 → add a reference image → Style strength. Generate, then Recall All restores each.

Review

No material findings. Reviewers confirmed every field against the backend invocations and the legacy builders, including that DyPE scale/exponent are read only under the manual preset. Follow-ups applied from review: tests for the shift override being turned off, watermark-only Canvas outpaint to a staging destination, the project setting flowing through the normal invoke path, and recall of a style reference whose image is missing; a single "Shift" label; docs naming.

Limitation: core_metadata at defaults now records z_image_shift: 'auto', qwen_image_shift: 'auto', qwen_image_quantization: 'none' and the seed-variance keys, matching legacy; execution nodes are unchanged.

Compatibility / Rollout

New generate settings and the two project settings are optional with defaults and normalize on load; no project-document migration. The Krea-2 architecture definition now reports max_reference_images=1 (capabilities fixture regenerated). 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.

…nd output filters

FLUX.1 DyPE, Z-Image shift and seed variance, and Qwen-Image shift and encoder quantization reach their denoise and encoder nodes, with metadata and recall.
Krea-2 declares a single style reference; the Generate panel compiles it to krea2_style_reference for Generate and every Canvas mode.
Project settings add the NSFW checker and invisible watermark, chained after every locally decoded output with the result flags and metadata on the final node.
…hift field

The shift override uses the sibling slider pattern so its label is not repeated; its off switch is tested to hand the shift back to the node.
Canvas outpaint, the project invoke path, and a Krea-2 record without a reference image are covered; the defaults test names the node-type contract as the real guard.
@github-actions github-actions Bot added python PRs that change python files backend PRs that change backend files 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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants