feat: standalone image/video studio windows + generation tasks page (HEL-612)

- /image and /video pages (a3/a4): three-column layout — params (connection,
  workflow, upload slots driven by declared inputs, prompt/negative/seed/
  size/duration fields, dynamic params), current-task card with live SSE
  progress + cancel, result grid with zoom/send-to-img2img/download, video
  player with custom amber controls + first/last-frame strip, right history
  with retry/delete and failure reasons
- /tasks page: both task classes summarized with source labels
  (独立生图/独立生视频/Playground/创作流程), filters, retry/cancel/delete
- nav: 生图/生视频/生成任务 real pages with active-jobs badge (进行数徽章)
- playground generate accepts source (studio-image/studio-video) for origin
  labeling; api.ts types follow
- parseDbTs helper: UTC-naive backend timestamps parse as UTC so elapsed/
  ETA/duration math is offset-correct
- backend tests: full-chain fake-ComfyUI server — image chain, video chain
  with frame uploads, retry-after-failure, delete-removes-outputs, tasks
  listing; i18n zh/en/es/fr/de/ja/ko complete

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
shigongyuan-agent
2026-09-28 09:47:48 +08:00
co-authored by multica-agent
parent 1cf9188955
commit df84c22143
17 changed files with 4306 additions and 10 deletions
@@ -23,12 +23,18 @@ PLAYGROUND_STATUS = "system"
PLAYGROUND_TITLE = "Playground Scratch"
# Where the request came from — recorded on the job payload so the tasks
# page can label origins ("独立生图" vs canvas Playground) without guessing.
PlaygroundSource = Literal["playground", "studio-image", "studio-video"]
class PlaygroundGenerate(BaseModel):
workflow_id: int
input_values: dict[str, Any] = Field(default_factory=dict)
# Optional target connection; omitted → the workflow's bound connection,
# then the active one (resolved in queue_manager.enqueue).
endpoint_id: str | None = None
source: PlaygroundSource = "playground"
class PlaygroundAttach(BaseModel):
@@ -344,13 +350,13 @@ async def generate(payload: PlaygroundGenerate) -> dict[str, Any]:
scene_id=None,
payload={
"input_values": payload.input_values,
"source": "playground",
"source": payload.source,
**({"endpoint_id": payload.endpoint_id} if payload.endpoint_id else {}),
},
)
await event_bus.publish(
"job.created",
{"job_id": job["id"], "kind": kind, "source": "playground", "project_id": pid},
{"job_id": job["id"], "kind": kind, "source": payload.source, "project_id": pid},
)
return {"ok": True, "job": _job_public(job)}