One Logo Pool Ball
ImagePlayground · IOS API REFERENCE

ImagePlaygroundConcept

struct · iOS 18.1+ · SDK 27.1

struct ImagePlaygroundConcept

Text elements that specify the content to include in the image. Use this type to wrap pieces of text describing the image you want to create. You can also specify larger pieces of text that contain important concepts to extract and use to guide the image-creation process.

Members (5)

static · iOS 18.1+

text

TypeScript
static text(text: string): ImagePlaygroundConcept
Swift declaration
static func text(_ text: String) -> ImagePlaygroundConcept

Creates a concept structure that includes a short text description. - Parameters: - text: The text that describes the image. Your text must be relatively short, so specify single words or brief sentences. If you specify a string that exceeds the model’s supported maximum string length, the system tries to extract important or interesting concepts and use those instead. - Returns: A concept object that encapsulates the specified text. Call this method when you want to use short strings to generate an image. The system passes short strings in their entirety as input to the diffusion model. If you provide a long string, the system tries to extract only the relevant details and pass those to the model instead.

static · iOS 18.1+

image

TypeScript
static image(url: string): (ImagePlaygroundConcept) | null
Swift declaration
static func image(_ url: URL) -> ImagePlaygroundConcept?

Creates a concept structure from the image at the specified URL. - Parameters: - url: The URL of a local file that contains the image you want to pass to the diffusion model. Call this method when you want to use an image as the basis for generating a new image. Typically, you include other text-based concept structures in addition to this one. Include at most one image among the collection of concepts. Including more than one image yields unpredictable image results.

static · iOS 18.1+

image

TypeScript
static image80359(image: _CoreGraphics_CGImage): ImagePlaygroundConcept
Swift declaration
static func image(_ image: CGImage) -> ImagePlaygroundConcept

Creates a concept structure from the specified image object. - Parameters: - image: The image you want to pass to the diffusion model. Call this method when you want to use an image as the basis for generating a new image. Typically, you include other text-based concept structures in addition to this one. Include at most one image among the collection of concepts. Including more than one image yields unpredictable image results.

static · iOS 18.1+

drawing

TypeScript
static drawing(drawing: _PencilKit_PKDrawing): ImagePlaygroundConcept
Swift declaration
static func drawing(_ drawing: PKDrawing) -> ImagePlaygroundConcept

Creates a concept structure from a PencilKit drawing. - Parameters: - drawing: A PencilKit drawing object that contains a set of strokes. The system uses this drawing, along with other concepts, to guide the image creation. Call this method when you want to use a PencilKit drawing as the basis for generating a new image. Typically, you include other text-based concept structures in addition to this one. Include at most one PencilKit drawing among a collection of concepts. Including more than one drawing yields unpredictable image results.

static · iOS 18.1+

extracted

TypeScript
static extracted(text: string, title?: (string) | null): ImagePlaygroundConcept
Swift declaration
static func extracted(from text: String, title: String? = nil) -> ImagePlaygroundConcept

Creates a concept structure from a long-form string and a title that guides the extraction of concepts from that string. - Parameters: - text: A long text description, such as a paragraph or document. You can specify any length string you want. For strings above a minimum length, the system extracts important or interesting concepts using the contents of `title` as a guide. It converts the concepts it extracts into a separate input prompts for the diffusion model. For strings below the minimum length, the system passes the entire string to the model. - title: A concise summary of the text you pass in the `text` parameter. The system uses this string as a guide to extract concepts from the `text` parameter. - Returns: A concept object that encapsulates the concepts from the specified text. Call this method when you want to use long-form text to generate an image. The method extracts relevant details from the text and uses them to create the returned object.

Skipped declarations

No declarations were skipped in this snapshot.

All ImagePlayground types →