The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
fix(create): the music price in the picker follows the length slider
purpled3b45ff02547
diff --git a/src/components/create/experimental/ModelChip.tsx b/src/components/create/experimental/ModelChip.tsxindex ca6ba52c..b31a558e 100644--- a/src/components/create/experimental/ModelChip.tsx+++ b/src/components/create/experimental/ModelChip.tsx@@ -31,6 +31,9 @@ function CloudModelChip() {const setCloudImageModel = useCreateStore((s) => s.setCloudImageModel)const setCloudVideoModel = useCreateStore((s) => s.setCloudVideoModel)const setCloudOpModel = useCreateStore((s) => s.setCloudOpModel)+ // Subscribed, not read once: the music sublabel must follow the length+ // slider live so the shown price is the billed price (A3, sockenmonster).+ const musicDuration = useCreateStore((s) => s.musicDuration)const models = useCloudCatalogStore((s) => s.models)const isVideo = mode === 'video'@@ -76,7 +79,7 @@ function CloudModelChip() {const options: SelectOption[] = list.map((m) => ({value: m.id,label: m.label,- sublabel: modelCostHint(m, op),+ sublabel: modelCostHint(m, op, op === 'music' ? musicDuration : undefined),badge: CLOUD_BADGE,}))diff --git a/src/stores/__tests__/cloudCatalogStore.test.ts b/src/stores/__tests__/cloudCatalogStore.test.tsindex 8a7cb476..b1fb76ba 100644--- a/src/stores/__tests__/cloudCatalogStore.test.ts+++ b/src/stores/__tests__/cloudCatalogStore.test.ts@@ -1,6 +1,7 @@import { describe, it, expect, beforeEach } from 'vitest'import {useCloudCatalogStore,+ modelCostHint,cloudModelsFor,defaultCloudModel,defaultEditModel,@@ -213,4 +214,27 @@ describe('cloudCatalogStore', () => {expect(modelForOp('image', 'generate', 'flux-9')).toBe('flux-9')})})++ describe('modelCostHint (A3: the shown price is the billed price)', () => {+ const ace = {+ id: 'ace-step-1.5', label: 'ACE-Step 1.5', kind: 'audio' as const,+ ops: ['music' as const], credits: { base: 1800, per_s: 30 },+ }++ it('music follows the length slider, not a static 60 s quote', () => {+ // sockenmonster's exact run: 3:10 = 190 s at 30 cr/s.+ expect(modelCostHint(ace, 'music', 190)).toBe('5,700 cr')+ expect(modelCostHint(ace, 'music', 60)).toBe('1,800 cr')+ })++ it('NEGATIVE CONTROL: without a duration the 60 s default still prices', () => {+ expect(modelCostHint(ace, 'music')).toBe('1,800 cr')+ expect(modelCostHint(ace, 'music', 0)).toBe('1,800 cr')+ })++ it('non-music ops ignore the duration and quote base', () => {+ const flux = { id: 'flux-9', label: 'Flux 9', kind: 'image' as const, credits: { base: 300 } }+ expect(modelCostHint(flux, 'generate', 190)).toBe('300 cr')+ })+ })})diff --git a/src/stores/cloudCatalogStore.ts b/src/stores/cloudCatalogStore.tsindex 90f92424..90a6aca3 100644--- a/src/stores/cloudCatalogStore.ts+++ b/src/stores/cloudCatalogStore.ts@@ -203,12 +203,18 @@ export function shortCount(n: number): string {/** One run's wallet draw as a picker sublabel. The single biggest cost lever* (wan-2.2-720p costs 5x wan-2.2-fast) was invisible before picking. Music- * quotes the 60 s default, video the short clip; the meter refines both to- * the exact run. Undefined when the entry carries no price (seed/offline). */-export function modelCostHint(m: CloudModel, op: RenderOp): string | undefined {+ * prices the CURRENT length-slider value, not a static 60 s quote: the old+ * hint said 1,800 cr while a 3:10 run really billed 5,700, which read as a+ * hidden price hike (sockenmonster, bug-reports 2026-08-08). Video quotes the+ * short clip; the meter refines it to the exact run. Undefined when the entry+ * carries no price (seed/offline). */+export function modelCostHint(m: CloudModel, op: RenderOp, seconds?: number): string | undefined {const c = m.creditsif (!c) return undefined- const cr = op === 'music' && c.per_s !== undefined ? Math.ceil(c.per_s * 60) : c.base+ const cr =+ op === 'music' && c.per_s !== undefined+ ? Math.ceil(c.per_s * (seconds && seconds > 0 ? seconds : 60))+ : c.basereturn `${shortCount(cr)} cr`}