<!--
{
  "availability" : [
    "iOS: 26.4.0 - 27.0.0",
    "iPadOS: 26.4.0 - 27.0.0",
    "macCatalyst: 26.4.0 - 27.0.0",
    "macOS: 26.4.0 - 27.0.0",
    "visionOS: 26.4.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "ImagePlayground",
  "identifier" : "/documentation/ImagePlayground/ImageCreator/images(for:style:options:limit:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Image Playground"
    ],
    "preciseIdentifier" : "s:15ImagePlayground0A7CreatorC6images3for5style7options5limitQrSayAA0aB7ConceptVG_AA0aB5StyleVAA0aB7OptionsVSitF"
  },
  "title" : "images(for:style:options:limit:)"
}
-->

# images(for:style:options:limit:)

Creates one or more images from the provided description and style information
and returns the results asynchronously.

```
final func images(for concepts: [ImagePlaygroundConcept], style: ImagePlaygroundStyle, options: ImagePlaygroundOptions, limit: Int) -> some AsyncSequence<ImageCreator.CreatedImage, any Error>
```

## Parameters

`concepts`

An array of initial concepts (text descriptions, concepts extracted
from text, drawings) that describe the expected contents of the returned images.

`style`

The style you want the model to apply to the output image.
It is a programmer error to specify a style that’s not in the `availableStyles` property.

`options`

Options that influence the image creation behavior.

`limit`

The maximum number of images you want the system to create.
The system limits the maximum number of images to 4.

## Return Value

An asynchronous stream you use to receive the images.

## Discussion

Call this method to start the image generation process with the specified
parameters. The method runs asynchronously and returns the results using the
provided <doc://com.apple.documentation/documentation/Swift/AsyncSequence> object.
The following example configures an image creator, starts the creation of the
images, and processes the generated images as they arrive:

```swift
do {
    let creator = try await ImageCreator()
    guard let style = creator.availableStyles.first else { return }
    var options = ImagePlaygroundOptions()
    options.creationVariety = .high
    options.personalization = .enabled
    options.sizeSpecification = ImagePlaygroundOptions.SizeSpecification.closest(to: CGSize(width: 1024.0, height: 1024.0))

    let images = creator.images(
        for: [.text("A cat wearing mittens.")]
        style: style,
        options: options,
        limit: 4)

    // Receive the images.
    for try await image in images {
        let anImage = image.cgImage

        // Do something with the image.
    }
}
catch ImageCreator.Error.notSupported {
    print(“Image creation not supported on the current device.”)
}
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)