Slice 5 of the batch feature. Marketing team can now click into a
batch from the list, watch a live progress dashboard, drive it with
Start/Pause/Resume/Cancel, retry individual failed jobs, and pull a
results CSV when it's done.
Includes a stakeholder-demo helper that simulates worker progress
(slice 4 hasn't shipped yet) so non-technical viewers see a realistic
running state without needing real MuAPI generations.
Backend
-------
- POST /api/batches/[id]/start: draft|paused -> running, requeues
any cancelled jobs.
- POST /api/batches/[id]/pause: running -> paused.
- POST /api/batches/[id]/resume: paused -> running.
- POST /api/batches/[id]/cancel: any -> cancelled, marks queued/draft
jobs as cancelled (in-flight ones complete naturally).
- POST /api/batches/[id]/simulate: demo-only. Picks ~10% of queued
jobs, marks ~90% of those done with a placeholder video URL and
~10% failed. Updates batch counters atomically.
- GET /api/batches/[id]/export: streams a CSV with row-index,
practice, trainer, studio, status, video URL, error, retries.
Properly quotes cells, slugifies the filename.
- POST /api/jobs/[id]/retry: resets a failed job to queued so the
worker re-attempts it.
UI
--
- app/batch/[id]/page.js: leaf route mounting BatchDetailShell.
- components/batch/BatchDetailShell.jsx: same MuAPI-key gate as
BatchShell so opening a deep link works in a fresh browser.
- components/batch/BatchDetail.jsx: full progress dashboard.
- Top header: back link, batch name, live status pill, CSV
download button.
- Progress card: done/total numbers, breakdown line
(failed / running / queued), animated yellow bar, "auto-refresh
every 3s" indicator while the batch is running or paused.
- Settings strip: model / duration / quality / aspect / concurrency.
- Filter pills: All | Pending | Done | Failed.
- Demo button: "⚡ Simulate progress (demo)".
- Jobs table: row index, practice (with inline error message),
trainer, studio, status pill, ▶ Play (opens video preview modal),
Retry (only on failed rows).
- 3s polling driven by the running/paused state.
- components/batch/BatchesTab.jsx: rows are now clickable, the
wizard navigates straight to the new batch's detail page after
saving so the demo flow is one continuous click-through.
Verification
------------
- Created a 5-row batch via the API.
- start -> status went to running.
- simulate -> 1 done with placeholder URL, 0 failed (10% of 5 = 0
failed by design).
- GET detail returned the batch with jobs joined to trainer/studio.
- /batch/[id] page returned 200.
- CSV export returned text/csv with the right columns and rows.
Until the team has MuAPI credits we cannot upload trainer/studio
images to MuAPI's CDN, which previously caused POST /api/trainers
to fail outright with a 502. Now the route always saves a local
copy first and only attempts MuAPI as an enhancement.
Behaviour change
----------------
- Trainer/studio rows are created even without a MuAPI key. The
imageUrl points at a new /api/uploads/<kind>/<filename> route
that streams the file out of /data/uploads/.
- If MuAPI is reachable (key present + upload succeeds) we still
prefer its CDN URL, identical to before for the happy-path team
who already has credits.
- The slice-4 worker will need to detect local-only imageUrls and
re-upload to MuAPI at job-submission time. Tracked, not in this PR.
Files
-----
- lib/localUploadStore.js: add readLocal() and publicUrlFor() so the
serving route and the upload route share the same naming scheme.
Path-traversal guard on the read side (no '/', '..', '\' in name).
- app/api/uploads/[kind]/[name]/route.js: GET serves the bytes with
the right Content-Type and a 1h private cache header. Whitelists
kind to {trainers, studios}.
- app/api/trainers/route.js, app/api/studios/route.js: rewritten so
the create flow is "DB row -> local backup -> optional MuAPI". On
total failure (both MuAPI and local) we delete the row to avoid
orphans. The response now also surfaces a `muapiNote` string so
the UI can hint at "no credits yet".
Slice 3 of the batch feature. Marketing team can now upload the
Rasika-style CSV, watch each row auto-map to the trainer/studio
they uploaded in slice 2, get a real MuAPI cost estimate, and
persist the batch as a draft.
Backend
-------
- POST /api/batches: creates a batch in status='draft' along with one
job per CSV row (status='queued', not yet picked up since the
worker arrives in slice 4).
- GET /api/batches: list view payload.
- GET /api/batches/[id]: detail with jobs joined to trainer/studio
rows. Used by the slice-5 progress UI.
- POST /api/batches/[id]/estimate-cost: forwards the batch's model +
payload to MuAPI's /api/v1/app/calculate_dynamic_cost, multiplies
by row count, returns {perJob, total, currency}.
CSV
---
- lib/csvParser.js: PapaParse-based parser that validates required
columns, normalises duration ("15 sec" -> 15) snapped to Seedance
2.0's [5,10,15], maps quality ("1080P" -> "high"), and composes a
prompt from description + start position + camera angle.
UI
--
- components/batch/NewBatchWizard.jsx: full-screen 3-step wizard.
- Step 1 — name, CSV upload, model/duration/quality/aspect/
concurrency settings.
- Step 2 — review every row in a table. Auto-maps Character ->
Trainer.csvLabel and Studio -> Studio.csvLabel, shows per-row
override dropdowns and bulk-assign helpers, hard-blocks Next
until every active row has both a trainer and studio.
- Step 3 — saves the batch and triggers the cost estimate. On
success, surfaces the batch id and points the user to the
upcoming worker slice.
- components/batch/BatchesTab.jsx: replaces the placeholder with a
real list view (status pill, progress counts, model, created-at)
and the "+ New batch" button that opens the wizard.
- components/batch/BatchShell.jsx: pass apiKey to BatchesTab.
Verification
------------
- POST /api/batches with one row -> 201, batch + job persisted in
Postgres (verified with psql).
- GET /api/batches lists the row.
- Cost estimate endpoint returns 401 without a key, calls MuAPI
correctly with one (live test pending real credits).
Slice 2 of the batch feature. Marketing team can now upload the six
trainer images and the studio image once and reuse them across every
future batch.
Backend
-------
- lib/muapiUpload.js: Node-side wrapper around POST
/api/v1/upload_file with FormData + x-api-key. Mirrors
packages/studio/src/muapi.js:131-178 but uses native fetch +
FormData (no XHR).
- lib/batchAuth.js: shared getApiKey() — header > cookie > env fallback.
- lib/localUploadStore.js: writes a local backup of every uploaded
asset to /data/uploads/{trainers,studios}/<id>.<ext> on the
uploads_data volume, so we can re-upload to MuAPI if their CDN
ever expires the URL.
- app/api/trainers/route.js + [id]/route.js: GET list, POST multipart
(uploads to MuAPI then persists), DELETE (refuses if any active job
references the row).
- app/api/studios/route.js + [id]/route.js: identical shape.
UI
--
- app/batch/page.js: leaf route mounting BatchShell.
- components/batch/BatchShell.jsx: 3-tab dark-theme shell
(Batches / Trainers / Studios) with the same MuAPI key gate as
StandaloneShell (reuses ApiKeyModal + the muapi_key cookie).
- components/batch/AssetLibrary.jsx + AddAssetModal.jsx: shared grid +
upload modal driving both tabs from one component.
- components/batch/TrainersTab.jsx, StudiosTab.jsx: thin wrappers.
- components/batch/BatchesTab.jsx: placeholder for slice 3.
Stub packages (upstream submodules unavailable)
-----------------------------------------------
The ai-agent and workflow-ui submodules referenced in .gitmodules
return 404 (Anil-matcha/workflow-ui and jaiprasad04/ai-agent are
deleted/private). next build couldn't resolve their imports.
- Removed the dead .gitmodules entries.
- Added local stubs at packages/ai-agent and packages/workflow-ui
that export no-op components rendering "feature unavailable" so
the build succeeds. The /agents/* and Workflows tab show that
notice; the studios our marketing team actually uses
(Image / Video / Lip Sync / Cinema) keep working since they
live in the studio package which we have.
Docker / dev workflow
---------------------
- Dockerfile: run prisma generate during the builder stage, copy
prisma/ and lib/ into the runner stage so migrations and shared
helpers are present at runtime.
- docker-compose.override.yml (new): dev-mode overrides — mounts
source, runs as root to dodge node_modules permission issues with
the prod nextjs user, runs prisma generate + migrate deploy +
next dev. Worker container is a placeholder until slice 4 lands.
- The full stack (postgres + web + worker) now boots with
`docker compose up -d` and serves /batch on http://localhost:3000.
First slice of the CSV-driven batch video-generation feature. Introduces
the four-table schema (trainers, studios, batches, jobs) that the worker
and new /batch UI will operate on, plus the infrastructure glue so the
schema can be applied locally and in the docker-compose stack.
- prisma/schema.prisma: Trainer, Studio, Batch, Job models with the
indexes the worker's claim query will need
([batchId, status] and [status, nextAttemptAt]).
- prisma/migrations/20260423011041_init_batch_schema: initial migration
generated and applied against the compose Postgres.
- lib/prisma.js: standard Next.js PrismaClient singleton, reused across
the web API routes and the worker process.
- docker-compose.yml: map Postgres to host port 5433 to avoid colliding
with a pre-existing local Postgres on 5432; wire MUAPI_API_KEY env
through web and worker; add uploads_data volume mounted at
/data/uploads for slice-2 trainer/studio image backups.
- .env.example: documented DATABASE_URL (5433 for host, 5432 for
in-compose) and MUAPI_API_KEY placeholders.
- .gitignore: ignore /data/uploads/ now so future runtime uploads
don't end up tracked.
Also downgraded prisma from 7.x to ^6 since 7 moved datasource config
out of schema.prisma into a separate prisma.config.ts (breaking change
we don't need to absorb yet).
No API routes, worker, or UI in this slice — those land in the next
branches (feat/trainers-studios-crud, feat/batch-create-csv, etc).
Introduces a multi-stage Dockerfile for the Next.js app and a
docker-compose stack that provisions the app container alongside a
Postgres 16 instance and a dedicated worker container. This lays the
foundation for the upcoming batch-automation feature, which needs
persistent job state and a background process to drive MuAPI
submissions without blocking HTTP requests.
- Dockerfile: multi-stage build (deps / builder / runner), non-root user
- .dockerignore: excludes node_modules, .next, .git, electron artefacts
- docker-compose.yml:
* postgres service with healthcheck + persistent volume
* web service depends on postgres, passes DATABASE_URL
* worker service runs worker/index.js (to be added in next slice)
Tailwind v4 was installed but the PostCSS config only referenced
autoprefixer, so @tailwind directives were never processed and all
utility classes rendered as no-ops. Migrating the v3-shaped config
to v4 via @config/@source produced partial results and wasted cycles;
downgrading restores a working build immediately.
- tailwindcss: ^4.2.2 -> ^3.4.0
- postcss.config.js: add tailwindcss plugin
- globals.css already uses v3 @tailwind directives
- Add minimax-image-01 to t2iModels in src/lib/models.js and
packages/studio/src/models.js (8 aspect ratios, up to 4 images per
request, 1500-char prompt)
- Add minimax-image-01 entry to models_dump.json (t2i section)
- Update README: list MiniMax Image 01 in newly-added image models
and call out existing MiniMax Hailuo 02/2.3 video model support
- Add scripts/test_minimax_provider.js: validates model registration
and optionally runs a live API smoke test (MUAPI_KEY env var)
MiniMax Hailuo 02/2.3 T2V and I2V models were already present;
this commit brings MiniMax image generation to feature parity.
macOS Apple Silicon (darwin-arm64) now downloads the Metal-accelerated
sd-cli from our own GitHub release instead of the stock leejet build,
enabling significantly faster local image generation on M1/M2/M3/M4.
All other platforms continue to use the leejet upstream release.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add "Local Model Inference" section covering supported models (Z-Image Turbo/Base, Dreamshaper, Realistic Vision, Anything v5, SDXL), auxiliary file requirements for Z-Image, step-by-step usage, and hardware notes for Metal GPU on Apple Silicon. Also add Local Inference bullet to the Features list.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PROXY_APP_BASE ('/api/app') produced /api/app/v1/predictions/... which
after the Next.js rewrite hit 127.0.0.1:8000/app/v1/... → 404.
Poll now uses BASE_URL directly, consistent with how submit works.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Rename Seedance 2.0 → SD 2 (t2v, extend, i2v models)
- Bump version to 1.0.2
- Update README download links to v1.0.2
- Fix afterPack.js to strip platform-inappropriate @next/swc native binaries,
reducing Windows installer from ~739 MB unpacked to ~144 MB
- Windows build now targets x64 only (arm64 cross-compile via Wine is broken on macOS)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add electron:build:linux script and AppImage + .deb targets in package.json
- Fix Electron main.js: ESM → CommonJS, remove macOS-only titleBarStyle on Linux
- Fix createInlineInstructions undefined error in ImageStudio.js
- Fix Cinema Studio asset paths (absolute → relative) for Electron file:// protocol
- Add AppArmor profile for Ubuntu 24.04+ user namespace sandbox fix
- Add Ubuntu install docs and sandbox workaround to README
- Rename vite.config.js to vite.config.mjs so ESM-only @tailwindcss/vite
loads correctly (CJS require() can't import ESM modules)
- Remove tailwindcss from postcss.config.js — handled by @tailwindcss/vite
in Tailwind v4; the v3 PostCSS plugin conflicts with v4 CSS syntax
- Add "main": "electron/main.js" to package.json so electron-builder
finds the entry point instead of defaulting to index.js
- Bump version to 1.0.1
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The generate_wan_ai_effects endpoint requires both `name` (effect type)
and `prompt` (str) fields. The client was sending neither — `name` had
no state/UI/payload entry, and `prompt` was omitted when blank — causing
a 422 Unprocessable Entity error.
- Add selectedEffectName state and getEffectNamesForModel() helper
- Add Effect dropdown button (visible only for ai-video-effects /
motion-controls) with the full enum list from the model definition
- Wire updateControlsForModel to initialize/reset selectedEffectName
- Pass name in i2vParams at generate time
- Always send prompt (defaults to '') so the required str field is present
- Forward params.name in muapi.js generateI2V payload
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Update all references across source files, config, and docs — including
page titles, app name, package name, Electron window title, and release
asset URLs.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>