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

# Create image generation

> Generate 1 to 10 images from a text prompt with the EU image model and return their URLs; every image is billed in credits.

`createImageGeneration(input: CreateImageGenerationInput!): ImageGeneration!`

Requires project.files.write.

## Arguments

| Argument | Type | Required |
| - | - | - |
| `input` | [`CreateImageGenerationInput!`](https://veryfront.com/docs/cloud/graphql/types/createimagegenerationinput) | Yes |

## Input fields

### input

[`CreateImageGenerationInput`](https://veryfront.com/docs/cloud/graphql/types/createimagegenerationinput)

| Field | Type | Required | Description |
| - | - | - | - |
| `projectReference` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | Yes | Project UUID, slug or configured domain. |
| `prompt` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | Yes | Text description of the desired image (max 1000 characters) |
| `count` | [`Int`](https://veryfront.com/docs/cloud/graphql/types/int) | No | Number of images to generate (1-10, default: 1) |
| `seed` | [`Int`](https://veryfront.com/docs/cloud/graphql/types/int) | No | Random seed for reproducible generation |

## Response

Returns [`ImageGeneration!`](https://veryfront.com/docs/cloud/graphql/types/imagegeneration). Open the type for its fields and nested types.

| Field | Type | Description |
| - | - | - |
| `sources` | [`[String!]!`](https://veryfront.com/docs/cloud/graphql/types/string) | CDN URLs of the generated images; an image that failed is left out. |
| `count` | [`Int!`](https://veryfront.com/docs/cloud/graphql/types/int) | Number of images generated. |
| `requestedCount` | [`Int!`](https://veryfront.com/docs/cloud/graphql/types/int) | |
| `generatedCount` | [`Int!`](https://veryfront.com/docs/cloud/graphql/types/int) | |
| `failedCount` | [`Int!`](https://veryfront.com/docs/cloud/graphql/types/int) | |
| `skippedCount` | [`Int!`](https://veryfront.com/docs/cloud/graphql/types/int) | |
| `results` | [`[ImageGenerationItem!]!`](https://veryfront.com/docs/cloud/graphql/types/imagegenerationitem) | |

Types marked with `!` cannot be null. Lists use `[Type]` notation. The [type index](https://veryfront.com/docs/cloud/graphql/schema.md) lists all published input and response types.

## Example

```graphql title="query.graphql" theme={null}
mutation CreateImageGeneration($input: CreateImageGenerationInput!) {
  createImageGeneration(input: $input) {
    count
    failedCount
    generatedCount
    requestedCount
    skippedCount
  }
}
```

```json title="variables.json" theme={null}
{
  "input": {
    "projectReference": "00000000-0000-4000-8000-000000000001",
    "prompt": "example"
  }
}
```

<details>
  <summary>Try this mutation</summary>

  Calls use `https://api.veryfront.com/graphql`. Replace sample values with resources you can access. See [Authentication](https://veryfront.com/docs/cloud/authentication.md) for credentials and permissions.

  Bearer token or API key

  Stored in this tab's session. Clear credential

  Mutation

  Variables (JSON)
</details>


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