Commit graph

116 commits

Author SHA1 Message Date
Anurag Pappula
89dd7c3643
Merge pull request #7 from Ahoum-Dev/feat/batch-progress-ui
feat(batch): progress UI, controls, retry, CSV export, demo simulator [slice 5/5 UI]
2026-04-23 09:15:28 +05:30
Anuragp22
4cf0d503b8 feat(batch): batch detail page with progress, controls, retry, CSV export
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.
2026-04-23 08:48:42 +05:30
Anurag Pappula
8fdc8120a7
Merge pull request #6 from Ahoum-Dev/feat/local-upload-fallback
feat(batch): local-only upload fallback when MuAPI is unreachable
2026-04-23 08:36:42 +05:30
Anuragp22
2e2664bf78 feat(batch): degrade to local-only uploads when MuAPI is unreachable
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".
2026-04-23 08:34:57 +05:30
Anurag Pappula
d42a97db48
Merge pull request #5 from Ahoum-Dev/feat/batch-create-csv
feat(batch): New Batch wizard, CSV parser, and batch list [slice 3/5]
2026-04-23 08:04:55 +05:30
Anuragp22
694c7075e2 feat(batch): New Batch wizard, CSV parser, and batch list
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).
2026-04-23 08:01:15 +05:30
Anurag Pappula
404edc7f1e
Merge pull request #4 from Ahoum-Dev/feat/trainers-studios-crud
feat(batch): trainers + studios CRUD with /batch shell UI [slice 2/5]
2026-04-23 07:39:23 +05:30
Anuragp22
1b12df90ef feat(batch): trainers + studios CRUD with /batch shell UI
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.
2026-04-23 07:32:49 +05:30
Anurag Pappula
8d23124ea1
Merge pull request #3 from Ahoum-Dev/feat/batch-prisma-schema
feat(batch): Prisma schema + Postgres wiring [slice 1/5]
2026-04-23 06:45:37 +05:30
Anuragp22
47dd61f33a feat(batch): add Prisma schema and Postgres wiring for batch feature
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).
2026-04-23 06:41:31 +05:30
Anurag Pappula
d07175cdc4
Merge pull request #2 from Ahoum-Dev/chore/docker-setup
chore: add Docker setup with Postgres and worker services
2026-04-23 06:03:39 +05:30
Anuragp22
6c2e52344d chore: add Docker setup with Postgres and worker services
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)
2026-04-23 06:02:44 +05:30
Anurag Pappula
c96241b6e4
Merge pull request #1 from Ahoum-Dev/fix/tailwind-v3-downgrade
fix: downgrade Tailwind to v3
2026-04-23 06:02:40 +05:30
Anuragp22
c5e95734ac fix: downgrade Tailwind to v3
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
2026-04-23 06:01:22 +05:30
Anil Matcha
1afefdad0c release: v1.0.4 — add Agents and Workflows tabs to desktop v1.0.4
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 02:38:48 +05:30
Anil Matcha
e832e9d389 feat: add Workflows and Agents tabs to Electron vanilla JS build
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 02:22:35 +05:30
Anil Chandra Naidu Matcha
a45b7a53b6
Merge pull request #97 from octo-patch/feat/add-minimax-provider
feat: add MiniMax Image 01 T2I model
2026-04-22 21:54:14 +05:30
octo-patch
bf32a393cc feat: add MiniMax image-01 T2I model and document MiniMax provider support
- 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.
2026-04-22 23:41:38 +08:00
Anil Matcha
6011fcb0fd feat: use Metal-GPU binary for macOS arm64 local inference
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>
2026-04-22 18:02:33 +05:30
Anil Matcha
8cf83b1b45 docs: document local model inference feature in README v1.0.3-binaries
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>
2026-04-22 17:47:17 +05:30
Anil Matcha
36d392ab78 feat: add local model inference via sd.cpp (Electron-only)
- Scaffold full IPC bridge: preload.js exposes localAI API to renderer
- electron/lib/localInference.js: binary download (Metal-enabled macOS build),
  model management, auxiliary file downloads (Qwen3-4B LLM + FLUX VAE for Z-Image),
  and generation via sd-cli with DYLD_LIBRARY_PATH + xattr quarantine stripping
- electron/lib/modelCatalog.js: Z-Image Turbo/Base (featured) + SD 1.5/SDXL models
- Z-Image requires 3 components loaded via --diffusion-model + --llm + --vae flags
- ImageStudio: Local/API toggle (Electron-only), local model selector, progress bar
- SettingsModal: tabbed UI with Local Models tab (hidden on web/hosted version)
- LocalModelManager: engine status bar, per-model download cards, auxiliary
  component download UI (text encoder + VAE) for Z-Image models
- localInferenceClient.js: safe wrapper with isLocalAIAvailable() guard
- All local features gated behind isLocalAIAvailable() — web version unaffected

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 17:47:17 +05:30
Anil Chandra Naidu Matcha
5cbcd88733
Merge pull request #93 from jaiprasad04/feat/modernize-studio-upload
feat: integrate AI agent studio with minimal UI and upgrade Tailwind v4
2026-04-22 17:36:08 +05:30
Jaya Prasad Kavuru
4efb8593a4 feat: modernize Cinema Studio upload UI, implement batch generation in Image Studio, and fix textarea auto-resize across studios 2026-04-22 16:40:51 +05:30
Jaya Prasad Kavuru
911bcdd558 Merge remote-tracking branch 'origin/main' into feat/modernize-studio-upload 2026-04-22 15:46:10 +05:30
Jaya Prasad Kavuru
fddc2ff69f feat: implement drag-and-drop media uploads and modernize upload UI with circular progress indicators 2026-04-22 15:39:22 +05:30
Jaya Prasad Kavuru
62be9ace66 feat: integrate AI agent studio with minimal UI and upgrade Tailwind v4 2026-04-22 15:22:26 +05:30
Anil Matcha
9de0de3430 fix: correct predictions poll URL in studio muapi client
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>
2026-04-22 12:04:52 +05:30
Anil Matcha
aa6917e339 release: v1.0.2 — rename Seedance 2.0 models to SD 2, fix Windows build size v1.0.2
- 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>
2026-04-22 06:57:25 +05:30
Anil Matcha
4c48d58159 docs: add Workflow Studio section with Vibe Workflow link
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 00:58:30 +05:30
Anil Chandra Naidu Matcha
7582b89aea
Merge pull request #88 from jaiprasad04/feat/modernize-studio-upload
feat: implement workflow identity persistence, unify api auth, and up…
2026-04-21 20:16:41 +05:30
Jaya Prasad Kavuru
efa772e772 feat: implement workflow identity persistence, unify api auth, and upgrade tailwind to v4 2026-04-21 19:38:34 +05:30
Anil Chandra Naidu Matcha
9f858c0ba8 Add link to Awesome-GPT-Image-2-API-Prompts at top 2026-04-21 17:22:35 +05:30
Anil Chandra Naidu Matcha
6f9cdeeb47
Add follow creator section to README
Added a section to follow the creator for updates.
2026-04-16 10:24:28 +05:30
Anil Matcha
b92bdc5326 docs: highlight uncensored and unrestricted capabilities in README 2026-04-16 09:33:49 +05:30
Anil Chandra Naidu Matcha
57cb24bcbc
Merge pull request #77 from Assem-ElQersh/main
feat: add Linux (Ubuntu) desktop build support
2026-04-15 18:40:00 +05:30
Assem ElQersh
0f4ae55b37 feat: add Linux (Ubuntu) desktop build support
- 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
2026-04-15 00:49:44 +02:00
Anil Matcha
17adf7eca7 build: fix electron desktop build config for v1.0.1 v1.0.1
- 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>
2026-04-15 00:15:58 +05:30
Anil Matcha
1c33c1be7b fix: send required name and prompt fields for AI Video Effects
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>
2026-04-14 22:59:06 +05:30
Anil Chandra Naidu Matcha
6c47f0dca3
Update README.md 2026-04-14 10:48:13 +05:30
Anil Chandra Naidu Matcha
963cc7d2e5
Update README to clarify project affiliations
Clarified project independence and third-party affiliations.
2026-04-13 13:24:37 +05:30
Anil Chandra Naidu Matcha
171f02c05f
Revise README to mention Freepik, Krea, and Openart AI
Updated README to include additional alternatives and clarify features.
2026-04-13 00:19:30 +05:30
Anil Matcha
ebcddfa187 Rename project from Open-Higgsfield-AI to Open-Generative-AI
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>
2026-04-13 00:14:45 +05:30
Anil Chandra Naidu Matcha
5925256c0a
Fix hosted link and add Discord community info
Updated hosted version link and added community section.
2026-04-12 15:29:14 +05:30
Anil Matcha
38d8ea3228 Merge branch 'main' of https://github.com/Anil-matcha/Open-Higgsfield-AI 2026-04-12 00:05:31 +05:30
Anil Matcha
1c6a0c863e Add Kling 2.6 and 3.0 Motion Control models 2026-04-12 00:01:04 +05:30
Anil Chandra Naidu Matcha
cf0d84d26e
Update hosted version link in README 2026-04-11 21:58:57 +05:30
Anil Matcha
20bf1bce42 Merge: resolve conflict, keep updated styling with /access-keys URLs 2026-04-11 21:15:24 +05:30
Anil Matcha
046f4ac071 Update API key access and add Veo 3.1 lite models 2026-04-11 21:02:57 +05:30
Anil Chandra Naidu Matcha
21a09ebea2
Merge pull request #64 from jaiprasad04/feat/modernize-studio-upload
feat: finalize studio persistence and multiple reference image upload UI
2026-04-10 18:44:59 +05:30
Jaya Prasad Kavuru
91ce11df6f feat: finalize studio persistence and multiple reference image upload UI 2026-04-10 18:40:41 +05:30