AIU. - Artificial Intelligence Utility

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > AI - Artificial Intelligence Commands > AIU. - OpenAI API > !Image Generation Settings >

AIU. - Artificial Intelligence Utility

AIU.SetImageSize

Previous Top Next


MiniRobotLanguage (MRL)

 

AIU.SetImageSize
Set the Size for Generated Images

 

Intention

 

SetImageSize Command: Define Image Dimensions
 
The SetImageSize command specifies the dimensions for images generated by commands like AIU.GenerateURL or AIU.GenerateFile.

This allows control over the output size for visual content generation.

It’s part of the AIU - OpenAI API suite.

 

What is the SetImageSize Command?

 

The SetImageSize command sets the resolution for AI-generated images, accepting a string in the format "WIDTHxHEIGHT" (e.g., "1024x1024").

When using OpenAI’s DALL-E 3, supported sizes are 1024x1024 (square), 1792x1024 (landscape), and 1024x1792 (portrait). This setting affects generation time and cost but not text token counts.

 

Why Do You Need It?

 

Setting the image size is essential for:

Customization: Tailor image dimensions to your application’s needs (e.g., thumbnails, wallpapers).

Cost Control: Larger sizes (e.g., 1792x1024) may cost more with DALL-E 3 than smaller ones.

Quality: Match resolution to desired detail level for generated visuals.

 

How to Use the SetImageSize Command?

 

Provide a single string parameter in "WIDTHxHEIGHT" format (e.g., "1024x1024").

For DALL-E 3 (as of March 18, 2025), valid sizes are 1024x1024 ($0.040/image), 1792x1024 ($0.080/image), and 1024x1792 ($0.080/image) in standard quality. This affects generation cost and time, not text tokens:

1024x1024: Square, default size, $0.040/image (standard), $0.080/image (HD).

1792x1024: Landscape, $0.080/image (standard), $0.120/image (HD).

1024x1792: Portrait, $0.080/image (standard), $0.120/image (HD).

 

Example Usage

 

AIU.SetImageSize|1792x1024

AIU.GenerateURL|A sunny beach|$$URL

DBP.Image URL: $$URL

 

Sets the image size to 1792x1024 (landscape) for a generated beach image.

 

Illustration

 

┌──────────────┬────────────────────┐

│ Size         │ Use Case           │

├──────────────┼────────────────────┤

│ 1024x1024    │ Square thumbnails  │

├──────────────┼────────────────────┤

│ 1792x1024    │ Landscape banners  │

├──────────────┼────────────────────┤

│ 1024x1792    │ Portrait posters   │

└──────────────┴────────────────────┘

Illustration of image sizes and typical applications.

 

Syntax

 

AIU.SetImageSize|P1

AIU.Set_ImageSize|P1

 

Parameter Explanation

 

P1 - A string in "WIDTHxHEIGHT" format (e.g., "1024x1024") specifying the image size. Required.

 

Example

 

AIU.SetImageSize|1024x1792

AIU.GenerateFile|A cat|cat.png|$$RES

DBP.File Path: $$RES

ENR.

 

Remarks

 

- No default size is set during initialization; DALL-E 3 defaults to 1024x1024 if unspecified.

- Invalid sizes (e.g., "800x800") may cause errors with DALL-E 3; stick to supported resolutions.

 

Limitations

 

- Requires exactly one parameter; omitting or adding extra parameters triggers an error (%IC_ER_PA).

- Limited to DALL-E 3’s supported sizes (1024x1024, 1792x1024, 1024x1792).

 

See also:

 

AIU.Get_ImageSize

AIU.Generate_URL

AIU.Generate_File

Image Generation Settings