Direct `models/infer` image requests were defaulting to `image.text2image`, which dropped reference inputs and produced unrelated generations. Route image-edit payloads to `image.img2img`, accept canonical `image` URLs during reference resolution, and preserve reference-aware prompt hints. Constraint: The test server must continue accepting both canonical `image` and legacy alias fields from callers already in circulation Rejected: Fix only reference URL parsing | direct overrides would still be misrouted as text2image before reference resolution runs Confidence: high Scope-risk: narrow Reversibility: clean Directive: Any future image-model route inference must inspect input shape before defaulting to text2image Tested: `env GOCACHE=/tmp/popiartserver-gocache go test ./internal/server -run 'TestInferRouteKeyForModelRecognizesViduAsVideo|TestInferRouteKeyForModelRecognizesImageEditInputs|TestResolveImageToImageReferenceAcceptsCanonicalImageURL|TestGenerateEditedImageRefsUsesSeedreamImagesGenerationsEndpoint'`; deployed to `101.42.99.35` and verified Seedream gateway requests include `image` Not-tested: Full manual validation against every non-Seedream image-edit provider
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:
authskillsrunjobsartifactsmedia- basic
budget,project, andmodelsstubs
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 stablemediaURLs for uploaded files and persisted job outputs. artifactmetadata is still derived fromresult_refs_json, but new artifacts bind to a localmedia_idand a stableurl.- New endpoints now include:
POST /v1/media/uploadGET /v1/media/:idGET /v1/media/:id/content
job logsare 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.