mirror of
https://github.com/Anil-matcha/Open-Generative-AI.git
synced 2026-05-07 01:17:18 +00:00
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).
115 lines
2.8 KiB
JSON
115 lines
2.8 KiB
JSON
{
|
|
"name": "open-generative-ai",
|
|
"description": "Open-source alternative to Higgsfield AI — AI image, video, cinema and lip sync studio",
|
|
"private": true,
|
|
"version": "1.0.4",
|
|
"workspaces": [
|
|
"packages/studio",
|
|
"packages/workflow-ui",
|
|
"packages/ai-agent"
|
|
],
|
|
"scripts": {
|
|
"dev": "next dev",
|
|
"build": "next build",
|
|
"start": "next start",
|
|
"lint": "next lint",
|
|
"build:studio": "cd packages/studio && npm run build",
|
|
"setup": "npm install && npm run build:studio",
|
|
"vite:dev": "vite",
|
|
"vite:build": "vite build",
|
|
"electron:dev": "npm run vite:build && electron .",
|
|
"electron:build": "vite build && electron-builder --mac",
|
|
"electron:build:win": "vite build && electron-builder --win",
|
|
"electron:build:linux": "vite build && electron-builder --linux",
|
|
"electron:build:all": "vite build && electron-builder --mac --win --linux"
|
|
},
|
|
"build": {
|
|
"appId": "ai.generative.open",
|
|
"productName": "Open Generative AI",
|
|
"copyright": "Copyright © 2025",
|
|
"directories": {
|
|
"output": "release"
|
|
},
|
|
"afterPack": "./afterPack.js",
|
|
"files": [
|
|
"dist/**/*",
|
|
"electron/**/*"
|
|
],
|
|
"mac": {
|
|
"category": "public.app-category.graphics-design",
|
|
"icon": "public/banner.png",
|
|
"gatekeeperAssess": false,
|
|
"target": [
|
|
{
|
|
"target": "dmg",
|
|
"arch": [
|
|
"x64",
|
|
"arm64"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"win": {
|
|
"icon": "public/banner.png",
|
|
"target": [
|
|
{
|
|
"target": "nsis",
|
|
"arch": [
|
|
"x64"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"linux": {
|
|
"icon": "public/banner.png",
|
|
"category": "Utility",
|
|
"maintainer": "Open Generative AI Team",
|
|
"extraFiles": [
|
|
{
|
|
"from": "build/linux/apparmor.profile",
|
|
"to": "resources/apparmor.profile"
|
|
}
|
|
],
|
|
"target": [
|
|
{
|
|
"target": "AppImage",
|
|
"arch": [
|
|
"x64"
|
|
]
|
|
},
|
|
{
|
|
"target": "deb",
|
|
"arch": [
|
|
"x64"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"dependencies": {
|
|
"@prisma/client": "^6.19.3",
|
|
"ai-agent": "file:./packages/ai-agent",
|
|
"axios": "^1.7.0",
|
|
"next": "^15.0.0",
|
|
"papaparse": "^5.5.3",
|
|
"react": "^19.0.0",
|
|
"react-dom": "^19.0.0",
|
|
"react-hot-toast": "^2.4.1",
|
|
"studio": "*",
|
|
"workflow-builder": "file:./packages/workflow-ui"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/eslintrc": "^3",
|
|
"@tailwindcss/vite": "^4.1.18",
|
|
"autoprefixer": "^10.4.24",
|
|
"electron": "^33.4.11",
|
|
"electron-builder": "^25.1.8",
|
|
"eslint": "^9",
|
|
"eslint-config-next": "^15.0.0",
|
|
"postcss": "^8.5.6",
|
|
"prisma": "^6.19.3",
|
|
"tailwindcss": "^3.4.19",
|
|
"vite": "^5.4.0"
|
|
},
|
|
"main": "electron/main.js"
|
|
}
|