> ## Documentation Index
> Fetch the complete documentation index at: https://docs.summerengine.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Summer Router: image

> An image made while the player plays, from a prompt and an optional reference picture. Call it from your game with Summer.client.router.generate("image", {"prompt": prompt, "size": "1024x1024"}).

An image made while the player plays, from a prompt and an optional reference picture.

| | |
| - | - |
| In your game | `Summer.client.router.generate("image", {"prompt": prompt, "size": "1024x1024"})` |
| Status | Available |
| Metered | per image, from the creator's Summer credits |
| Counts toward | per player per day, per game per day, per game per month, per account per month ([limits](https://docs.summerengine.com/router/limits.md)). A multiplayer server's calls count toward the game's caps, not the player's. |

## Example

```gdscript theme={null}
var r: SummerRouterResult = await Summer.client.router.generate("image", {"prompt": "a flower made of glass", "size": "512x512"})
if r.ok:
    $Flower.texture = r.texture
```

Sizes: `512x512`, `1024x1024`, `1024x1536` or `1536x1024`. Add `reference` (an `Image`, a `Texture2D`, or PNG, JPEG or WebP bytes up to 4 MiB) to start from a picture; the SDK sends it as `reference_image`. The result has `texture`, `image` and the raw `data`. The model is the image model you set for the game.

## Input limits

The SDK builds the request from the call's arguments and options. Summer checks these limits:

| Field | Type | Limits |
| - | - | - |
| `prompt` (required) | string | 1 to 4000 characters |
| `size` | `512x512`, `1024x1024`, `1024x1536`, `1536x1024` | One of these |
| `reference_image` | object | Any |

## Errors

Every refusal has a stable tag and a one-line fix, and the game keeps running. See [errors](https://docs.summerengine.com/router/errors.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.