Description
The DALL-E Interface Asset (IA) is an off-the-shelf component of Intuiface that enables you to submit an image description to the OpenAI DALL-E Large Language Model (LLM) and receive a generated image in response. This IA uses the OpenAI Images API, accessing the same LLM used by ChatGPT and the DALL-E model.
The property/trigger/action structure of this OpenAI IA differs from that of the ChatGPT and Whisper IAs because this IA was automatically created using API Explorer while the other two were hand-coded using TypeScript.
This IA will generate one image per request.
NOTE: The current version of the DALL-E IA defaults to an incorrect OpenAI model. As indicated below, manually change the 'model' parameter to dall-e-2 or dall-e-3
Adding the DALL-E IA into your experience
The DALL-E Interface Asset can be added to any experience using the "Add an interface asset" option located within Composer's Interface Assets panel.
Creating and sending an image request
To create and send an image request, call the "Dall-E" action.
- Content-Type
This parameter should never be changed from its default value of 'application/json'. - Authorization
Place your OpenAI API key in this parameter.
An API key is acquired by creating an OpenAI account and then purchasing tokens. (Each DALL-E prompt and response consumes tokens, and those tokens have a cost.)
Once you have an account and have purchased tokens, head to the OpenAI API Key page to find your key. - prompt
The image description sent to the DALL-E model. - size
(optional) The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024 for DALL-E 2. Must be one of 1024x1024, 1792x1024, or 1024x1792 for DALL-E 3. If you don't specify a size, it defaults to 1024x1024. - model
The DALL-E model version you'd like to use. You can choose from any of OpenAI's currently supported DALL-E models, referenced as "/v1/images/generations'. The current possible values are dall-e-2 and dall-e-3. If you don't specify a model, it defaults to dall-e-2. - style
(optional) The style of the generated images. Must be one of 'vivid' or 'natural'. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This parameter is only supported for DALL-E 3. If you don't specify a style, it defaults to vivid. - quality
(optional) The quality of the image that will be generated. Must be one of 'standard' or 'hd'. hd creates images with finer details and greater consistency across the image. This parameter is only supported for DALL-E 3. If you don't specify a quality, it defaults to standard.
Accessing the generated image
The generated image is accessible via a URL found in the "URL" parameter of the DALL-E GPT read-only property "data".
Additional triggers
- Response started
Raised when the Images API has started to return its response. - Response completed
Raised when the Images API has completed its response. - Request failed
Raised when an error is returned instead of an image.
- read-only parameter: Status code
An error status code returned by the Images API. - read-only parameter: Raw response
Details of the error.
- read-only parameter: Status code
Comments
0 comments
Please sign in to leave a comment.