DALL·E OpenAI request

DALL·E OpenAI request sends a text description to the DALL·E neural network and sends one or more links to images that were generated based on the text description you provided in the request.

Component Setup

1. From the Components section on the right panel, drag or double-click to add the DALL·E OpenAI request component to the desired screen.

2. In the Access Key field, add the OpenAI token. You can get it in the Open AI personal account (LogIn — API). Then, in the Overview section, open the Personal tab and select the View API keys section.

If OpenAl is not available in your country, use a VPN service.

Generate a token using the Create new secret key button.

3. In the Prompt field, enter an image description that the neural network should generate.

The description can be written in plain text or taken from a variable.

The simpler the description, the faster the image will be generated.

4. Add Variable Name to receive the image link from DALL·E in this variable.

After the image is generated and received by the bot, it can be output.

5. Specify Successful Request Screen. This screen will be executed when the request to the neural network is successful. If the successful request screen is not selected, the next component will be executed in case of success.

6. Specify the Request Error Screen. This screen will be executed in case of one or more request errors. Examples of errors:

  • the image is generated for too long;
  • invalid Open AI token specified;
  • Open AI is not available;
  • error on the Open AI side.

7. In Advanced Settings, from the list select the model that will generate images.

8. When using the DALL•E - 2 model, specify the number images you need to generate. If you select DALL•E - 3, the field with the images number selection will not be displayed in the component settings, since DALL•E - 3 can generate only one image.

9. If the DALL•E - 2 model is selected, change or leave the default size for the generated images. When choosing the DALL•E - 3 model, the images will be generated in a fixed size, it will not be possible to change it.

How to output an image from DALL·E to a message

From DALL·E, images come in a list with image links. You can see these links in the Users section by opening the variables of the user who sent the request.

If you need a picture to come to the bot immediately, the Image component will do.

Since the links from DALL·E come in the form of a list where the numbering starts from zero, the path to the variable containing the first picture will be like this: {{var.data.[0].url}}, the second picture will be here: {{var.data.[1].url}} etc. In this template, var is a variable for the DALL·E response, which is set in the settings.

Only one link can be output in one component. If there are more links, you can add several components one after the other.

In the same way, you can send an image using Document. If you send it as a document, the picture will come to the bot in its original size without compression. The image will be available to the user for download.

The same template will help to attach a link for Button.

To make the image link appear after clicking the button, add Buttons after Request to DALL·E, in the button settings, select the External URL checkbox and insert the template to output the first image {{var.data.[0].url}} in the Go to URL.

In the message, you can output one or more links to the image with a preview at the end.

The same template used for Image, Document and Buttons is suitable for it.

In addition, the stringify helper will work to output a link or several links in a message at once. With this helper, the template to output the link to the bot will be like this: {{stringify var}}.

DALL·E can generate up to 10 images at a time, but due to platform limitations, a large number of links may not be output in one message. If you need to get 8-10 images at a time, we recommend outputting links with two or more messages.

If the images are output one by one using the Image or Document components, they will all come in turn.

How to accept users requests

Using User Input or Fork, you can accept requests for image generation from the user.

To do this, you need to output a variable with a message from the user in the Prompt field. If you want to give the user the ability to determine the number of images, you can also ask about it by writing the answer to a variable with the Number data type.

Then this variable can be output in the DALL·E OpenAI request component settings in the The number of images to generate field. In this case, we recommend to inform about the restrictions.


To the beginning ↑