Create image generation

createImageGeneration(input: CreateImageGenerationInput!): ImageGeneration!

Requires project.files.write.

Arguments

ArgumentTypeRequired
inputCreateImageGenerationInput!Yes

Input fields

input

CreateImageGenerationInput

FieldTypeRequiredDescription
projectReferenceString!YesProject UUID, slug or configured domain.
promptString!YesText description of the desired image (max 1000 characters)
countIntNoNumber of images to generate (1-10, default: 1)
seedIntNoRandom seed for reproducible generation

Response

Returns ImageGeneration!. Open the type for its fields and nested types.

FieldTypeDescription
sources[String!]!CDN URLs of the generated images; an image that failed is left out.
countInt!Number of images generated.
requestedCountInt!
generatedCountInt!
failedCountInt!
skippedCountInt!
results[ImageGenerationItem!]!

Types marked with ! cannot be null. Lists use [Type] notation. The type index lists all published input and response types.

Example

graphql
mutation CreateImageGeneration($input: CreateImageGenerationInput!) {
  createImageGeneration(input: $input) {
    count
    failedCount
    generatedCount
    requestedCount
    skippedCount
  }
}
json
{
  "input": {
    "projectReference": "00000000-0000-4000-8000-000000000001",
    "prompt": "example"
  }
}