Music mode + aspect-ratio picker + date/time prompt + image cases - #6
Merged
Conversation
Music as a dedicated generation mode alongside image/video, backed by MiniMax Music 2.5+ via /v1/audio/generations; output renders in-bubble as an <audio> player. Aspect-ratio "比例" flyout in image and video modes. Image options are the per-model `sizes` whitelist (gateway rejects anything else with 400) — GPT Image 1/2 get 1:1/3:2/2:3; single-ratio models (Nano Banana, Grok Imagine) hide the picker. Video options use the `aspect_ratio` param which is token360-only; Seedance variants get 16:9/9:16/1:1/4:3/3:4, Sora 2 and Grok Imagine Video hide the picker. Default image model switched to GPT Image 2 so the picker is meaningful out of the box. Each row gets a true-to-scale rect glyph so horizontal vs vertical reads at a glance. send() now takes imageSize / videoRatio as useCallback deps — the closure was capturing the initial size and ignoring user selections. Inject today's date + local time + IANA timezone into the system prompt on every chat turn (via systemPromptDateLine). Without this, models default to their training cutoff and write reports dated to it. Homepage cases split: image-mode cases (5 new + headshots) now show only after the user enters image mode, with a prefillOnly flag for cases that need the user's own upload (selfie, screenshot, pet photo). Misc: zh "Base 链" → "Base"; pre-existing eslint-disable directive on the mobile sidebar useEffect moved to the actual setState call.
Second flyout next to the aspect-ratio picker in video mode, gated by VIDEO_MODEL_RESOLUTIONS — Seedance 1.5 Pro / 2.0 Fast / 2.0 Pro get 480p/720p/1080p; Grok Imagine Video and Sora 2 ignore the param so the picker hides for them. Default is 720p (matches the gateway's Seedance default at videos/generations/route.ts:218). Switching model resets ratio + resolution to that model's defaults so we never POST a value the gateway will 400. videoResolution joined imageSize/videoRatio in send()'s useCallback deps to avoid the closure-stale bug. Known gateway issue: 1080p costs the user the same 402 amount as 720p, because calculateVideoPrice uses a fixed tokensPerSecondAtDefault constant. Tracked in BlockRunAI/blockrun#30 — favors users in the meantime; quality is the only differentiator they see.
…eouts/MIME - Hide attach button in music mode (reference was accepted, thumbnailed, then silently dropped from the request, and falsely flipped needsWallet). - Reset the aspect-ratio flyout on every mode change so an open menu no longer re-opens unbidden when re-entering image/video mode. - Give music the longer (300s) poll budget instead of the 180s image timeout; long renders were killed after the user already paid. - extractMediaUrl now sets the data-URI MIME by media kind (audio/mpeg, video/mp4, image/png) so a b64 audio fallback no longer mislabels itself as a PNG that <audio> can't decode. - runMedia honors a modelOverride so image/video demo cases with a forced model no longer silently run on the currently-selected model.
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.
Summary
/v1/audio/generations. Output plays inline in the message bubble as an<audio>element with a download link.IMAGE_MODEL_SIZESandVIDEO_MODEL_RATIOS; models with a single valid ratio (Nano Banana, Grok Imagine, Sora 2) hide the picker. Each row shows a true-to-scale rectangle glyph so horizontal vs vertical reads at a glance. Switched default image model to GPT Image 2 so the picker is meaningful out of the box. Fixed a closure bug insend'suseCallbackdeps that was capturing the initial size/ratio and ignoring user selections.resolutionfor them.systemPromptDateLine(tz)) on every chat turn — without it, models default to their training cutoff and write reports dated to it.prefillOnlyflag for cases that need a user upload (selfie / screenshot / pet) — clicking switches mode + prefills the composer instead of firing a generation with no input.Base 链→Basein zh i18n; moved a pre-existingeslint-disabledirective to the line it actually annotates.Known issue (gateway-side)
The Seedance resolution picker exposes 1080p, but the gateway currently bills all resolutions at the 720p token-cost baseline (
calculateVideoPriceuses a fixedtokensPerSecondAtDefaultconstant). Filed upstream: BlockRunAI/blockrun#30. In the meantime users get 1080p at the 720p price — favors users, no client-side action needed.Test plan