asset_generate
Generate images with AI models for your designs. Supports text-to-image and image-to-image, returning workspace URIs for use in edits.
Instructions
Generate images (text-to-image, image-to-image) via the IMG.LY AI gateway.
Call with NO arguments first: returns the model catalog — pick a model, then call again with model + prompt (+ optional format aspect like "16:9").
For image-to-image, pass image_uris with workspace:// URIs (from import or earlier generations).
The first content part is JSON: { uri, httpUrl, mimeType, bytes }. uri (a workspace:// URI) is the durable handle — embed it in subsequent edit calls. httpUrl opens the asset directly. The parts after it are a labeled thumbnail of each generated image — look at them; the JSON alone does not tell you what was drawn.
Multi-output models (layerize-class: decompose an input image into layers) add an assets array to that JSON — one entry per image, { index, uri, httpUrl, mimeType, bytes }, in stack order (residual background first, then cutout layers). The top-level fields mirror assets[0]. Single-output results carry no assets array. Any non-image output the model produced is passed through VERBATIM under metadata — read it, it binds semantics to the assets (layerize, for example, ships a layers list in assets order with names, z order and bounding boxes in source pixels; cutouts are cropped to content, so place them by their bounding box).
Requires a free IMG.LY sign-in (the login tool); all other design tools work without an account.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Model id from the catalog (call with no arguments to list). Required to generate. | |
| format | No | Aspect ratio, e.g. "16:9" or "1:1". | |
| prompt | No | What to generate. Required together with `model`. | |
| image_uris | No | workspace:// image URIs used as inputs (image-to-image models). |