Skip to content

Music mode + aspect-ratio picker + date/time prompt + image cases - #6

Merged
1bcMax merged 3 commits into
masterfrom
homepage-cases
May 29, 2026
Merged

Music mode + aspect-ratio picker + date/time prompt + image cases#6
1bcMax merged 3 commits into
masterfrom
homepage-cases

Conversation

@KillerQueen-Z

@KillerQueen-Z KillerQueen-Z commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Music as a dedicated mode (alongside image/video). Backed by MiniMax Music 2.5+ via /v1/audio/generations. Output plays inline in the message bubble as an <audio> element with a download link.
  • Aspect-ratio "比例" flyout in image and video composers. Per-model whitelists driven by IMAGE_MODEL_SIZES and VIDEO_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 in send's useCallback deps that was capturing the initial size/ratio and ignoring user selections.
  • Resolution "清晰度" flyout for Seedance video — 480p / 720p / 1080p, default 720p. Hidden for non-Seedance video models (Grok Imagine, Sora 2) since the gateway silently drops resolution for them.
  • Date + local time injection in the system prompt (systemPromptDateLine(tz)) on every chat turn — without it, models default to their training cutoff and write reports dated to it.
  • Homepage image cases (5 new + headshots) shown only after the user enters image mode. New prefillOnly flag for cases that need a user upload (selfie / screenshot / pet) — clicking switches mode + prefills the composer instead of firing a generation with no input.
  • Misc: Base 链Base in zh i18n; moved a pre-existing eslint-disable directive 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 (calculateVideoPrice uses a fixed tokensPerSecondAtDefault constant). Filed upstream: BlockRunAI/blockrun#30. In the meantime users get 1080p at the 720p price — favors users, no client-side action needed.

Test plan

  • Switch to Music mode → pick a track prompt → audio plays inline, download link works
  • In image mode, switch model GPT Image 2 → ratio picker shows 1:1 / 3:2 / 2:3; pick 3:2 → generated image is 1536×1024 (not 1024²)
  • Switch model to Nano Banana → ratio picker hides
  • In video mode with Seedance 2.0 Fast, pick 9:16 + 1080p → generated clip is portrait, higher detail than 720p
  • Switch to Sora 2 → both ratio and resolution pickers hide
  • Click Image button on a fresh chat → image-only cases appear; selfie / screenshot / cat cases prefill instead of sending
  • Ask the model "今天几号" → answers with today's date (not training-cutoff date)
  • Switch to zh → wallet pill shows "Base", not "Base 链"

KillerQueen-Z and others added 3 commits May 29, 2026 13:17
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.
@1bcMax
1bcMax merged commit 34f36d3 into master May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant