Size follows the model: reconcile dimension options on a model swap - #370
Open
mikkel wants to merge 1 commit into
Open
Size follows the model: reconcile dimension options on a model swap#370mikkel wants to merge 1 commit into
mikkel wants to merge 1 commit into
Conversation
Swap an image node from nano-banana-2 to qwen-image-3 and the size dropdown
kept "2k" — a value qwen-image-3 does not offer. Both engines injected the old
value as an option of the new model, so the next run posted size=2k to a model
that rejects it or silently substitutes its own. Same class of bug for video:
Sora counts length in `seconds` (4/8/12) while most models offer 5/10, and
Sora/WAN name the aspect dimension `orientation` (landscape/portrait).
On a model swap the value now snaps to a REAL option of the new model:
same picture first (aspect ratio, then pixel count), else the nearest number,
else the model's own default. 1k -> 1024x1024, 1024x1024 -> 1k, a portrait
never becomes a landscape, duration 5 -> Sora's 4.
Hydration keeps the old behaviour on purpose: opening a saved or shared graph
leaves the author's stored value exactly as chosen, because there the model did
not change.
A changed dimension changes what the run buys, so it is disclosed, not silent —
a warn toast in the editor ("qwen-image-3 doesn't offer that — switched size
2k -> 1024x1024"), localized in all 5 languages. In an exported app the new
value lands in the same select the user just used, and the run cost updates
with it.
scripts/check-dim-reconcile.mjs pins 15 mappings offline in BOTH engines plus
the wiring (swap reconciles, hydration does not) and the disclosure. Verified
end-to-end in real Edge over CDP against the live catalog shape, zero API spend.
Update: Change the model and the size options follow it — no more sending a size the new model doesn't support.
Contributor
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
nanoodle | 33ec51f | Commit Preview URL Branch Preview URL |
Jul 27 2026, 02:07 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
Swap an image node from
nano-banana-2toqwen-image-3and the size dropdown keeps2k— a sizeqwen-image-3does not offer.Both engines kept the old value and injected it as an option of the new model:
The next run then posts
size=2kto a model that rejects it or silently substitutes its own — a paid request for something the user did not ask for.Same class of bug across every dimension, because each model names and values them differently:
nano-banana-21k2k4kqwen-image-3auto1024x1024512x512768x1024…seconds:4812duration:510orientation:landscapeportraitThe fix
On a model swap the stored value snaps to a real option of the new model:
duration 5→ Sora's4;720p→480p)1k→1024x1024.1024x1024→1k.16:9→landscape.On hydration nothing changes: opening a saved or shared graph leaves the author's stored value exactly as chosen, because there the model did not change. Same in an exported app — the author's baked-in value survives the first render.
Disclosure, not silence
A changed dimension changes what the run buys, so it is announced, like a trimmed prompt is (#369):
Localized in all 5 languages. In an exported app the new value lands in the same
<select>the user just used and the run-cost chip updates with it.Verification
scripts/check-dim-reconcile.mjs(wired into pre-commit) pins, offline and with zero API spend:Negative-tested — the guard fails when the fix is reverted.
Driven end-to-end in real Edge over CDP against the live catalog payload, zero API spend:
Full pre-commit suite passes.
🤖 Generated with Claude Code