Your email address belongs to a school and you are eligible for a free educational premium account.
Learn more

Convert anything using TEXT-TO-IMAGE


The API for converting any file using TEXT-TO-IMAGE.

Here you can see all available conversion options which you can use within the "options" section of conversions (see the example JSON below the table).

Here you can see all available conversion options which you can use within the "options" section of conversions (see the example JSON on the right).

Option Name Description
allow_multiple_outputs
Type: boolean
Default: False
If the conversion produces more than one output file, by default all of them are compressed in just one file. Set this option to true if you want a download link for each file.
aspect_ratio
Type: string
Enum: 1:1 3:2 4:3 4:5 9:16 16:9 21:9
The aspect ratio of the final image. It is ignored if width or height are set. Please note that not all the ratios are available for every style.
cfg_scale
Type: number
Minimum: True
Maximum: 30
Classifier Free Guidance Scale. How strongly the image should conform to prompt. Lower values produce more creative results.
download_password
Type: string
Pattern: ^[ -~]{0,1000}$
Example: secret_password
A password to protect the download. To download the file send the password in the x-oc-download-password header or set a cookie named x-oc-download-password. The value contains a comma separated list of passwords.
height
Type: number
Minimum: 64
Maximum: 5120
Sets the height of the image in pixels
num_inference_steps
Type: integer
Minimum: True
Maximum: 60
How many times to improve the generated image iteratively; higher values take longer; very low values can produce bad results.
preset
Type: string
Pattern: ^[\w\W]{1,255}$
Predefined options
seed
Type: integer
Minimum: True
Maximum: 4294967295
A value that determines the output of random number generator. If you create an image with same parameters and seed as another image, you'll get the same result.
style
Type: string
Enum: anime artistic generic photorealistic
Optimizes the generated images to the selected style
width
Type: number
Minimum: 64
Maximum: 5120
Sets the width of the image in pixels

Output Example

POST /v2/jobs HTTP/1.1
Host: https://api.api2convert.com
X-Oc-Api-Key: <your API key here>
Content-Type: application/json
{
    "input": [{
        "type": "remote",
        "source": "https://example-files.online-convert.com/raster%20image/png/example_small.png"
    }],
    "conversion": [{
        "category": "operation",
        "target": "text-to-image",
        "options": {
            <conversion options here>
        }
    }]
}