This repo includes a first-pass local run artifact bundle system for completed or failed media runs.
The goal is simple:
- keep originals intact
- generate lightweight derivatives for browsing
- write machine-readable metadata
- write a small append-only global index
This is intentionally local filesystem infrastructure, not a production media pipeline.
outputs/
index.jsonl
2026-03-26/
20260326_214512_nano_banana_pro_cinematic_v01/
run.json
manifest.json
notes.md
request.json
prompt.txt
prompt_enhanced.txt
inputs/
ref_01.png
motion_01.mp4
original/
output_01.png
output_02.mp4
web/
output_01.webp
output_02.mp4
thumb/
output_01.webp
output_02_poster.jpg
logs/
submit_payload.json
submit_response.json
status_response_final.json
The exact files depend on what data is available for the run.
Artifact bundles can also carry optional context for future dashboards and agents:
- tags
- source type
- source user
- source channel
- source agent
- project name
- notes
This data is stored in run.json, summarized in manifest.json, and partially carried into index.jsonl.
Derivative behavior is configurable with ArtifactDerivativeSettings, including:
- image web max dimension/format/quality
- image thumb max dimension/format/quality
- video web width
- video poster width/format
- allow-upscale toggle
- sha256 enable/disable
Run folders are named:
YYYYMMDD_HHMMSS_model_key_optional_slug
Example:
20260326_214512_nano_banana_pro_cinematic_v01
This sorts naturally by time.
The full machine-readable artifact record. It includes:
- run id and created time
- model key and provider model
- task mode if known
- prompt record
- copied inputs
- copied outputs
- derivative paths and metadata
- options/defaults
- provider trace
- warnings/errors/tags
A smaller summary optimized for fast browsing and future dashboard consumption. It includes:
- run id
- created time
- model key
- status
- hero output path
- thumbnail path
- prompt summary
- tags
- output count
A human-readable snapshot for quick inspection.
Each completed artifact can append one JSON object to:
outputs/index.jsonl
Each line is intentionally small:
- run id
- created time
- model key
- status
- hero output
- hero thumb
- prompt summary
- tags
- run path
This is designed so a future dashboard or agent can scan recent runs without opening every folder.
Use these public helpers:
create_run_artifact(...)generate_image_derivatives(...)generate_video_derivatives(...)append_run_index(...)
Typed models live under kie_api.artifacts.models.
Artifacts are not success-only.
A failed run can still produce:
run.jsonmanifest.jsonnotes.md- copied inputs
- provider logs
- warnings and errors
That means wrappers can preserve evidence even when generation does not complete.
- predictable run folder creation
- copied input and output originals
- image derivatives
- video web derivatives and posters
- structured metadata files
- append-only
index.jsonl
- deduplicated asset storage
- cloud sync
- database indexing
- background media processing queues
- resumable transcoding
- cleanup/retention policy