Generate Image

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > AI - Artificial Intelligence Commands > AIC. - Artificial Intelligence Command > ! Open AI - DALL.E >

Generate Image

AIC.Set Image Size

Previous Top Next


MiniRobotLanguage (MRL)

 

AIC.Set Image Size
Use the Open AI-API Server to Set Image Sizes from a Text-Prompt

 

clip0684

 

 

Intention

 

The AIC.Set Image Size command in the Smart-Package Robot (SPR) allows users to set the desired image size for images that will be generated using the OpenAI Image Generation endpoint. This command should be used prior to issuing any commands that generate images, to ensure that the output images are of the desired resolution.

 

### Syntax:

 

AIC.Set Image Size|<ImageSize>

 

### Parameters:

 

`<ImageSize>`: The resolution of the image to be generated. It must be in the format `WIDTHxHEIGHT` and can range from `256x256` to `1024x1024`. For example, "512x512".

 

### Example Usage:

 

AIC.Set Image Size|1024x1024

 

### Costs:

 

The costs for using the OpenAI Image Generation Endpoint through the SPR command are based on the resolution of the output image.
As of the time of writing, the costs are as follows:

 

- 256x256 resolution: $0.016 per image

- 512x512 resolution: $0.018 per image

- 1024x1024 resolution: $0.020 per image

 

Please note that if you are a new user of OpenAI’s API, you can benefit from a free trial that allows you to use $18 of free credits within your first three months.
Keep in mind that pricing may change, so it's advisable to consult the official OpenAI documentation for the most current information.

 

 

' Set OpenAI API-Key from the saved File

AIC.SetKey|File

 

' This will make the AI to generate 3 Pictures. 

AIC.SetNumber|3

 

' Picture-Size can be 256 or 512 or 1024

AIC.Set Image Size|256

 

$$TXT=Chessboard with a nice golden Cowgirls on it. 

AIC.Set Image Size|$$TXT

 

' Uncomment these lines below to see the Original Output of the API

' in case of errors

'AIC.gro|$$ROW

'MBX.$$ROW

ENR.

 

 

Syntax

 

 

AIC.Set Image Size|P1

AIC.SIS|P1

 

 

Parameter Explanation

 

P1 - opt. Picturesize: This can only be one of these: "256x256", "512x512" or "1024x1024". If you omit this, "256x256" is chosen.

 

Example

 

'*****************************************************

' EXAMPLE 1: AIC.-Commands

'*****************************************************

' Set OpenAI API-Key from the saved File

AIC.SetKey|File

 

' This will make the AI to generate 3 Pictures

AIC.SetNumber|3

' Can be 256 or 512 or 1024

AIC.Set Image Size|256

$$TXT=Chessboard with a nice golden Cowgirls on a horse with 4 legs and an galactic atmospere. 

AIC.Set Image Size|$$TXT

 

' Use this to see the Original Output of the API

' in case of errors

'AIC.gro|$$ROW

'MBX.$$ROW

ENR.

 

 

Remarks

-

 

Limitations:

-

 

 

See also:

 

  DMP. Dump System Values