LogoPixi’VN
indexNamespacesaiNamespacesimageFunctions

Function: generateElement()

> generateElement(request, options?): Promise<string>

Defined in: src/ai.ts:124

Generate a single visual element (e.g. a character) from a developer request, completely hiding prompt engineering.

The image is meant to be layered on top of other visuals: the area behind the subject is transparent, and ElementImageGenerateOptions.align describes where it will be positioned so the model can compose it accordingly.

Parameters

request

string

Natural language description of the element to generate.

options?

ElementImageGenerateOptions

Options controlling which context gets included in the prompt.

Returns

Promise<string>

The generated image, as a data URI, ready to use directly as a Pixi'VN image source.

On this page