Generate Image
ActionStep Reference » OpenAI » Image » Generate Image
The OpenAI Image Generation ActionStep is a creative tool that leverages OpenAI's API to produce images from textual descriptions. This powerful feature transforms your words into visual art, allowing for a wide range of applications from concept visualization to content creation.
Here is an example of a created image:
- Open the OpenAI node in the Workspace Explorer.
- In the Image node, select the Generate Image ActionStep.
Parameters:
The ActionStep has the following input parameters:
Name |
Description
|
---|---|
API Key | The OpenAI API key. Allowed Context Scopes [Fixed, Local, Global, Reference] Allowed Context Types [Fixed, Variable, Parameter, Result, Enum] Allowed Context Values [String] |
Image Description | The text decribing the image you want to generate. Allowed Context Scopes [Fixed, Local, Global, Reference] Allowed Context Types [Fixed, Variable, Parameter, Result, Enum] Allowed Context Values [String] |
Drawing Style | The drawing style. Allowed Context Scopes [Fixed, Local, Global, Reference] Allowed Context Types [Fixed, Variable, Parameter, Result, Enum] Allowed Context Values [String] |
Width | The width of the image. Allowed Context Scopes [Fixed, Local, Global, Reference] Allowed Context Types [Fixed, Variable, Parameter, Result, Enum] Allowed Context Values [Int64] |
Height | The height of the image. Allowed Context Scopes [Fixed, Local, Global, Reference] Allowed Context Types [Fixed, Variable, Parameter, Result, Enum] Allowed Context Values [Int64] |
Timeout | The timeout in milliseconds for the API request. Allowed Context Scopes [Fixed, Local, Global, Reference] Allowed Context Types [Fixed, Variable, Parameter, Result, Enum] Allowed Context Values [Int64] |
Results:
The ActionStep returns the following results:
name |
Description
|
---|---|
Success | Indicates the result of the OpenAI request. Allowed Context Scopes [Fixed, Local, Global, Reference] Allowed Context Types [Fixed, Variable, Parameter, Result, Enum] Allowed Context Values [Boolean] |
Image Pathname | The pathname of the generated image. Allowed Context Scopes [Fixed, Local, Global, Reference] Allowed Context Types [Fixed, Variable, Parameter, Result, Enum] Allowed Context Values [String] |
Image | The created image. Allowed Context Scopes [Fixed, Local, Global, Reference] Allowed Context Types [Fixed, Variable, Parameter, Result, Enum] Allowed Context Values [Bitmap] |
Example 1 (Image Generation):
This example displays an ActionScript for generating images using OpenAI's API. The script starts by defining a command for the image to be created, which includes a detailed description of two tall figures with long arms and legs, big eyes facing each other, and a junkyard in the background. With the OpenAI Generate Image ActionStep, it uses the provided API key and the defined parameters, such as image description, drawing style, width, height, and timeout, to generate an image that meets the description. Upon successful execution, the script saves the image, returning the image pathname and the image itself in the result list. Finally, the image is saved to a specified path.
See other operations: