feat: ImaGen as a direct live third compose option ('Bild generieren') #29

Open
opened 2026-06-18 11:38:34 +00:00 by mAi · 0 comments
Collaborator

What (m, PWA — enhancement to #28)

m: „wir könnten auch direkt imagen als dritte Option erlauben.“

In addition to Eigene Medien and Aus Galerie wählen (#28), add a third compose source: 'Bild generieren (KI)' — the sender enters a prompt and ImaGen (FLUX on mRock) generates an image on the fly that becomes the card's image.

Why it's a follow-up, not part of #28

The #28 design deliberately keeps ImaGen out of the request path because generation takes seconds–minutes — fine for the offline gallery feed, but a live 'generate now' button needs async UX: submit prompt → show progress/spinner → poll for completion → preview → use. Plus: generation cost/rate-limiting, prompt moderation, mRock-availability handling (graceful 'gerade nicht verfügbar'), and the generated image flows into the same copy→postcard_images path as a gallery pick.

Design points (the eventual worker resolves)

  • Async flow: a /compose/generate endpoint (or job) → ImaGen via the /imagine skill / ImaGen HTTP API → store result under gallery/-style or a per-card key → return URL to the compose page (poll or SSE). Keep it off the synchronous form submit.
  • Latency UX: clear progress state; let the sender keep editing text meanwhile; don't block submit.
  • Occasion-aware prompt seeding (prefill from the chosen occasion).
  • Rate-limit / abuse guard (it's an open compose surface, no accounts) — at least a per-session/IP cap; consider gating behind something if it gets abused.
  • mRock down → friendly fallback to gallery/upload.

Sequencing

After #28 (the gallery MVP) lands — reuses its source-toggle UI + copy-into-card path. Same compose track. otto-head assigns when #28 is done.

DoD

  • Third compose option generates an image via ImaGen (async, non-blocking), result becomes the card image; progress UX; rate-limit + mRock-down fallback; mobile-first. build/vet/test green; e2e (generate → card renders the result). Commit references this issue.
## What (m, PWA — enhancement to #28) m: *„wir könnten auch direkt imagen als dritte Option erlauben.“* In addition to **Eigene Medien** and **Aus Galerie wählen** (#28), add a **third compose source: 'Bild generieren (KI)'** — the sender enters a prompt and ImaGen (FLUX on mRock) generates an image on the fly that becomes the card's image. ## Why it's a follow-up, not part of #28 The #28 design deliberately keeps ImaGen **out of the request path** because generation takes **seconds–minutes** — fine for the offline gallery feed, but a live 'generate now' button needs **async UX**: submit prompt → show progress/spinner → poll for completion → preview → use. Plus: generation cost/rate-limiting, prompt moderation, mRock-availability handling (graceful 'gerade nicht verfügbar'), and the generated image flows into the same copy→postcard_images path as a gallery pick. ## Design points (the eventual worker resolves) - Async flow: a `/compose/generate` endpoint (or job) → ImaGen via the `/imagine` skill / ImaGen HTTP API → store result under `gallery/`-style or a per-card key → return URL to the compose page (poll or SSE). Keep it off the synchronous form submit. - Latency UX: clear progress state; let the sender keep editing text meanwhile; don't block submit. - Occasion-aware prompt seeding (prefill from the chosen occasion). - Rate-limit / abuse guard (it's an open compose surface, no accounts) — at least a per-session/IP cap; consider gating behind something if it gets abused. - mRock down → friendly fallback to gallery/upload. ## Sequencing After #28 (the gallery MVP) lands — reuses its source-toggle UI + copy-into-card path. Same compose track. otto-head assigns when #28 is done. ## DoD - Third compose option generates an image via ImaGen (async, non-blocking), result becomes the card image; progress UX; rate-limit + mRock-down fallback; mobile-first. build/vet/test green; e2e (generate → card renders the result). Commit references this issue.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: m/postcards#29
No description provided.