Awesome Cohub
中文
Playbooksstartercohub.bp.multimodal-pipeline2 min

When

You need image, video, music, or other multimodal output as a durable Space asset rather than only a Chat attachment.

Outcome

  • A generation task is created and its result can be polled or inspected.
  • Outputs are saved under a clear Space path (data/gen/, assets/, ...).
  • Cost, model, and task provenance remain recoverable.

Choose a path

  • Use Direct Generation / Create mode when the media artifact is the primary result in the Chat timeline.
  • Use a normal Agent turn when generation is one step in a broader file workflow.
  • Use Task Browser or client.tasks for task history and detail after either path.

Steps

  1. Define the asset contract: path, filename pattern, aspect/duration constraints, license and safety notes.
  2. Select a model from the live multimodal catalog rather than hardcoding an unavailable provider: ``bash cohub models ls --model-type multimodal ` Model declarations can carry display **pricing** (a unit plus an amount or a min/max range), surfaced through models.listMultimodal()` and beside each model in the web model picker.
  3. Generate through Create mode, the UI, or CLI: ``bash cohub generate "product hero, dark studio, orange accent" \ --model <model> --json ``
  4. Treat creation and reading as separate permissions in an App: generation.create creates a task; taskrun.view is required to poll or inspect it.
  5. Reference media deliberately. Generation inputs are uploaded to unlisted URLs instead of inline base64, task list views drop inline payloads, and 3D inputs accept GLB, glTF, OBJ, FBX, and STL whose extension matches the filename.
  6. Materialize returned media into the workspace as soon as it is available. Chat or provider URLs are not a project library.
  7. Record model, prompt summary, task id, and provider cost beside the asset. cohub generate reports each output's size, duration, and last frame; the UI distinguishes charged, pending, and not-charged outcomes, and transient billing writes may retry after task success.
  8. Preview, iterate with constrained changes, and Save when the set is demo-ready.

Image context and fallback

When a text-only model receives an image, Cohub can use the configured imageToText auxiliary task model. Descriptions are persisted per turn and reused, so retries do not repeatedly bill the fallback. Image-heavy compaction uses a vision-tile estimate rather than raw base64 length.

Done when

  • [ ] Files exist on stable Space paths
  • [ ] Prompt/model/task provenance is recoverable
  • [ ] Task Browser can show the final result
  • [ ] Billing and retry status is understood

Avoid

  • Leaving the only copy inside Chat attachment history
  • Assuming generation.create also grants result polling
  • Re-generating from scratch instead of editing constraints
  • Committing secrets or customer PII into prompts without need