wtgoku 6ff9ad6997 Restore MiniMax media routing parity across image and video flows
The server now keeps portable image ratio normalization, enforces documented Seedream size presets, routes MiniMax img2img through generations-style payloads, and submits Hailuo video variants through the video generations API with proper reference-image handling.

Constraint: The deployed test chain relies on popiartServer as the lowest-risk place to adapt provider-specific routing without broad newapi changes
Rejected: Expand newapi relay modes for every MiniMax image/video branch | larger blast radius than needed for the verified server-managed flows
Confidence: high
Scope-risk: moderate
Reversibility: clean
Directive: Keep MiniMax-specific media routing in popiartServer unless upstream newapi adapters are upgraded to the same contract
Tested: go test ./internal/server -run TestInferRouteKeyForModelRecognizesViduAsVideo|TestGenerate|TestResolve|TestSubmitMiniMaxVideoTask|TestExecuteImageToImageJobUsesGenerationsPathForMiniMax|TestExecuteImageToVideoJob|TestResolveVideoReferencesSupportsImagesArray
Not-tested: Full PopiNewAPI unit suite (blocked earlier by external module checksum drift in local checkout)
2026-04-15 11:57:05 +08:00
2026-04-07 15:21:27 +08:00
2026-04-07 15:21:27 +08:00
2026-04-07 15:21:27 +08:00

popiartServer

Local development backend for popiartcli.

This is a thin single-server backend for local integration. It keeps the CLI contract stable while pushing model-heavy responsibilities back to PopiNewAPI.

It is meant to validate these product-facing APIs first:

  • auth
  • skills
  • run
  • jobs
  • artifacts
  • media
  • basic budget, project, and models stubs

Project Relationship

See docs/project-relationship.md.

Persistence details for the current local backend are documented in docs/persistence.md. Stable media URL behavior and rollout notes are documented in docs/stable-media-url-v1.md.

This note explains how popiartcli, popiartServer, and PopiNewAPI split responsibilities, and why routing, billing attribution, and provider access belong in the backend layers rather than the CLI.

Run

make run

Default address:

http://127.0.0.1:8080

Health check:

curl http://127.0.0.1:8080/health

Use it from popiartcli:

cd /Users/jiajia/popiartcli
go run ./cmd/popiart --endpoint http://127.0.0.1:8080/v1 auth login --key <your-popinewapi-key>
go run ./cmd/popiart --endpoint http://127.0.0.1:8080/v1 skills list
go run ./cmd/popiart --endpoint http://127.0.0.1:8080/v1 media upload ./source.png
go run ./cmd/popiart --endpoint http://127.0.0.1:8080/v1 artifacts upload ./source.png --role source

Optional skillhub source:

export POPIART_SKILLHUB_DIR=/tmp/Popiart_skillhub

In local development, /tmp/Popiart_skillhub is used automatically when it exists.

Notes

  • Local persistence is intentionally thin: sessions, job refs, and project route overrides live in SQLite.
  • The local backend now keeps a lightweight media store under POPIART_DATA_DIR/media/ and exposes stable media URLs for uploaded files and persisted job outputs.
  • artifact metadata is still derived from result_refs_json, but new artifacts bind to a local media_id and a stable url.
  • New endpoints now include:
    • POST /v1/media/upload
    • GET /v1/media/:id
    • GET /v1/media/:id/content
  • job logs are synthesized from job state transitions instead of being stored as a separate table.
  • The local development backend verifies your login key against the local PopiNewAPI.
  • This server is a development backend, not the final production architecture.
S
Description
popiart-server
Readme
25 MiB
Languages
Go 54.9%
TypeScript 23.1%
CSS 8.8%
HTML 8%
JavaScript 5.2%