1. Tasks
  2. Generate Image

Tasks

Generate Image

This task is used to generate an image from a text prompt.

Example Uses

  • Use this to auto create a logo for a company / division
  • Use this to generate a picture for a PDF document generated by the generate_pdf task
  • Use this to generate a picture for a newsletter email automatically from the email content
  • Use this to welcome a new user with a personalized image
  • Use this to generate an avatar for a user based on their profile information

Detailed Description

This task uses diffusion models to generate images from text prompts.
Examples of text prompts include text describing exactly what image you would like to generate.
Try to be as descriptive as possible to get the best results.
Indicate the type of image you require eg. logo, banner, photo, painting, marketing material, etc.

Basic usage

{
tasktype
:
generate_image
taskapigatewayuuid
:
e366a208-63a2-48ea-af74-e3e0abf703b4
params
:
{
prompt
:
A white cat sitting on a red sports car.

Parameters

prompt
required
string

The text prompt to generate the image from.


model
optional
string

The text to image model to use.

Default: dall-e-3


filename
optional
string

The name of the generated image file.


size
optional
string

The size of the generated image.

One Of: 1024x1024 | 1024x1792 | 1792x1024


quality
optional
string

The quality of the generated image.

One Of: standard | hd


disable_model_response
optional
string

If this is set to true, the model will not post the image on the stub.
The image will still be available on the original stubpost in the task payload.


Result

{
success
:
true
payload
:
{
request
:
{
prompt
:
A white cat sitting on a red sports car.
size
:
1024x1024
model
:
dall-e-3
quality
:
standard
n
:
1
response
:
{
created
:
1719985469
data
:
[
1 item  
0
:
{
revised_prompt
:
A picture of a white-furred feline comfortably perched on the shiny hood of a vibrant red sports car. The car glows under the sunny daylight with a sleek aerodynamic structure. The curious cat, with its tail curled around its feet, stares into the distance.
url
:
<url-here>
image
:
{
filename
:
2024-06-19-XXXX-YRA3_35000afc-2e6f-5fe9-86b5-1490cd426d41_generate_image.png
originalname
:
2024-06-19-XXXX-YRA3_35000afc-2e6f-5fe9-86b5-1490cd426d41_generate_image.png
fileuuid
:
530cabeb-7ce7-57b1-ace3-d3795f4fa5bb
contentType
:
image/png
revised_prompt
:
A picture of a white-furred feline comfortably perched on the shiny hood of a vibrant red sports car. The car glows under the sunny daylight with a sleek aerodynamic structure. The curious cat, with its tail curled around its feet, stares into the distance.

Result

white cat on hood