Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mosaic.so/llms.txt

Use this file to discover all available pages before exploring further.

Image Generation creates still images from text prompts. Use it for thumbnails, reference frames, product concepts, style exploration, or as input context for Video Generation.

How It Works

Write a prompt, choose an output size and quality, and optionally attach image references. Mosaic stores the generated image as a workspace asset so it can be reused by downstream tiles or API runs.

API Usage

Create an agent shell:
curl -X POST "https://api.mosaic.so/agent/create" \
  -H "Authorization: Bearer mk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Hero frame generator",
    "visibility": "private"
  }'
Add an Image Generation node:
curl -X POST "https://api.mosaic.so/agent/AGENT_ID/update" \
  -H "Authorization: Bearer mk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "operations": [
      {
        "op": "create_node",
        "node_type_id": "18b998a0-2ea7-4676-a5d3-3ae6c8ac0b72",
        "params_used": {
          "prompt": "A premium studio product photo of a chrome espresso machine on a marble counter",
          "model": "gpt-image-2",
          "image_size": "landscape_4_3",
          "quality": "high",
          "output_format": "png"
        }
      }
    ]
  }'
Run the agent with no video inputs:
curl -X POST "https://api.mosaic.so/agent/AGENT_ID/run" \
  -H "Authorization: Bearer mk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "callback_url": "https://your-webhook.com/mosaic"
  }'

API Info

  • Node ID: 18b998a0-2ea7-4676-a5d3-3ae6c8ac0b72

Node params

ParamTypeRequiredDefaultNotes
promptstringYes""Image prompt.
model"gpt-image-2"No"gpt-image-2"Image model.
image_size"square_hd" | "square" | "portrait_4_3" | "portrait_16_9" | "landscape_4_3" | "landscape_16_9" | "auto" | "custom"No"landscape_4_3"Output size preset.
custom_widthnumberConditional1280Required when image_size is custom; multiple of 16, 256-3840.
custom_heightnumberConditional960Required when image_size is custom; multiple of 16, 256-3840.
quality"low" | "medium" | "high"No"high"Generation quality.
output_format"jpeg" | "png" | "webp"No"png"Generated image format.
selected_context{images:string[]}Noempty listUploaded image references.

Example

{
  "prompt": "A clean ecommerce hero image of white running shoes on blue acrylic",
  "model": "gpt-image-2",
  "image_size": "landscape_4_3",
  "quality": "high",
  "output_format": "png"
}