Image Playground Error: Unable to Generate Images Using externalProvider Style

I’m working on generating images using Image Playground. The code works fine for other styles but fails when using an external provider. I don’t see any other requirements mentioned in the documentation. Has anyone else encountered a similar issue?

Here’s the relevant code snippet:

https://developer.apple.com/documentation/imageplayground/imageplaygroundstyle/externalprovider?changes=_2

The error message is also not very helpful. It simply states that the creation failed.

Note: I have enabled ChatGPT Plus, and the image generation using ChatGPT styles works fine when using the Playground app.

do {
     let creator = try await ImageCreator()
      let concept = ImagePlaygroundConcept.text("Love")
      let images = creator.images(for: [concept], style: .externalProvider, limit: 1)
      for try await image in images {
         // Handle image
      break
     }
   } catch {
     // Handle error
 }

I’m using the iOS 26 RC, and when I print creator.availableStyles, it doesn’t display the external Provider.

[ImagePlayground.ImagePlaygroundStyle(id: "animation", _representationInfo: nil), ImagePlayground.ImagePlaygroundStyle(id: "emoji", _representationInfo: nil), ImagePlayground.ImagePlaygroundStyle(id: "illustration", _representationInfo: nil), ImagePlayground.ImagePlaygroundStyle(id: "sketch", _representationInfo: nil), ImagePlayground.ImagePlaygroundStyle(id: "messages-background", _representationInfo: nil)]
Answered by DTS Engineer in 857858022

Hi @kingofbliss,

Before choosing a style to generate an image with ImageCreator, your app should first check .availableStyles to ensure availability. Based on the result of this check in your provided example, the .externalProvider style is unavailable because it is not included in the returned list of available styles.

Currently, the .externalProvider style is only available as part of the UI-based API when your app presents an ImagePlaygroundViewController.

Best,

-J

Hi @kingofbliss,

Before choosing a style to generate an image with ImageCreator, your app should first check .availableStyles to ensure availability. Based on the result of this check in your provided example, the .externalProvider style is unavailable because it is not included in the returned list of available styles.

Currently, the .externalProvider style is only available as part of the UI-based API when your app presents an ImagePlaygroundViewController.

Best,

-J

Image Playground Error: Unable to Generate Images Using externalProvider Style
 
 
Q