Skip to content

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.

feat(cloud): drop the example-video stage, and stop hanging the login off one step

purple532a693898fd
diff --git a/package.json b/package.json
index 830d1a95..1d0c104b 100644
--- a/package.json
+++ b/package.json
@@ -32,9 +32,7 @@
"tauri": "tauri",
"tauri:dev": "tauri dev",
"tauri:build": "tauri build",
- "test:e2e": "playwright test",
- "teasers:record": "node scripts/teasers/record.mjs",
- "teasers:build": "node scripts/teasers/build-all.mjs"
+ "test:e2e": "playwright test"
},
"dependencies": {
"@react-three/drei": "^10.7.7",
diff --git a/public/teasers/character-poster.webp b/public/teasers/character-poster.webp
deleted file mode 100644
index 047a04a2..00000000
Binary files a/public/teasers/character-poster.webp and /dev/null differ
diff --git a/public/teasers/character.webm b/public/teasers/character.webm
deleted file mode 100644
index 072e47ef..00000000
Binary files a/public/teasers/character.webm and /dev/null differ
diff --git a/public/teasers/eraser-poster.webp b/public/teasers/eraser-poster.webp
deleted file mode 100644
index 905f4846..00000000
Binary files a/public/teasers/eraser-poster.webp and /dev/null differ
diff --git a/public/teasers/eraser.webm b/public/teasers/eraser.webm
deleted file mode 100644
index 66ccbe8a..00000000
Binary files a/public/teasers/eraser.webm and /dev/null differ
diff --git a/public/teasers/extend-poster.webp b/public/teasers/extend-poster.webp
deleted file mode 100644
index b1eb78c1..00000000
Binary files a/public/teasers/extend-poster.webp and /dev/null differ
diff --git a/public/teasers/extend.webm b/public/teasers/extend.webm
deleted file mode 100644
index 98273d9b..00000000
Binary files a/public/teasers/extend.webm and /dev/null differ
diff --git a/public/teasers/lipsync-poster.webp b/public/teasers/lipsync-poster.webp
deleted file mode 100644
index 5a5e60b0..00000000
Binary files a/public/teasers/lipsync-poster.webp and /dev/null differ
diff --git a/public/teasers/lipsync.webm b/public/teasers/lipsync.webm
deleted file mode 100644
index c387322d..00000000
Binary files a/public/teasers/lipsync.webm and /dev/null differ
diff --git a/public/teasers/motion-poster.webp b/public/teasers/motion-poster.webp
deleted file mode 100644
index cc3bd99f..00000000
Binary files a/public/teasers/motion-poster.webp and /dev/null differ
diff --git a/public/teasers/motion.webm b/public/teasers/motion.webm
deleted file mode 100644
index 68181a0f..00000000
Binary files a/public/teasers/motion.webm and /dev/null differ
diff --git a/public/teasers/music-poster.webp b/public/teasers/music-poster.webp
deleted file mode 100644
index 81331b98..00000000
Binary files a/public/teasers/music-poster.webp and /dev/null differ
diff --git a/public/teasers/music.webm b/public/teasers/music.webm
deleted file mode 100644
index 16e145e2..00000000
Binary files a/public/teasers/music.webm and /dev/null differ
diff --git a/public/teasers/upscale-poster.webp b/public/teasers/upscale-poster.webp
deleted file mode 100644
index d5b4bd71..00000000
Binary files a/public/teasers/upscale-poster.webp and /dev/null differ
diff --git a/public/teasers/upscale.webm b/public/teasers/upscale.webm
deleted file mode 100644
index 6700901a..00000000
Binary files a/public/teasers/upscale.webm and /dev/null differ
diff --git a/scripts/teasers/build-all.mjs b/scripts/teasers/build-all.mjs
deleted file mode 100644
index aa8277ab..00000000
--- a/scripts/teasers/build-all.mjs
+++ /dev/null
@@ -1,22 +0,0 @@
-// Regenerate every teaser clip that has a manifest. Serial on purpose: the
-// two-pass encoder and the frame-step capture are CPU-bound anyway.
-// Usage: node scripts/teasers/build-all.mjs [--fn=music]
-import fs from 'node:fs'
-import path from 'node:path'
-import { spawnSync } from 'node:child_process'
-import { fileURLToPath } from 'node:url'
-
-const HERE = path.dirname(fileURLToPath(import.meta.url))
-const only = process.argv.find((a) => a.startsWith('--fn='))?.split('=')[1]
-const manifests = fs.readdirSync(path.join(HERE, 'manifests'))
- .filter((f) => f.endsWith('.json'))
- .map((f) => f.replace(/\.json$/, ''))
- .filter((fn) => !only || fn === only)
-
-let failed = 0
-for (const fn of manifests) {
- console.log(`\n=== ${fn} ===`)
- const r = spawnSync(process.execPath, [path.join(HERE, 'render.mjs'), `--fn=${fn}`], { stdio: 'inherit' })
- if (r.status !== 0) { failed += 1; console.error(`FAILED: ${fn}`) }
-}
-process.exit(failed ? 1 : 0)
diff --git a/scripts/teasers/flows.mjs b/scripts/teasers/flows.mjs
deleted file mode 100644
index ee0c37c3..00000000
--- a/scripts/teasers/flows.mjs
+++ /dev/null
@@ -1,594 +0,0 @@
-// Flow drivers for record.mjs: each drives one cloud Create function in the
-// running exe (cheapest variant, minimal length) while the screencast rolls,
-// sets the create-clicked / render-done markers and returns the result URL.
-// Everything works through the real UI (hidden file inputs included) so the
-// recording shows exactly what a user does.
-
-/* eslint-disable no-await-in-loop */
-
-import fs from 'node:fs'
-import path from 'node:path'
-
-export const helpers = {
- async nav(page, label) {
- await page.evaluate((l) => {
- const b = [...document.querySelectorAll('button')].find(
- (x) => (x.innerText || '').trim() === l && x.getBoundingClientRect().y < 100,
- )
- b?.click()
- }, label)
- await page.waitForTimeout(900)
- },
-
- async pickIntent(page, label) {
- await page.evaluate((l) => {
- const r = [...document.querySelectorAll('[role="radio"]')].find(
- (x) => (x.getAttribute('aria-label') || '') === l,
- )
- r?.click()
- }, label)
- await page.waitForTimeout(900)
- },
-
- /** Human-ish typing into the composer textarea (visible in the recording). */
- async typePrompt(page, text) {
- const ta = page.locator('textarea').first()
- await ta.click()
- await ta.pressSequentially(text, { delay: 18 })
- await page.waitForTimeout(300)
- },
-
- /** Type into a specific field found by its placeholder (voice maker,
- * trigger word) — .first() would hit the composer prompt instead. Clears
- * first: the trigger word persists across app restarts, so take-02 typed
- * 'lumi' onto the surviving 'lumi' and trained 'lumilumi'. */
- async typeInto(page, placeholderRe, text) {
- const field = page.locator(`textarea[placeholder*="${placeholderRe}"], input[placeholder*="${placeholderRe}"]`).first()
- await field.click()
- await field.fill('')
- await field.pressSequentially(text, { delay: 18 })
- await page.waitForTimeout(300)
- },
-
- async setSlider(page, value) {
- await page.evaluate((v) => {
- const s = document.querySelector('input[type="range"]')
- if (!s) return
- const set = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value').set
- set.call(s, String(v))
- s.dispatchEvent(new Event('input', { bubbles: true }))
- s.dispatchEvent(new Event('change', { bubbles: true }))
- }, value)
- await page.waitForTimeout(300)
- },
-
- /** Remaining-credits figure from the composer's CreditsMeter (null if the
- * meter isn't mounted, e.g. quota still loading). */
- async credits(page) {
- return page.evaluate(() => {
- const box = [...document.querySelectorAll('div')].find(
- (d) => d.querySelector(':scope > div.w-12') && d.querySelector(':scope > span.tabular-nums'),
- )
- const n = box?.querySelector(':scope > span.tabular-nums')?.textContent?.trim()
- return n && /^\d+$/.test(n) ? parseInt(n, 10) : null
- })
- },
-
- /** All current media srcs for a selector (http + blob) — the waitDone
- * baseline, taken right before Create so old gallery items never match. */
- async mediaSrcs(page, selector) {
- return page.evaluate(
- (sel) => [...document.querySelectorAll(sel)]
- .map((m) => m.currentSrc || m.src || '')
- .filter((u) => /^(https?|blob):/.test(u)),
- selector,
- )
- },
-
- /** Ensure the composer's model Select shows `wantRe`; pick it if not.
- * On a miss the error lists what the picker actually offered. */
- async ensureModel(page, wantRe) {
- const state = await page.evaluate((re) => {
- const rx = new RegExp(re, 'i')
- const trigger = [...document.querySelectorAll('button')].find(
- (b) => b.closest('[class*="min-w-"]') && b.querySelector('svg.lucide-chevron-down'),
- ) ?? [...document.querySelectorAll('button')].find((b) => b.querySelector('svg.lucide-chevron-down'))
- if (!trigger) return { found: false }
- const label = trigger.textContent || ''
- if (rx.test(label)) return { found: true, ok: true, label }
- trigger.click()
- return { found: true, ok: false, label }
- }, wantRe.source)
- if (!state.found) throw new Error('model select trigger not found')
- if (state.ok) return state.label
- await page.waitForTimeout(500)
- const picked = await page.evaluate((re) => {
- const rx = new RegExp(re, 'i')
- const opts = [...document.querySelectorAll('[role="option"], [role="listbox"] button, .lu-elevated button')]
- const opt = opts.find((o) => rx.test(o.textContent || ''))
- if (!opt) return { miss: opts.map((o) => (o.textContent || '').trim()).filter(Boolean) }
- opt.click()
- return { label: (opt.textContent || '').trim() }
- }, wantRe.source)
- if (!picked.label) throw new Error(`model matching ${wantRe} not in picker; options: ${JSON.stringify(picked.miss)}`)
- await page.waitForTimeout(500)
- return picked.label
- },
-
- /** Click the composer's Create submit (NOT the nav tab of the same name —
- * the tab sits in the header, the submit in the bottom half) and confirm
- * the run actually started (Cancel appears). */
- async clickCreate(page) {
- const clicked = await page.evaluate(() => {
- const b = [...document.querySelectorAll('button')].find(
- (x) => (x.textContent || '').trim() === 'Create' && !x.disabled &&
- x.getBoundingClientRect().y > 200,
- )
- if (!b) return false
- b.click()
- return true
- })
- if (!clicked) throw new Error('composer Create button not found or disabled')
- const t0 = Date.now()
- for (;;) {
- const started = await page.evaluate(() => {
- const cancel = [...document.querySelectorAll('button')].some(
- (b) => (b.textContent || '').trim() === 'Cancel',
- )
- const err = [...document.querySelectorAll('div,p,span')].find(
- (n) => n.children.length === 0 &&
- /failed|error|not supported|invalid|exceeded|too large|rejected|denied/i.test(n.textContent || '') &&
- (n.textContent || '').length < 220,
- )
- return { cancel, err: err ? err.textContent.trim().slice(0, 200) : null }
- })
- if (started.cancel) return
- if (started.err) throw new Error(`run rejected: ${started.err}`)
- if (Date.now() - t0 > 12_000) return // fast run may already be done; waitDone decides
- await page.waitForTimeout(250)
- }
- },
-
- /** Click any button by exact-or-contained text (topmost match). */
- async clickButton(page, text) {
- const ok = await page.evaluate((t) => {
- const b = [...document.querySelectorAll('button')].find(
- (x) => (x.textContent || '').trim().includes(t) && !x.disabled,
- )
- if (!b) return false
- b.click()
- return true
- }, text)
- if (!ok) throw new Error(`button "${text}" not found`)
- await page.waitForTimeout(600)
- },
-
- /** Wait until the run finished: Cancel gone again + a media element whose
- * src is NOT in `baseline` exists. Returns that new src. */
- async waitDone(page, selector, { baseline = [], timeoutMs = 10 * 60_000 } = {}) {
- const base = new Set(baseline)
- const t0 = Date.now()
- for (;;) {
- const st = await page.evaluate((sel) => {
- const cancel = [...document.querySelectorAll('button')].some(
- (b) => (b.textContent || '').trim() === 'Cancel',
- )
- const srcs = [...document.querySelectorAll(sel)]
- .map((m) => m.currentSrc || m.src || '')
- .filter((u) => /^(https?|blob):/.test(u))
- const err = [...document.querySelectorAll('div,p,span')].find(
- (n) => n.children.length === 0 &&
- /failed|error|not supported|invalid|exceeded|too large|rejected|denied/i.test(n.textContent || '') &&
- (n.textContent || '').length < 220,
- )
- return { cancel, srcs, err: err ? err.textContent.trim().slice(0, 200) : null }
- }, selector)
- const fresh = st.srcs.find((u) => !base.has(u))
- if (fresh && !st.cancel) return fresh
- if (!st.cancel && st.err && Date.now() - t0 > 20_000) throw new Error(`run failed: ${st.err}`)
- if (Date.now() - t0 > timeoutMs) throw new Error('run timed out')
- await page.waitForTimeout(2500)
- }
- },
-
- /** Download a result URL from INSIDE the page (carries the session's auth
- * and also handles blob: URLs) and write it to takeDir. */
- async saveResult(page, url, takeDir, ext, basename = 'result') {
- const b64 = await page.evaluate(async (u) => {
- const res = await fetch(u)
- const buf = await res.arrayBuffer()
- let s = ''
- const bytes = new Uint8Array(buf)
- const chunk = 0x8000
- for (let i = 0; i < bytes.length; i += chunk) {
- s += String.fromCharCode(...bytes.subarray(i, i + chunk))
- }
- return btoa(s)
- }, url)
- const file = path.join(takeDir, `${basename}${ext}`)
- fs.writeFileSync(file, Buffer.from(b64, 'base64'))
- return file
- },
-
- /** Set a hidden <input type=file> whose accept matches, via Playwright.
- * `multiple: true` targets the multi-file input (the Character-Studio
- * training board); default prefers a single-file input. */
- async setFile(page, acceptRe, files, { multiple = false } = {}) {
- const handle = await page.evaluateHandle((args) => {
- const rx = new RegExp(args.re, 'i')
- const ins = [...document.querySelectorAll('input[type="file"]')].filter((i) => rx.test(i.accept || ''))
- return args.multiple
- ? ins.find((i) => i.multiple)
- : (ins.find((i) => !i.multiple) ?? ins[0])
- }, { re: acceptRe.source, multiple })
- const el = handle.asElement()
- if (!el) throw new Error(`no file input matching ${acceptRe}${multiple ? ' (multiple)' : ''}`)
- await el.setInputFiles(files)
- await page.waitForTimeout(800)
- },
-
- /** Newest result.* from a previous take of `fn` (the t2i output feeds the
- * upscale + eraser runs). */
- priorResult(fn) {
- const dir = path.resolve(path.dirname(new URL(import.meta.url).pathname.replace(/^\/(\w:)/, '$1')), '..', '..', 'assets-src', 'teasers-raw', fn)
- if (!fs.existsSync(dir)) throw new Error(`no takes for "${fn}" yet, record it first`)
- const takes = fs.readdirSync(dir).filter((d) => d.startsWith('take-')).sort().reverse()
- for (const t of takes) {
- const hit = fs.readdirSync(path.join(dir, t)).find((f) => f.startsWith('result.'))
- if (hit) return path.join(dir, t, hit)
- }
- throw new Error(`no result.* in any "${fn}" take, record it first`)
- },
-
- /** A named file from the newest prep take (portraits / driving clip that the
- * lipsync, motion and character takes reuse). */
- prepFile(name) {
- const dir = path.resolve(path.dirname(new URL(import.meta.url).pathname.replace(/^\/(\w:)/, '$1')), '..', '..', 'assets-src', 'teasers-raw', 'prep')
- if (!fs.existsSync(dir)) throw new Error('no prep take yet, run --fn=prep first')
- const takes = fs.readdirSync(dir).filter((d) => d.startsWith('take-')).sort().reverse()
- for (const t of takes) {
- const p = path.join(dir, t, name)
- if (fs.existsSync(p)) return p
- }
- throw new Error(`"${name}" not found in any prep take`)
- },
-}
-
-const h = helpers
-
-export const FLOWS = {
- /** Classic t2i on the deployed lane, cheapest model — also produces the
- * source image the upscale + eraser takes reuse. */
- async image({ page, mark, takeDir }) {
- await h.nav(page, 'Create')
- await h.pickIntent(page, 'Image')
- await h.ensureModel(page, /flux.?schnell/i)
- await h.typePrompt(page, 'a single red balloon in the center of the sky above a calm lake at sunrise')
- const before = await h.credits(page)
- const baseline = await h.mediaSrcs(page, 'img')
- mark('create-clicked')
- await h.clickCreate(page)
- const src = await h.waitDone(page, 'img', { baseline, timeoutMs: 4 * 60_000 })
- mark('render-done')
- await page.waitForTimeout(3000)
- const saved = await h.saveResult(page, src, takeDir, '.png')
- const after = await h.credits(page)
- console.log(JSON.stringify({ credits: { before, after }, src: src.slice(0, 120), saved }))
- return {}
- },
-
- /** Utility op: image upscale to 2K (no model, no prompt). */
- async upscale({ page, mark, takeDir }) {
- const input = h.priorResult('image')
- await h.nav(page, 'Create')
- await h.pickIntent(page, 'Upscale')
- await h.setFile(page, /image/i, [input])
- await h.clickButton(page, '2K')
- const before = await h.credits(page)
- const baseline = await h.mediaSrcs(page, 'img')
- mark('create-clicked')
- await h.clickCreate(page)
- const src = await h.waitDone(page, 'img', { baseline, timeoutMs: 4 * 60_000 })
- mark('render-done')
- await page.waitForTimeout(3000)
- const saved = await h.saveResult(page, src, takeDir, '.png')
- const after = await h.credits(page)
- console.log(JSON.stringify({ credits: { before, after }, src: src.slice(0, 120), saved }))
- return { inputCopy: input }
- },
-
- /** Utility op: object eraser — paint a mask over the balloon, then run. */
- async eraser({ page, mark, takeDir }) {
- const input = h.priorResult('image')
- await h.nav(page, 'Create')
- await h.pickIntent(page, 'Erase Object')
- await h.setFile(page, /image/i, [input])
- await h.clickButton(page, 'Paint mask')
- await page.waitForTimeout(900)
- // Paint strokes over the upper-center region (where the balloon is):
- // real mouse drags on the visible canvas stack, exactly like a user.
- const box = await page.evaluate(() => {
- const cs = [...document.querySelectorAll('canvas')]
- const top = cs[cs.length - 1]
- if (!top) return null
- const r = top.getBoundingClientRect()
- return { x: r.x, y: r.y, w: r.width, h: r.height }
- })
- if (!box) throw new Error('mask canvas not found')
- // Two regions: the balloon + string (upper center) and its reflection in
- // the lake (lower center) — leaving the mirror image would look broken.
- const paint = async (x0, x1, y0, y1, rows) => {
- for (let row = 0; row < rows; row += 1) {
- const y = box.y + box.h * (y0 + ((y1 - y0) * row) / (rows - 1))
- await page.mouse.move(box.x + box.w * x0, y)
- await page.mouse.down()
- for (let s = 0; s <= 10; s += 1) {
- await page.mouse.move(box.x + box.w * (x0 + ((x1 - x0) / 10) * s), y, { steps: 2 })
- await page.waitForTimeout(14)
- }
- await page.mouse.up()
- await page.waitForTimeout(70)
- }
- }
- await paint(0.38, 0.63, 0.22, 0.58, 9)
- await paint(0.39, 0.60, 0.76, 0.94, 5)
- await h.clickButton(page, 'Apply mask')
- await page.waitForTimeout(600)
- const before = await h.credits(page)
- const baseline = await h.mediaSrcs(page, 'img')
- mark('create-clicked')
- await h.clickCreate(page)
- const src = await h.waitDone(page, 'img', { baseline, timeoutMs: 4 * 60_000 })
- mark('render-done')
- await page.waitForTimeout(3000)
- const saved = await h.saveResult(page, src, takeDir, '.png')
- const after = await h.credits(page)
- console.log(JSON.stringify({ credits: { before, after }, src: src.slice(0, 120), saved }))
- return { inputCopy: input }
- },
-
- /** Classic t2v, cheapest clip model on the deployed lane. */
- async video({ page, mark, takeDir }) {
- await h.nav(page, 'Create')
- await h.pickIntent(page, 'Video')
- await h.ensureModel(page, /ltx/i)
- await h.typePrompt(page, 'a wave breaking on rocks in slow motion, golden hour')
- const before = await h.credits(page)
- const baseline = await h.mediaSrcs(page, 'video')
- mark('create-clicked')
- await h.clickCreate(page)
- const src = await h.waitDone(page, 'video', { baseline })
- mark('render-done')
- await page.waitForTimeout(3500)
- const saved = await h.saveResult(page, src, takeDir, '.mp4')
- const after = await h.credits(page)
- console.log(JSON.stringify({ credits: { before, after }, src: src.slice(0, 120), saved }))
- return {}
- },
-
- /** Music (ace-step, 5 s) on the ops-aware catalog (?v=2, live since the
- * 2026-07-18 deploy) — also proves the per-second music billing. */
- async music({ page, mark, takeDir }) {
- await h.nav(page, 'Create')
- await h.pickIntent(page, 'Music')
- await h.setSlider(page, 5)
- await h.ensureModel(page, /ace.?step/i)
- await h.typePrompt(page, 'dreamy lofi hip hop, vinyl crackle, mellow keys')
- const before = await h.credits(page)
- const baseline = await h.mediaSrcs(page, 'audio')
- await page.waitForTimeout(600)
- mark('create-clicked')
- await h.clickCreate(page)
- const src = await h.waitDone(page, 'audio', { baseline })
- mark('render-done')
- await page.waitForTimeout(3500)
- const saved = await h.saveResult(page, src, takeDir, '.mp3')
- const after = await h.credits(page)
- console.log(JSON.stringify({ credits: { before, after }, src: src.slice(0, 120), saved }))
- return {}
- },
-
- /** Prep run (not turned into a teaser): renders the reusable inputs — four
- * portraits of one consistent character (the lipsync/motion portrait + the
- * Character-Studio training set) and one dancing clip (the extend source in
- * the gallery + the motion driving video). Cheapest models throughout. */
- async prep({ page, mark, takeDir }) {
- await h.nav(page, 'Create')
- const BASE = 'a woman in her 30s with short silver hair, freckles and green eyes, wearing a dark turtleneck'
- const SHOTS = [
- `studio portrait of ${BASE}, soft key light, looking at camera`,
- `portrait of ${BASE}, smiling, warm cafe light`,
- `side profile portrait of ${BASE}, window light`,
- `outdoor portrait of ${BASE}, golden hour, shallow depth of field`,
- ]
- const t0 = await h.credits(page)
- for (const [i, prompt] of SHOTS.entries()) {
- await h.pickIntent(page, 'Image')
- if (i === 0) await h.ensureModel(page, /flux.?schnell/i)
- const ta = page.locator('textarea').first()
- await ta.click()
- await ta.fill('')
- await ta.pressSequentially(prompt, { delay: 4 })
- const baseline = await h.mediaSrcs(page, 'img')
- mark(`portrait-${i + 1}`)
- await h.clickCreate(page)
- const src = await h.waitDone(page, 'img', { baseline, timeoutMs: 4 * 60_000 })
- await h.saveResult(page, src, takeDir, '.png', `portrait-${i + 1}`)
- }
- // The driving/extend clip: a full-body dance so the motion models have an
- // actual pose performance to transfer.
- await h.pickIntent(page, 'Video')
- await h.ensureModel(page, /ltx/i)
- const ta = page.locator('textarea').first()
- await ta.click()
- await ta.fill('')
- await ta.pressSequentially('a young woman dancing in a bright studio, full body shot, smooth flowing motion', { delay: 4 })
- const baseline = await h.mediaSrcs(page, 'video')
- mark('dance-clip')
- await h.clickCreate(page)
- const src = await h.waitDone(page, 'video', { baseline })
- await page.waitForTimeout(3000)
- await h.saveResult(page, src, takeDir, '.mp4', 'dance')
- const t1 = await h.credits(page)
- console.log(JSON.stringify({ credits: { before: t0, after: t1 } }))
- return {}
- },
-
- /** Talking character: photo avatar + a voice MADE IN-FLOW via the qwen3-tts
- * maker (proves the tts lane too), then the lipsync render. */
- async lipsync({ page, mark, takeDir }) {
- const portrait = h.prepFile('portrait-1.png')
- await h.nav(page, 'Create')
- await h.pickIntent(page, 'Talking Character')
- // cheapest live lipsync: p-video-avatar 2500 (infinitetalk-fast is 7500)
- await h.ensureModel(page, /p.?video avatar/i)
- await h.setFile(page, /image/i, [portrait])
- const beforeTts = await h.credits(page)
- await h.clickButton(page, 'Add voice')
- await h.clickButton(page, 'Generate a voice (AI)')
- await h.typeInto(page, 'What should the character say', 'Hey there! Welcome to LU Cloud. Let me show you around.')
- mark('make-voice')
- await h.clickButton(page, 'Make voice')
- // The tts run flips isGenerating; done when Cancel is gone and the voice
- // chip carries the pick (makeVoice wires voiceFromJob itself).
- const t0 = Date.now()
- for (;;) {
- const st = await page.evaluate(() => ({
- cancel: [...document.querySelectorAll('button')].some((b) => (b.textContent || '').trim() === 'Cancel'),
- picked: /Generated audio|Hey there/.test(document.body.textContent || ''),
- }))
- if (!st.cancel && st.picked) break
- if (Date.now() - t0 > 5 * 60_000) throw new Error('voice make timed out')
- await page.waitForTimeout(1500)
- }
- const afterTts = await h.credits(page)
- // lipsync has no prompt field — portrait + voice are the whole input
- const before = await h.credits(page)
- const baseline = await h.mediaSrcs(page, 'video')
- mark('create-clicked')
- await h.clickCreate(page)
- const src = await h.waitDone(page, 'video', { baseline, timeoutMs: 20 * 60_000 })
- mark('render-done')
- await page.waitForTimeout(3500)
- const saved = await h.saveResult(page, src, takeDir, '.mp4')
- const after = await h.credits(page)
- console.log(JSON.stringify({ credits: { tts: { beforeTts, afterTts }, lipsync: { before, after } }, src: src.slice(0, 120), saved }))
- return { inputCopy: portrait }
- },
-
- /** Extend: pick the dance clip rendered on this account and continue it. */
- async extend({ page, mark, takeDir }) {
- const dance = h.prepFile('dance.mp4')
- await h.nav(page, 'Create')
- await h.pickIntent(page, 'Extend Video')
- // cheapest live extend: pixverse 2500 (ltx 10000, wan spicy 15000)
- await h.ensureModel(page, /pixverse/i)
- await h.clickButton(page, 'Pick one of your cloud videos')
- await page.waitForTimeout(600)
- await h.clickButton(page, 'dancing')
- await h.typePrompt(page, 'she keeps dancing as the camera slowly circles around her')
- const before = await h.credits(page)
- const baseline = await h.mediaSrcs(page, 'video')
- mark('create-clicked')
- await h.clickCreate(page)
- const src = await h.waitDone(page, 'video', { baseline, timeoutMs: 20 * 60_000 })
- mark('render-done')
- await page.waitForTimeout(3500)
- const saved = await h.saveResult(page, src, takeDir, '.mp4')
- const after = await h.credits(page)
- console.log(JSON.stringify({ credits: { before, after }, src: src.slice(0, 120), saved }))
- return { inputCopy: dance }
- },
-
- /** Motion control: portrait + the dance clip as the driving performance. */
- async motion({ page, mark, takeDir }) {
- const portrait = h.prepFile('portrait-1.png')
- const dance = h.prepFile('dance.mp4')
- // the teaser composites the driving clip as a PiP next to the result
- fs.copyFileSync(dance, path.join(takeDir, 'driving.mp4'))
- await h.nav(page, 'Create')
- await h.pickIntent(page, 'Motion Control')
- // cheapest live motion: p-video-animate 3000 (dreamactor 5000, wan/steady 20000)
- await h.ensureModel(page, /p.?video animate/i)
- await h.setFile(page, /image/i, [portrait])
- await h.setFile(page, /video/i, [dance])
- // motion has no prompt field — image + driving clip are the whole input
- const before = await h.credits(page)
- const baseline = await h.mediaSrcs(page, 'video')
- mark('create-clicked')
- await h.clickCreate(page)
- const src = await h.waitDone(page, 'video', { baseline, timeoutMs: 20 * 60_000 })
- mark('render-done')
- await page.waitForTimeout(3500)
- const saved = await h.saveResult(page, src, takeDir, '.mp4')
- const after = await h.credits(page)
- console.log(JSON.stringify({ credits: { before, after }, src: src.slice(0, 120), saved }))
- return { inputCopy: portrait }
- },
-
- /** Character Studio, full lane: train a Flux LoRA on the four prep
- * portraits (cheapest IMAGE trainer live: flux 100000; the 35000 one is the
- * LTX video trainer whose character can't feed the image teaser), then
- * generate two scenes with the fresh character for the image cuts. */
- async character({ page, mark, takeDir }) {
- const photos = [1, 2, 3, 4].map((i) => h.prepFile(`portrait-${i}.png`))
- await h.nav(page, 'Create')
- await h.pickIntent(page, 'Character Studio')
- await h.clickButton(page, 'Train new')
- await h.ensureModel(page, /flux character training/i)
- await h.typeInto(page, 'Trigger word', 'lumi')
- await h.setFile(page, /image/i, photos, { multiple: true })
- const beforeTrain = await h.credits(page)
- mark('create-clicked')
- await h.clickCreate(page)
- // Training yields a shelf entry, not a media item: done when the run ended
- // and the store flipped to the use-surface with the fresh character chip.
- const t0 = Date.now()
- for (;;) {
- const st = await page.evaluate(() => {
- const cancel = [...document.querySelectorAll('button')].some((b) => (b.textContent || '').trim() === 'Cancel')
- const chip = [...document.querySelectorAll('button')].some((b) => /lumi/.test(b.textContent || ''))
- const err = [...document.querySelectorAll('div,p,span')].find(
- (n) => n.children.length === 0 &&
- /failed|error|not supported|invalid|exceeded|too large|rejected|denied/i.test(n.textContent || '') &&
- (n.textContent || '').length < 220,
- )
- return { cancel, chip, err: err ? err.textContent.trim().slice(0, 200) : null }
- })
- if (!st.cancel && st.chip) break
- if (!st.cancel && st.err && Date.now() - t0 > 30_000) throw new Error(`training failed: ${st.err}`)
- // 45 min: take-03 hit the 30 min cap while the render worker restarted
- // mid-train (deploy window) — the job refunded, the client just waited.
- if (Date.now() - t0 > 45 * 60_000) throw new Error('training timed out')
- if (Math.floor((Date.now() - t0) / 120_000) !== Math.floor((Date.now() - t0 - 4000) / 120_000)) {
- console.log(`[character] training wait ${Math.round((Date.now() - t0) / 60_000)}min, cancel=${st.cancel}`)
- }
- await page.waitForTimeout(4000)
- }
- mark('trained')
- const afterTrain = await h.credits(page)
- // Generate two scenes with the character (the use-surface is active now).
- await h.clickButton(page, 'lumi')
- const scenes = [
- 'lumi drinking coffee in a paris cafe, golden morning light',
- 'lumi hiking on a mountain ridge at sunset, wide shot',
- ]
- const gens = []
- for (const [i, prompt] of scenes.entries()) {
- const ta = page.locator('textarea').first()
- await ta.click()
- await ta.fill('')
- await ta.pressSequentially(prompt, { delay: 10 })
- const baseline = await h.mediaSrcs(page, 'img')
- mark(`gen-${i + 1}`)
- await h.clickCreate(page)
- const src = await h.waitDone(page, 'img', { baseline, timeoutMs: 6 * 60_000 })
- await page.waitForTimeout(2500)
- gens.push(await h.saveResult(page, src, takeDir, '.png', i === 0 ? 'result' : `result-${i + 1}`))
- }
- mark('render-done')
- const after = await h.credits(page)
- console.log(JSON.stringify({ credits: { train: { beforeTrain, afterTrain }, final: after }, gens }))
- return { inputCopy: photos[0] }
- },
-}
diff --git a/scripts/teasers/manifests/character.json b/scripts/teasers/manifests/character.json
deleted file mode 100644
index 95475961..00000000
--- a/scripts/teasers/manifests/character.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "title": "Character Studio",
- "tagline": "Train your character once, use it anywhere",
- "caption": "Trained and rendered on LU Cloud",
- "flow": { "take": "assets-src/teasers-raw/character/take-01", "preClick": 8, "postDone": 2 },
- "result": { "type": "image-cuts", "cuts": ["input.png", "result.png", "result-2.png"] }
-}
diff --git a/scripts/teasers/manifests/eraser.json b/scripts/teasers/manifests/eraser.json
deleted file mode 100644
index 21016619..00000000
--- a/scripts/teasers/manifests/eraser.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "title": "Erase Object",
- "tagline": "Paint over it. Gone.",
- "caption": "Object removed on LU Cloud",
- "flow": { "take": "assets-src/teasers-raw/eraser/take-01", "preClick": 6, "postDone": 2 },
- "result": {
- "type": "image-compare",
- "before": "input.png",
- "after": "result.png",
- "beforeTag": "Before",
- "afterTag": "After"
- }
-}
diff --git a/scripts/teasers/manifests/extend.json b/scripts/teasers/manifests/extend.json
deleted file mode 100644
index 7b8f85b3..00000000
--- a/scripts/teasers/manifests/extend.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "title": "Extend Video",
- "tagline": "Your clip keeps going",
- "caption": "Extended on LU Cloud",
- "flow": { "take": "assets-src/teasers-raw/extend/take-01", "preClick": 6, "postDone": 2 },
- "result": { "type": "video-extend", "video": "result.mp4", "boundaryPct": 49 }
-}
diff --git a/scripts/teasers/manifests/lipsync.json b/scripts/teasers/manifests/lipsync.json
deleted file mode 100644
index eaaff949..00000000
--- a/scripts/teasers/manifests/lipsync.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "title": "Talking Character",
- "tagline": "Give any photo a voice",
- "caption": "Voiced and lipsynced on LU Cloud",
- "flow": { "take": "assets-src/teasers-raw/lipsync/take-02", "preClick": 8, "postDone": 2 },
- "result": { "type": "video", "video": "result.mp4" }
-}
diff --git a/scripts/teasers/manifests/motion.json b/scripts/teasers/manifests/motion.json
deleted file mode 100644
index bfedcc42..00000000
--- a/scripts/teasers/manifests/motion.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "title": "Motion Control",
- "tagline": "Your character, any dance",
- "caption": "Motion transfer on LU Cloud",
- "flow": { "take": "assets-src/teasers-raw/motion/take-02", "preClick": 6, "postDone": 2 },
- "result": { "type": "video-pip", "video": "result.mp4", "pip": "driving.mp4" }
-}
diff --git a/scripts/teasers/manifests/music.json b/scripts/teasers/manifests/music.json
deleted file mode 100644
index 7c5837a5..00000000
--- a/scripts/teasers/manifests/music.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "title": "Music",
- "tagline": "Full tracks from a text prompt",
- "caption": "Composed on LU Cloud",
- "flow": { "take": "assets-src/teasers-raw/music/take-01", "preClick": 6, "postDone": 2 },
- "result": { "type": "audio-waveform", "audio": "result.mp3" }
-}
diff --git a/scripts/teasers/manifests/upscale.json b/scripts/teasers/manifests/upscale.json
deleted file mode 100644
index 82eea10b..00000000
--- a/scripts/teasers/manifests/upscale.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "title": "Upscale",
- "tagline": "Sharper images, up to 8K",
- "caption": "Upscaled to 2K on LU Cloud",
- "flow": { "take": "assets-src/teasers-raw/upscale/take-01", "preClick": 6, "postDone": 2 },
- "result": {
- "type": "image-compare",
- "before": "input.png",
- "after": "result.png",
- "beforeTag": "Source",
- "afterTag": "2K"
- }
-}
diff --git a/scripts/teasers/record.mjs b/scripts/teasers/record.mjs
deleted file mode 100644
index dba91dd0..00000000
--- a/scripts/teasers/record.mjs
+++ /dev/null
@@ -1,99 +0,0 @@
-// Teaser take recorder: attaches to the running desktop exe over CDP
-// (WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS=--remote-debugging-port=9222),
-// captures a JPEG frame stream via Page.startScreencast and drives the
-// requested Create flow. Output contract per take (consumed by render.mjs):
-// assets-src/teasers-raw/<fn>/take-NN/
-// f_000001.jpg ... repaint-driven frames
-// frames.json { frames:[{i,t}], markers:[{name,t}], viewport }
-// input.* / result.* the media that went in / came out
-//
-// Usage: node scripts/teasers/record.mjs --fn=music [--take=01] [--no-drive]
-// Flow drivers live in flows.mjs; --no-drive just records until Ctrl+C.
-
-import fs from 'node:fs'
-import path from 'node:path'
-import { fileURLToPath } from 'node:url'
-import { createRequire } from 'node:module'
-
-const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..')
-const require = createRequire(path.join(ROOT, 'package.json'))
-const { chromium } = require('@playwright/test')
-
-const arg = (name, fallback) => {
- const hit = process.argv.find((a) => a.startsWith(`--${name}=`))
- return hit ? hit.split('=')[1] : fallback
-}
-const FN = arg('fn')
-if (!FN) { console.error('need --fn=<intent>'); process.exit(1) }
-const TAKE = arg('take', '01')
-const DRIVE = !process.argv.includes('--no-drive')
-
-const takeDir = path.join(ROOT, 'assets-src', 'teasers-raw', FN, `take-${TAKE}`)
-fs.mkdirSync(takeDir, { recursive: true })
-
-const browser = await chromium.connectOverCDP('http://127.0.0.1:9222')
-const ctx = browser.contexts()[0]
-const page = ctx.pages().find((p) => p.url().includes('tauri.localhost'))
-if (!page) { console.error('app page not found on :9222'); process.exit(1) }
-const cdp = await ctx.newCDPSession(page)
-
-// The Tauri window is transparent:true; force an opaque app-canvas background
-// so JPEG frames never composite garbage into the rounded corners.
-await cdp.send('Emulation.setDefaultBackgroundColorOverride', {
- color: { r: 32, g: 32, b: 32, a: 255 },
-})
-
-const meta = {
- frames: [],
- markers: [],
- viewport: await page.evaluate(() => ({
- w: window.innerWidth, h: window.innerHeight, dpr: window.devicePixelRatio,
- })),
-}
-let i = 0
-cdp.on('Page.screencastFrame', ({ data, metadata, sessionId }) => {
- i += 1
- fs.writeFileSync(path.join(takeDir, `f_${String(i).padStart(6, '0')}.jpg`), Buffer.from(data, 'base64'))
- meta.frames.push({ i, t: metadata.timestamp })
- cdp.send('Page.screencastFrameAck', { sessionId }).catch(() => {})
-})
-await cdp.send('Page.startScreencast', {
- format: 'jpeg', quality: 85, maxWidth: 2560, maxHeight: 1600, everyNthFrame: 1,
-})
-const mark = (name) => {
- meta.markers.push({ name, t: Date.now() / 1000 })
- console.log(`[mark] ${name}`)
-}
-
-const finalize = async () => {
- try { await cdp.send('Page.stopScreencast') } catch { /* already gone */ }
- fs.writeFileSync(path.join(takeDir, 'frames.json'), JSON.stringify(meta))
- console.log(`take done: ${meta.frames.length} frames -> ${takeDir}`)
- await browser.close()
- process.exit(0)
-}
-process.on('SIGINT', finalize)
-
-if (DRIVE) {
- const { FLOWS } = await import('./flows.mjs')
- const flow = FLOWS[FN]
- if (!flow) { console.error(`no flow driver for ${FN} (flows.mjs)`); await finalize() }
- try {
- const out = await flow({ page, mark, takeDir })
- if (out?.resultUrl) {
- const res = await fetch(out.resultUrl)
- const buf = Buffer.from(await res.arrayBuffer())
- const ext = out.resultExt ?? path.extname(new URL(out.resultUrl).pathname) ?? '.bin'
- fs.writeFileSync(path.join(takeDir, `result${ext.startsWith('.') ? ext : `.${ext}`}`), buf)
- console.log(`result saved (${buf.length} bytes)`)
- }
- if (out?.inputCopy) {
- fs.copyFileSync(out.inputCopy, path.join(takeDir, `input${path.extname(out.inputCopy)}`))
- }
- } catch (err) {
- console.error('flow failed:', err)
- }
- await finalize()
-} else {
- console.log('recording... Ctrl+C to stop')
-}
diff --git a/scripts/teasers/render.mjs b/scripts/teasers/render.mjs
deleted file mode 100644
index 5cc7506b..00000000
--- a/scripts/teasers/render.mjs
+++ /dev/null
@@ -1,220 +0,0 @@
-// Teaser renderer: takes a recorded take (frames.json + JPEGs + result media),
-// composes the 12s motion template deterministically (frame-stepped __SEEK in
-// a Playwright-launched chromium, viewport 640x360 @2x = 1280x720 masters)
-// and encodes the final VP9/Opus webm + webp poster into public/teasers/.
-//
-// Usage: node scripts/teasers/render.mjs --fn=music
-// Manifest: scripts/teasers/manifests/<fn>.json
-
-import fs from 'node:fs'
-import path from 'node:path'
-import { spawnSync } from 'node:child_process'
-import { fileURLToPath, pathToFileURL } from 'node:url'
-import { createRequire } from 'node:module'
-
-const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..')
-const require = createRequire(path.join(ROOT, 'package.json'))
-const { chromium } = require('@playwright/test')
-
-const FFMPEG = process.env.FFMPEG ?? 'C:\\ffmpeg\\bin\\ffmpeg.exe'
-const FPS = 30
-const FRAMES = 360 // 12.0s
-const S1 = { from: 1.4, to: 6.8, splitA: 3.2 } // virtual flow window, A=pre-click
-const S2 = { from: 6.6, to: 10.8, playFrom: 6.9 }
-
-const arg = (name, fallback) => {
- const hit = process.argv.find((a) => a.startsWith(`--${name}=`))
- return hit ? hit.split('=')[1] : fallback
-}
-const FN = arg('fn')
-if (!FN) { console.error('need --fn=<intent>'); process.exit(1) }
-
-const manifest = JSON.parse(fs.readFileSync(path.join(ROOT, 'scripts', 'teasers', 'manifests', `${FN}.json`), 'utf8'))
-const takeDir = path.join(ROOT, manifest.flow.take)
-const scratch = path.join(ROOT, 'assets-src', 'teasers-scratch', FN)
-const framesOut = path.join(scratch, 'frames')
-fs.mkdirSync(framesOut, { recursive: true })
-const outDir = path.join(ROOT, 'public', 'teasers')
-fs.mkdirSync(outDir, { recursive: true })
-
-const ff = (args) => {
- const r = spawnSync(FFMPEG, ['-hide_banner', '-loglevel', 'error', ...args], { stdio: ['ignore', 'pipe', 'inherit'] })
- if (r.status !== 0) throw new Error(`ffmpeg failed: ${args.join(' ')}`)
- return r
-}
-const furl = (p) => pathToFileURL(p).href
-const findFile = (dir, base) => {
- const hit = fs.readdirSync(dir).find((f) => f.startsWith(base + '.'))
- return hit ? path.join(dir, hit) : null
-}
-
-// ── 1. flow mapping (virtual t -> source JPEG) ──────────────────────────────
-const meta = JSON.parse(fs.readFileSync(path.join(takeDir, 'frames.json'), 'utf8'))
-const srcFrames = meta.frames
-const markers = Object.fromEntries(meta.markers.map((m) => [m.name, m.t]))
-const tClick = markers['create-clicked'] ?? srcFrames[Math.floor(srcFrames.length / 2)].t
-const tDone = markers['render-done'] ?? srcFrames[srcFrames.length - 1].t
-const preClick = manifest.flow.preClick ?? 6
-const postDone = manifest.flow.postDone ?? 2
-
-const frameAt = (t) => {
- // last source frame with timestamp <= t (screencast frames are sparse)
- let lo = 0, hi = srcFrames.length - 1, ans = srcFrames[0]
- while (lo <= hi) {
- const mid = (lo + hi) >> 1
- if (srcFrames[mid].t <= t) { ans = srcFrames[mid]; lo = mid + 1 } else hi = mid - 1
- }
- return path.join(takeDir, `f_${String(ans.i).padStart(6, '0')}.jpg`)
-}
-const flowSrcByFrame = Array.from({ length: FRAMES }, (_, f) => {
- const t = f / FPS
- if (t < S1.from - 0.1 || t > S1.to + 0.1) return null
- const v = t - S1.from
- if (v <= S1.splitA) {
- const srcT = tClick - preClick + (v / S1.splitA) * preClick
- return furl(frameAt(Math.max(srcFrames[0].t, srcT)))
- }
- const vb = v - S1.splitA
- const spanB = S1.to - S1.from - S1.splitA
- const srcT = tDone - 0.5 + (vb / spanB) * (0.5 + postDone)
- return furl(frameAt(Math.min(srcFrames[srcFrames.length - 1].t, srcT)))
-})
-
-// ── 2. S2 assets ────────────────────────────────────────────────────────────
-const s2cfg = manifest.result
-const s2 = { type: s2cfg.type }
-const prepImage = (name) => {
- const src = path.join(takeDir, s2cfg[name])
- const out = path.join(scratch, `${name}.jpg`)
- if (!fs.existsSync(out) || fs.statSync(out).mtimeMs < fs.statSync(src).mtimeMs) {
- ff(['-y', '-i', src, '-vf', 'scale=1280:-2', '-q:v', '3', out])
- }
- return furl(out)
-}
-const extractSeq = (srcName, sub) => {
- const src = path.join(takeDir, srcName)
- const dir = path.join(scratch, sub)
- const stamp = path.join(dir, '.stamp')
- if (!fs.existsSync(stamp) || fs.statSync(stamp).mtimeMs < fs.statSync(src).mtimeMs) {
- fs.rmSync(dir, { recursive: true, force: true })
- fs.mkdirSync(dir, { recursive: true })
- ff(['-y', '-i', src, '-vf', `fps=${FPS},scale=1280:-2`, '-q:v', '3', path.join(dir, 'r_%05d.jpg')])
- fs.writeFileSync(stamp, '')
- }
- return fs.readdirSync(dir).filter((f) => f.endsWith('.jpg')).sort().map((f) => furl(path.join(dir, f)))
-}
-const seqByFrame = (seq) =>
- Array.from({ length: FRAMES }, (_, f) => {
- const t = f / FPS
- if (t < S2.from || t > S2.to) return null
- const idx = Math.max(0, Math.round((t - S2.playFrom) * FPS))
- return seq[seq.length ? idx % seq.length : 0] ?? seq[0]
- })
-
-if (s2.type === 'image-compare') {
- s2.before = prepImage('before')
- s2.after = prepImage('after')
- s2.beforeTag = s2cfg.beforeTag
- s2.afterTag = s2cfg.afterTag
-} else if (s2.type === 'image-crossfade') {
- s2.before = prepImage('before')
- s2.after = prepImage('after')
-} else if (s2.type === 'image-cuts') {
- const span = S2.to - S2.playFrom
- const n = s2cfg.cuts.length
- s2.cuts = s2cfg.cuts.map((file, i) => {
- const src = path.join(takeDir, file)
- const out = path.join(scratch, `cut${i}.jpg`)
- if (!fs.existsSync(out) || fs.statSync(out).mtimeMs < fs.statSync(src).mtimeMs) {
- ff(['-y', '-i', src, '-vf', 'scale=1280:-2', '-q:v', '3', out])
- }
- return { src: furl(out), from: S2.playFrom + (span * i) / n, to: S2.playFrom + (span * (i + 1)) / n }
- })
-} else if (s2.type === 'video' || s2.type === 'video-extend' || s2.type === 'video-pip') {
- s2.imgsByFrame = seqByFrame(extractSeq(s2cfg.video, 'result-seq'))
- if (s2.type === 'video-extend') s2.boundaryPct = s2cfg.boundaryPct ?? 50
- if (s2.type === 'video-pip') s2.pipByFrame = seqByFrame(extractSeq(s2cfg.pip, 'pip-seq'))
-} else if (s2.type === 'audio-waveform') {
- const audio = path.join(takeDir, s2cfg.audio)
- const raw = spawnSync(FFMPEG, ['-hide_banner', '-loglevel', 'error', '-i', audio, '-ac', '1', '-ar', '8000', '-f', 's16le', 'pipe:1'], { maxBuffer: 1 << 28 })
- if (raw.status !== 0) throw new Error('ffmpeg pcm decode failed')
- const pcm = raw.stdout
- const n = Math.floor(pcm.length / 2)
- const BUCKETS = 200
- const peaks = Array.from({ length: BUCKETS }, (_, b) => {
- const from = Math.floor((b * n) / BUCKETS), to = Math.floor(((b + 1) * n) / BUCKETS)
- let max = 0
- for (let i = from; i < to; i += 4) max = Math.max(max, Math.abs(pcm.readInt16LE(i * 2)))
- return max / 32768
- })
- s2.peaks = peaks
- s2.title = s2cfg.title ?? manifest.tagline
- // normalized 5.4s cut for the mux (starts at S2.from in the final clip)
- const cut = path.join(scratch, 'audio.flac')
- ff(['-y', '-ss', String(s2cfg.audioOffset ?? 0), '-t', '5.4', '-i', audio,
- '-af', 'loudnorm=I=-16:TP=-1.5:LRA=11,afade=t=in:st=0:d=0.5,afade=t=out:st=4.2:d=1.2', '-ar', '48000', cut])
- s2._audioCut = cut
-}
-
-// ── 3. frame-step capture ───────────────────────────────────────────────────
-const payload = {
- title: manifest.title,
- tagline: manifest.tagline,
- caption: manifest.caption,
- monogram: furl(path.join(ROOT, 'public', 'LU-monogram-white.png')),
- flowSrcByFrame,
- s2,
-}
-// Prefer whatever headless-shell revision is already on disk over forcing a
-// `playwright install` download; screenshot capture has no revision-sensitive
-// surface for this template.
-const findShell = () => {
- const base = path.join(process.env.LOCALAPPDATA ?? '', 'ms-playwright')
- try {
- const revs = fs.readdirSync(base).filter((d) => d.startsWith('chromium_headless_shell-')).sort()
- for (const rev of revs.reverse()) {
- const exe = path.join(base, rev, 'chrome-headless-shell-win64', 'chrome-headless-shell.exe')
- if (fs.existsSync(exe)) return exe
- }
- } catch { /* fall through to default resolution */ }
- return undefined
-}
-const shell = findShell()
-const browser = await chromium.launch(shell ? { executablePath: shell } : {})
-const page = await browser.newPage({ viewport: { width: 640, height: 360 }, deviceScaleFactor: 2 })
-await page.goto(furl(path.join(ROOT, 'scripts', 'teasers', 'template', 'template.html')))
-await page.evaluate((p) => window.__INIT(p), payload)
-await page.waitForFunction(() => window.__READY === true, null, { timeout: 60_000 })
-for (let f = 0; f < FRAMES; f++) {
- await page.evaluate((t) => window.__SEEK(t), f / FPS)
- await page.screenshot({ path: path.join(framesOut, `f_${String(f).padStart(5, '0')}.png`) })
- if (f % 60 === 0) console.log(`frame ${f}/${FRAMES}`)
-}
-await browser.close()
-
-// ── 4. encode ───────────────────────────────────────────────────────────────
-const outFile = path.join(outDir, `${FN}.webm`)
-const passlog = path.join(scratch, '2p')
-const encode = (bitrateK) => {
- const vf = ['-framerate', String(FPS), '-i', path.join(framesOut, 'f_%05d.png')]
- const venc = ['-c:v', 'libvpx-vp9', '-b:v', `${bitrateK}k`, '-maxrate', `${Math.round(bitrateK * 1.5)}k`,
- '-minrate', `${Math.round(bitrateK / 4)}k`, '-crf', '36', '-deadline', 'good', '-row-mt', '1',
- '-tile-columns', '1', '-g', '240', '-pix_fmt', 'yuv420p']
- ff(['-y', ...vf, '-pass', '1', '-passlogfile', passlog, ...venc, '-an', '-f', 'null', '-'])
- if (s2.type === 'audio-waveform') {
- ff(['-y', ...vf, '-itsoffset', String(S2.from), '-i', s2._audioCut, '-pass', '2', '-passlogfile', passlog,
- '-map', '0:v', '-map', '1:a', ...venc, '-c:a', 'libopus', '-b:a', '96k', '-shortest', outFile])
- } else {
- ff(['-y', ...vf, '-pass', '2', '-passlogfile', passlog, ...venc, '-an', outFile])
- }
- return fs.statSync(outFile).size
-}
-let size = encode(480)
-if (size > 870 * 1024) {
- const scaled = Math.max(200, Math.floor((480 * 800 * 1024) / size))
- console.log(`size ${Math.round(size / 1024)}KB over budget, retry at ${scaled}k`)
- size = encode(scaled)
-}
-ff(['-y', '-framerate', String(FPS), '-i', path.join(framesOut, 'f_%05d.png'),
- '-vf', "select=eq(n\\,20),scale=640:360", '-frames:v', '1', path.join(outDir, `${FN}-poster.webp`)])
-console.log(`OK ${FN}: ${Math.round(size / 1024)}KB -> ${outFile}`)
diff --git a/scripts/teasers/template/template.html b/scripts/teasers/template/template.html
deleted file mode 100644
index c0d01db0..00000000
--- a/scripts/teasers/template/template.html
+++ /dev/null
@@ -1,39 +0,0 @@
-<!doctype html>
-<!-- Teaser motion template. No CSS animations anywhere: render.mjs drives a
- virtual clock frame by frame via window.__SEEK(t) and screenshots each
- frame, so output is deterministic regardless of machine load. -->
-<html>
-<head>
- <meta charset="utf-8" />
- <link rel="stylesheet" href="theme.css" />
-</head>
-<body>
- <div id="root">
- <div id="glow"></div>
-
- <section id="s0" class="seg">
- <div class="inner">
- <div class="micro">LU Cloud</div>
- <div class="title"></div>
- <div class="underline"></div>
- <div class="tagline"></div>
- </div>
- </section>
-
- <section id="s1" class="seg">
- <div class="frame"><img alt="" /></div>
- <div class="caption"></div>
- </section>
-
- <section id="s2" class="seg"><div class="stage"></div></section>
-
- <section id="s3" class="seg">
- <div class="mark">
- <div class="ring"></div>
- <img alt="" />
- </div>
- </section>
- </div>
- <script src="template.js"></script>
-</body>
-</html>
diff --git a/scripts/teasers/template/template.js b/scripts/teasers/template/template.js
deleted file mode 100644
index 57928af8..00000000
--- a/scripts/teasers/template/template.js
+++ /dev/null
@@ -1,158 +0,0 @@
-// Deterministic teaser timeline. render.mjs calls __INIT(payload) once, waits
-// for __READY, then steps __SEEK(t) per output frame. All per-frame media
-// decisions (which source JPEG shows when) are precomputed in Node and arrive
-// as arrays indexed by output frame; this file only eases opacities and
-// transforms and swaps <img>.src.
-//
-// Timeline (12.0s @30fps): S0 title 0-1.6 · S1 flow 1.4-6.8 · S2 result
-// 6.6-10.8 · S3 outro 10.6-12.0; frame 359 matches frame 0 for a clean loop.
-
-/* global window, document */
-const $ = (sel) => document.querySelector(sel)
-const clamp01 = (x) => Math.max(0, Math.min(1, x))
-const easeOut = (x) => 1 - Math.pow(1 - clamp01(x), 3)
-const easeInOut = (x) => { const t = clamp01(x); return t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2 }
-// fade helper: in over [a,b], out over [c,d]
-const window01 = (t, a, b, c, d) => clamp01((t - a) / (b - a)) * (1 - clamp01((t - c) / (d - c)))
-
-let P = null // payload
-
-window.__INIT = async (payload) => {
- P = payload
- $('#s0 .title').textContent = payload.title
- $('#s0 .tagline').textContent = payload.tagline || ''
- $('#s1 .caption').textContent = payload.caption || ''
- $('#s3 img').src = payload.monogram
-
- const stage = $('#s2 .stage')
- stage.innerHTML = ''
- const s2 = payload.s2
- if (s2.type === 'image-compare') {
- stage.innerHTML = `
- <img class="fill before" /><img class="fill after" />
- <div class="divider"></div>
- <span class="tag" style="left:12px"></span>
- <span class="tag" style="right:12px"></span>
- <span class="pill">Generated with LU Cloud</span>`
- stage.querySelector('.before').src = s2.before
- stage.querySelector('.after').src = s2.after
- stage.querySelectorAll('.tag')[0].textContent = s2.beforeTag || 'Before'
- stage.querySelectorAll('.tag')[1].textContent = s2.afterTag || 'After'
- } else if (s2.type === 'image-crossfade') {
- stage.innerHTML = `
- <img class="fill before" /><img class="fill after" />
- <span class="pill">Generated with LU Cloud</span>`
- stage.querySelector('.before').src = s2.before
- stage.querySelector('.after').src = s2.after
- } else if (s2.type === 'image-cuts') {
- stage.innerHTML = `<img class="fill cut" /><span class="pill">Generated with LU Cloud</span>`
- } else if (s2.type === 'video' || s2.type === 'video-extend' || s2.type === 'video-pip') {
- stage.innerHTML = `<img class="fill vid" /><span class="pill">Generated with LU Cloud</span>`
- if (s2.type === 'video-extend') {
- stage.insertAdjacentHTML('beforeend', `
- <div class="timeline"><div class="orig"></div><div class="ext"></div></div>`)
- stage.querySelector('.orig').style.width = `${s2.boundaryPct}%`
- stage.querySelector('.ext').style.left = `${s2.boundaryPct}%`
- }
- if (s2.type === 'video-pip') {
- stage.insertAdjacentHTML('beforeend', `<div class="pip"><img /></div>`)
- }
- } else if (s2.type === 'audio-waveform') {
- const bars = (s2.peaks || []).map((p) => `<span style="height:${Math.max(3, Math.round(p * 150))}px"></span>`).join('')
- stage.innerHTML = `
- <div class="wtitle"></div>
- <div class="wave">${bars}</div>
- <div class="wavehead"></div>
- <span class="pill">Generated with LU Cloud</span>`
- stage.querySelector('.wtitle').textContent = s2.title || ''
- }
-
- // Preload every image the timeline will touch so seeking never races decode.
- const srcs = new Set()
- ;(payload.flowSrcByFrame || []).forEach((s) => s && srcs.add(s))
- ;(s2.imgsByFrame || []).forEach((s) => s && srcs.add(s))
- ;(s2.pipByFrame || []).forEach((s) => s && srcs.add(s))
- ;(s2.cuts || []).forEach((c) => srcs.add(c.src))
- ;[s2.before, s2.after, payload.monogram].forEach((s) => s && srcs.add(s))
- await Promise.all(
- [...srcs].map(
- (src) =>
- new Promise((res) => {
- const im = new Image()
- im.onload = res
- im.onerror = res
- im.src = src
- }),
- ),
- )
- window.__READY = true
-}
-
-window.__SEEK = (t) => {
- const f = Math.round(t * 30)
- const s2 = P.s2
-
- // S0 title card
- const s0 = window01(t, 0.05, 0.45, 1.35, 1.6)
- $('#s0').style.opacity = s0
- $('#s0 .underline').style.transform = `scaleX(${easeOut((t - 0.25) / 0.6)})`
- $('#s0 .title').style.transform = `translateY(${(1 - easeOut(t / 0.7)) * 8}px)`
-
- // S1 flow
- const s1 = window01(t, 1.4, 1.7, 6.55, 6.8)
- $('#s1').style.opacity = s1
- if (s1 > 0) {
- const src = P.flowSrcByFrame[Math.min(f, P.flowSrcByFrame.length - 1)]
- const img = $('#s1 img')
- if (src && img.getAttribute('src') !== src) img.src = src
- $('#s1 .frame').style.transform = `scale(${1 + 0.015 * easeInOut((t - 1.4) / 5.4)})`
- }
-
- // S2 result
- const s2op = window01(t, 6.6, 6.9, 10.55, 10.8)
- $('#s2').style.opacity = s2op
- if (s2op > 0) {
- const stage = $('#s2 .stage')
- if (s2.type === 'image-compare') {
- const x = 4 + 92 * easeInOut((t - 6.9) / 2.9)
- stage.querySelector('.after').style.clipPath = `inset(0 0 0 ${x}%)`
- stage.querySelector('.divider').style.left = `${x}%`
- } else if (s2.type === 'image-crossfade') {
- stage.querySelector('.before').style.opacity = 1 - easeInOut((t - 7.5) / 1.2)
- } else if (s2.type === 'image-cuts') {
- const cut = (s2.cuts || []).find((c) => t >= c.from && t < c.to) || s2.cuts[s2.cuts.length - 1]
- const img = stage.querySelector('.cut')
- if (img.getAttribute('src') !== cut.src) img.src = cut.src
- img.style.transform = `scale(${1.03 + 0.04 * clamp01((t - cut.from) / (cut.to - cut.from))})`
- } else if (s2.type === 'video' || s2.type === 'video-extend' || s2.type === 'video-pip') {
- const src = s2.imgsByFrame[Math.min(f, s2.imgsByFrame.length - 1)]
- const img = stage.querySelector('.vid')
- if (src && img.getAttribute('src') !== src) img.src = src
- if (s2.type === 'video-extend') {
- const prog = clamp01((t - 6.9) / 3.6)
- stage.querySelector('.ext').style.width = `${Math.max(0, prog * 100 - s2.boundaryPct) * (100 / (100 - s2.boundaryPct)) * ((100 - s2.boundaryPct) / 100)}%`
- }
- if (s2.type === 'video-pip') {
- const psrc = s2.pipByFrame[Math.min(f, s2.pipByFrame.length - 1)]
- const pimg = stage.querySelector('.pip img')
- if (psrc && pimg.getAttribute('src') !== psrc) pimg.src = psrc
- }
- } else if (s2.type === 'audio-waveform') {
- const prog = clamp01((t - 6.6) / 4.2)
- const x = 40 + (640 - 80) * prog
- stage.querySelector('.wavehead').style.left = `${x}px`
- const bars = stage.querySelectorAll('.wave span')
- const lit = Math.floor(prog * bars.length)
- bars.forEach((b, i) => {
- b.style.background = i <= lit ? '#a094f8' : 'rgba(255,255,255,0.22)'
- })
- }
- }
-
- // S3 outro
- const s3 = window01(t, 10.6, 10.95, 11.65, 12.0)
- $('#s3').style.opacity = s3
- $('#s3 .mark').style.transform = `scale(${0.85 + 0.15 * easeOut((t - 10.6) / 0.5)})`
- $('#s3 .ring').style.transform = `scale(${1 + 0.25 * easeInOut((t - 10.7) / 1.0)})`
- $('#s3 .ring').style.opacity = 1 - clamp01((t - 11.2) / 0.7)
-}
diff --git a/scripts/teasers/template/theme.css b/scripts/teasers/template/theme.css
deleted file mode 100644
index 2552256d..00000000
--- a/scripts/teasers/template/theme.css
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Teaser template theme: tokens copied from src/index.css so the clips look
- * like the app (accent #a094f8, canvas #1b1b1b, Inter/system stack). */
-* { margin: 0; padding: 0; box-sizing: border-box; }
-html, body { width: 640px; height: 360px; overflow: hidden; background: #1b1b1b; }
-body {
- font-family: 'Inter', system-ui, -apple-system, sans-serif;
- color: #f3f4f6;
- -webkit-font-smoothing: antialiased;
-}
-#root { position: relative; width: 640px; height: 360px; background: #1b1b1b; }
-#glow {
- position: absolute; inset: 0;
- background: radial-gradient(ellipse 420px 260px at 50% 42%, rgba(160, 148, 248, 0.10), transparent 70%);
-}
-.seg { position: absolute; inset: 0; opacity: 0; display: flex; align-items: center; justify-content: center; }
-
-/* S0 title card */
-#s0 .inner { text-align: center; }
-#s0 .micro { font-size: 10px; font-weight: 600; letter-spacing: 0.32em; color: #a094f8; text-transform: uppercase; }
-#s0 .title { margin-top: 10px; font-size: 34px; font-weight: 600; color: #ffffff; }
-#s0 .underline { margin: 14px auto 0; width: 120px; height: 2px; background: #a094f8; border-radius: 1px; transform-origin: 50% 50%; }
-#s0 .tagline { margin-top: 12px; font-size: 12.5px; color: #9ca3af; }
-
-/* S1 flow in a device frame */
-#s1 .frame {
- width: 560px; height: 280px; border-radius: 14px; overflow: hidden;
- background: #262626; border: 1px solid rgba(255, 255, 255, 0.08);
- box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
-}
-#s1 img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
-#s1 .caption {
- position: absolute; left: 0; right: 0; bottom: 12px; text-align: center;
- font-size: 11px; color: #9ca3af; letter-spacing: 0.02em;
-}
-
-/* S2 result stage */
-#s2 .stage { position: relative; width: 640px; height: 360px; overflow: hidden; background: #101010; }
-#s2 img.fill { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
-#s2 .divider { position: absolute; top: 0; bottom: 0; width: 2px; background: #a094f8; box-shadow: 0 0 12px rgba(160, 148, 248, 0.8); }
-#s2 .tag {
- position: absolute; top: 12px; padding: 3px 8px; border-radius: 999px;
- font-size: 10px; font-weight: 600; background: rgba(0, 0, 0, 0.55); color: #e5e7eb;
-}
-#s2 .pill {
- position: absolute; left: 14px; bottom: 14px; padding: 4px 10px; border-radius: 999px;
- font-size: 10px; font-weight: 500; color: #d6d0ff;
- background: rgba(160, 148, 248, 0.14); border: 1px solid rgba(160, 148, 248, 0.35);
-}
-#s2 .timeline { position: absolute; left: 40px; right: 40px; bottom: 34px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
-#s2 .timeline .orig { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255, 255, 255, 0.35); }
-#s2 .timeline .ext { position: absolute; top: 0; bottom: 0; background: #a094f8; }
-#s2 .pip {
- position: absolute; right: 14px; top: 14px; width: 128px; height: 72px; border-radius: 8px;
- overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.25); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
-}
-#s2 .pip img { width: 100%; height: 100%; object-fit: cover; }
-#s2 .wave { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 2px; padding: 0 40px; }
-#s2 .wave span { width: 2px; border-radius: 1px; background: rgba(255, 255, 255, 0.22); }
-#s2 .wavehead { position: absolute; top: 70px; bottom: 70px; width: 2px; background: #a094f8; box-shadow: 0 0 10px rgba(160, 148, 248, 0.9); }
-#s2 .wtitle { position: absolute; left: 0; right: 0; top: 44px; text-align: center; font-size: 13px; color: #e5e7eb; font-weight: 500; }
-
-/* S3 outro */
-#s3 .mark { position: relative; width: 84px; height: 84px; display: flex; align-items: center; justify-content: center; }
-#s3 img { width: 56px; height: 56px; }
-#s3 .ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(160, 148, 248, 0.55); }
diff --git a/src/components/cloud/CloudExampleModal.tsx b/src/components/cloud/CloudExampleModal.tsx
deleted file mode 100644
index fbcb51a1..00000000
--- a/src/components/cloud/CloudExampleModal.tsx
+++ /dev/null
@@ -1,149 +0,0 @@
-// Example video popup (2.5.8): the step between a teaser sheet's "See plans"
-// and the CloudGateModal. Shows a short looping clip of the tool actually
-// doing its thing (real footage from recorded cloud runs, produced by
-// scripts/teasers and shipped in public/teasers/<intent>.webm with a webp
-// poster). Only intent surfaces have clips; model-row teasers keep the
-// direct path to the gate. A missing or broken asset skips straight to the
-// gate so the flow never dead-ends on a black box.
-
-import { useEffect, useRef, useState } from 'react'
-import { AnimatePresence, motion } from 'framer-motion'
-import { X, Cloud, Sparkles, Volume2, VolumeX, MonitorDown } from 'lucide-react'
-import { useUIStore, type CloudTeaserTarget } from '../../stores/uiStore'
-import { useCreateStore, type CreateIntent } from '../../stores/createStore'
-import { isIntentAvailable } from '../create/experimental/intents'
-import { isMlxImageHost } from '../../api/mlx-image'
-
-type ExampleIntent = Extract<CloudTeaserTarget, { surface: 'intent' }>['intent']
-
-const TITLES: Record<ExampleIntent, string> = {
- upscale: 'Upscale',
- eraser: 'Erase Object',
- character: 'Character Studio',
- lipsync: 'Talking Character',
- music: 'Music',
- extend: 'Extend Video',
- motion: 'Motion Control',
-}
-
-export function CloudExampleModal() {
- const target = useUIStore((s) => s.cloudExampleVideo)
- const setTarget = useUIStore((s) => s.setCloudExampleVideo)
- const setCloudGateOpen = useUIStore((s) => s.setCloudGateOpen)
- const setIntent = useCreateStore((s) => s.setIntent)
- // Lanes that also run locally (2.5.8): the clip stays REAL CLOUD FOOTAGE
- // (David's call — the example always shows cloud), but the CTAs fork.
- // Same rule the IntentBar renders from, not a static op list — on the Mac
- // only MLX image/video run locally (MAC-2).
- const localLane =
- target && isIntentAvailable(target.intent as CreateIntent, 'local', isMlxImageHost())
- ? target.intent
- : null
- // The music clip carries the generated track; it still starts muted
- // (autoplay policy + not startling anyone) with a tap-to-listen toggle.
- const [muted, setMuted] = useState(true)
- const videoRef = useRef<HTMLVideoElement | null>(null)
- useEffect(() => { setMuted(true) }, [target?.intent])
- // React's `muted` attribute is unreliable on re-renders; set the property.
- useEffect(() => { if (videoRef.current) videoRef.current.muted = muted }, [muted, target])
-
- const close = () => setTarget(null)
- const toPlans = () => { setTarget(null); setCloudGateOpen(true) }
-
- return (
- <AnimatePresence>
- {target && (
- <motion.div
- initial={{ opacity: 0 }}
- animate={{ opacity: 1 }}
- exit={{ opacity: 0 }}
- className="fixed inset-0 z-[90] flex items-center justify-center bg-black/60 backdrop-blur-sm"
- onClick={close}
- >
- <motion.div
- initial={{ opacity: 0, y: 10, scale: 0.97 }}
- animate={{ opacity: 1, y: 0, scale: 1 }}
- exit={{ opacity: 0, y: 10, scale: 0.97 }}
- transition={{ duration: 0.15, ease: 'easeOut' }}
- onClick={(e) => e.stopPropagation()}
- className="w-[440px] max-w-[94vw] rounded-2xl bg-[#232323] border border-white/[0.08] shadow-2xl shadow-black/50 overflow-hidden"
- >
- {/* Clip stage: 16:9, poster paints instantly, clip loops. */}
- <div className="relative aspect-video bg-[#1b1b1b] border-b border-white/[0.06]">
- <video
- ref={videoRef}
- key={target.intent}
- className="w-full h-full object-cover"
- src={`/teasers/${target.intent}.webm`}
- poster={`/teasers/${target.intent}-poster.webp`}
- autoPlay
- muted
- loop
- playsInline
- onError={toPlans}
- />
- <button
- onClick={close}
- className="absolute top-2 right-2 p-1.5 rounded-md text-gray-400 hover:text-gray-100 bg-black/30 hover:bg-black/50 transition-colors"
- title="Close"
- aria-label="Close"
- >
- <X size={14} />
- </button>
- {target.intent === 'music' && (
- <button
- onClick={() => setMuted((m) => !m)}
- className="absolute bottom-2 right-2 flex items-center gap-1.5 px-2 py-1.5 rounded-md text-[0.62rem] text-gray-200 bg-black/40 hover:bg-black/60 transition-colors"
- aria-label={muted ? 'Unmute' : 'Mute'}
- >
- {muted ? <VolumeX size={13} /> : <Volume2 size={13} />}
- {muted ? 'Hear it' : 'Mute'}
- </button>
- )}
- </div>
-
- <div className="p-4 space-y-3">
- <div className="flex items-center gap-2">
- {/* Panel is fixed dark in both themes, so always use the dark
- tints; arbitrary text color dodges the `.light .text-white`
- remap (same rule as ModelTiles). */}
- <Cloud size={14} className="text-violet-300" />
- <h3 className="text-[0.85rem] font-semibold text-[#fafafa]">{TITLES[target.intent]}</h3>
- <span className="ml-auto text-[0.55rem] font-medium uppercase tracking-widest text-violet-300/80">
- LU Cloud
- </span>
- </div>
- <p className="text-[0.68rem] leading-relaxed text-gray-400">
- {localLane
- ? 'Real output, straight from LU Cloud. Run it there, or fully on your own PC.'
- : 'Real output, straight from LU Cloud. This is what the tool makes.'}
- </p>
- <div className="flex items-center gap-2 pt-1">
- <button
- onClick={toPlans}
- className="flex-1 flex items-center justify-center gap-1.5 h-8 rounded-lg bg-white text-black text-[0.7rem] font-semibold hover:bg-gray-200 transition-colors"
- >
- <Sparkles size={12} /> {localLane ? 'Try cloud' : 'See plans'}
- </button>
- {localLane && (
- <button
- onClick={() => { close(); setIntent(localLane) }}
- className="flex-1 flex items-center justify-center gap-1.5 h-8 rounded-lg border border-white/15 text-gray-200 text-[0.7rem] font-semibold hover:bg-white/[0.06] transition-colors"
- >
- <MonitorDown size={12} /> Try local
- </button>
- )}
- <button
- onClick={close}
- className="px-3 h-8 rounded-lg text-[0.7rem] text-gray-400 hover:text-gray-200 hover:bg-white/[0.06] transition-colors"
- >
- Not now
- </button>
- </div>
- </div>
- </motion.div>
- </motion.div>
- )}
- </AnimatePresence>
- )
-}
diff --git a/src/components/cloud/CloudGateModal.tsx b/src/components/cloud/CloudGateModal.tsx
index 340d6ef6..832d94cb 100644
--- a/src/components/cloud/CloudGateModal.tsx
+++ b/src/components/cloud/CloudGateModal.tsx
@@ -153,6 +153,15 @@ export function CloudGateModal() {
Get LU Cloud <ArrowRight size={13} />
</button>
<StayLocalButton onLocal={stayLocal} />
+ {/* 2.6.3 B5: the sign-in entry used to exist ONLY on the plans
+ step, so a returning subscriber had to click a button that
+ reads like "buy" before finding a way to log in. It also made
+ the whole login path depend on that one step surviving any
+ change to where "Get LU Cloud" leads. It lives on both steps
+ now, which costs one link and removes that dependency. */}
+ <button onClick={() => setStep('login')} className={linkRow + ' w-full pt-1'}>
+ Already got an account? Sign in <ArrowRight size={11} />
+ </button>
</div>
</div>
) : step === 'plans' ? (
diff --git a/src/components/cloud/CloudTeaserModal.tsx b/src/components/cloud/CloudTeaserModal.tsx
index afbd829d..24156832 100644
--- a/src/components/cloud/CloudTeaserModal.tsx
+++ b/src/components/cloud/CloudTeaserModal.tsx
@@ -54,7 +54,6 @@ export function CloudTeaserModal() {
const target = useUIStore((s) => s.cloudTeaser)
const setCloudTeaser = useUIStore((s) => s.setCloudTeaser)
const setCloudGateOpen = useUIStore((s) => s.setCloudGateOpen)
- const setCloudExampleVideo = useUIStore((s) => s.setCloudExampleVideo)
const setIntent = useCreateStore((s) => s.setIntent)
const { updateSettings } = useSettingsStore()
const teasersEnabled = useSettingsStore((s) => s.settings.cloudTeasersEnabled)
@@ -140,13 +139,12 @@ export function CloudTeaserModal() {
<div className="flex items-center gap-2 pt-1">
<button
onClick={() => {
- // Intent teasers detour through the example video popup
- // (real footage of the tool); model rows go straight to
- // the gate since there is no per model clip.
- const t = target
+ // 2.6.3 B5: intent teasers used to detour through an
+ // example-video popup before the gate. That stage is gone
+ // (David 2026-08-04), so both surfaces take the same path
+ // the model rows always took, one click shorter.
close()
- if (t.surface === 'intent') setCloudExampleVideo(t)
- else setCloudGateOpen(true)
+ setCloudGateOpen(true)
}}
className="flex-1 flex items-center justify-center gap-1.5 h-8 rounded-lg bg-white text-black text-[0.7rem] font-semibold hover:bg-gray-200 transition-colors"
>
diff --git a/src/components/cloud/__tests__/cloud-path-shortened.test.ts b/src/components/cloud/__tests__/cloud-path-shortened.test.ts
new file mode 100644
index 00000000..b6ee9aec
--- /dev/null
+++ b/src/components/cloud/__tests__/cloud-path-shortened.test.ts
@@ -0,0 +1,88 @@
+/**
+ * B5 (David 2026-08-04): the example-video stage is gone and the path to the
+ * cloud is one click shorter.
+ *
+ * The reason this file exists rather than trusting the diff: the in-app login
+ * used to hang off a SINGLE step. "Already got an account? Sign in" appeared
+ * only on the plans step, so any change to where "Get LU Cloud" leads could
+ * silently take the login away from every existing subscriber, and nothing
+ * would have failed. The sign-in entry now sits on both signed-out steps, and
+ * these tests are what keeps it there.
+ *
+ * There is no render harness in this repo (no @testing-library), so this guards
+ * the source, the same way DownloadBadge-autoclose.test.ts does. The click path
+ * itself is covered by e2e/cloud-create.spec.ts.
+ *
+ * Run: npx vitest run src/components/cloud/__tests__/cloud-path-shortened.test.ts
+ */
+import { describe, it, expect } from 'vitest'
+import { existsSync, readFileSync } from 'node:fs'
+import { resolve } from 'node:path'
+
+const ROOT = resolve(__dirname, '..', '..', '..', '..')
+const read = (p: string) => readFileSync(resolve(ROOT, p), 'utf8')
+
+const gate = read('src/components/cloud/CloudGateModal.tsx')
+const teaser = read('src/components/cloud/CloudTeaserModal.tsx')
+
+describe('the example-video stage is gone', () => {
+ it('the component, its assets and its build scripts no longer exist', () => {
+ expect(existsSync(resolve(ROOT, 'src/components/cloud/CloudExampleModal.tsx'))).toBe(false)
+ // 3.4 MB of webm shipped in every bundle on all three platforms.
+ expect(existsSync(resolve(ROOT, 'public/teasers'))).toBe(false)
+ expect(existsSync(resolve(ROOT, 'scripts/teasers'))).toBe(false)
+ })
+
+ it('nothing references it any more', () => {
+ for (const f of [
+ 'src/components/layout/AppShell.tsx',
+ 'src/stores/uiStore.ts',
+ 'src/components/cloud/CloudTeaserModal.tsx',
+ 'package.json',
+ ]) {
+ const src = read(f)
+ expect(src, `${f} still mentions the example modal`).not.toMatch(/CloudExampleModal|cloudExampleVideo/)
+ expect(src, `${f} still mentions the teaser assets`).not.toMatch(/teasers\//)
+ }
+ })
+
+ it('the teaser sheet goes straight to the gate from both surfaces', () => {
+ // The intent branch used to call setCloudExampleVideo; both branches take
+ // the model-row path now, which was always one step shorter.
+ expect(teaser).toMatch(/setCloudGateOpen\(true\)/)
+ expect(teaser).not.toMatch(/setCloudExampleVideo/)
+ // The branch itself is gone, not just its call.
+ expect(teaser).not.toMatch(/if \(t\.surface === 'intent'\)/)
+ })
+})
+
+describe('the in-app login survives wherever Get LU Cloud leads', () => {
+ it('the sign-in entry appears on the intro step, not only on plans', () => {
+ // Two occurrences: one per signed-out step. One occurrence means the intro
+ // step lost it again, which is the regression this file is here for.
+ const entries = gate.match(/Already got an account\? Sign in/g) ?? []
+ expect(entries.length, 'sign-in entry must be on BOTH signed-out steps').toBe(2)
+ })
+
+ it('both entries actually reach the login step', () => {
+ const toLogin = gate.match(/setStep\('login'\)/g) ?? []
+ expect(toLogin.length).toBeGreaterThanOrEqual(2)
+ })
+
+ it('the intro step carries one of them', () => {
+ // Cut the intro branch out at the plans branch, so the assertion cannot
+ // pass on the plans copy.
+ const start = gate.indexOf("step === 'intro' ? (")
+ const end = gate.indexOf("step === 'plans' ?")
+ expect(start, 'intro branch not found').toBeGreaterThan(-1)
+ expect(end, 'plans branch not found').toBeGreaterThan(start)
+ const intro = gate.slice(start, end)
+ expect(intro).toMatch(/Already got an account\? Sign in/)
+ expect(intro).toMatch(/setStep\('login'\)/)
+ })
+
+ it('the login step is still reachable back from plans', () => {
+ expect(gate).toMatch(/step === 'login'/)
+ expect(gate).toMatch(/Back to plans/)
+ })
+})
diff --git a/src/components/layout/AppShell.tsx b/src/components/layout/AppShell.tsx
index bfc5f49d..75b206eb 100644
--- a/src/components/layout/AppShell.tsx
+++ b/src/components/layout/AppShell.tsx
@@ -30,7 +30,6 @@ import { useCloudAuthStore, deriveCloudAvailable } from '../../stores/cloudAuthS
import { useCreateStore } from '../../stores/createStore'
import { CloudGateModal } from '../cloud/CloudGateModal'
import { CloudTeaserModal } from '../cloud/CloudTeaserModal'
-import { CloudExampleModal } from '../cloud/CloudExampleModal'
import { ReleaseNotesModal } from '../release/ReleaseNotesModal'
import { ShortcutsModal } from './ShortcutsModal'
import { CreditsExhaustedModal } from './CreditsExhaustedModal'
@@ -819,9 +818,6 @@ export function AppShell() {
{/* Cloud discovery sheet: opened by the Local-mode teaser surfaces
(locked Create tabs, hosted model rows). */}
<CloudTeaserModal />
- {/* Example video popup: teaser "See plans" detours here (intent
- surfaces only) before the gate. */}
- <CloudExampleModal />
{/* What is new, once per version. Mounted inside the onboarded tree, so
it can never stack on top of the onboarding wizard. */}
<ReleaseNotesModal />
diff --git a/src/stores/uiStore.ts b/src/stores/uiStore.ts
index 12703cf1..e0a77129 100644
--- a/src/stores/uiStore.ts
+++ b/src/stores/uiStore.ts
@@ -22,16 +22,11 @@ interface UIState {
cloudGateOpen: boolean
/** CloudTeaserModal — null = closed. */
cloudTeaser: CloudTeaserTarget | null
- /** CloudExampleModal — the example video popup a teaser sheet's "See plans"
- * detours through for intent surfaces (real footage of the tool). null =
- * closed. Runtime only, never persisted. */
- cloudExampleVideo: Extract<CloudTeaserTarget, { surface: 'intent' }> | null
setView: (view: View) => void
toggleSidebar: () => void
setSidebarOpen: (open: boolean) => void
setCloudGateOpen: (open: boolean) => void
setCloudTeaser: (target: CloudTeaserTarget | null) => void
- setCloudExampleVideo: (target: Extract<CloudTeaserTarget, { surface: 'intent' }> | null) => void
}
export const useUIStore = create<UIState>()((set) => ({
@@ -39,7 +34,6 @@ export const useUIStore = create<UIState>()((set) => ({
sidebarOpen: true,
cloudGateOpen: false,
cloudTeaser: null,
- cloudExampleVideo: null,
// Sidebar visibility follows the view: it's the conversation list, which
// only makes sense in Chat. The hamburger toggle still works on other views;
@@ -49,5 +43,4 @@ export const useUIStore = create<UIState>()((set) => ({
setSidebarOpen: (open) => set({ sidebarOpen: open }),
setCloudGateOpen: (open) => set({ cloudGateOpen: open }),
setCloudTeaser: (target) => set({ cloudTeaser: target }),
- setCloudExampleVideo: (target) => set({ cloudExampleVideo: target }),
}))