|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > AI - Artificial Intelligence Commands > AIU. - OpenAI API > !Image Generation Settings > AIU. - Artificial Intelligence Utility |
MiniRobotLanguage (MRL)
AIU.GetImageSize
Retrieve the Current Image Size Setting
Intention
GetImageSize Command: Verify Image Dimensions
The GetImageSize Command retrieves the current size setting for images generated by the AIU suite.
This helps confirm or utilize the image resolution in your script.
It�s part of the AIU - OpenAI API suite.
The GetImageSize Command returns the current image size set by AIU.SetImageSize, or an empty string if unset.
The result is a string in "WIDTHxHEIGHT" format (e.g., "1024x1024"), stored in an optional variable or pushed to the Top of Stack (TOS). For DALL-E 3, it reflects one of: 1024x1024, 1792x1024, or 1024x1792.
Retrieving the image size is useful for:
�Verification: Ensure the size matches your generation needs before creating images.
�Logic: Adjust script behavior based on the current resolution setting.
�Debugging: Confirm the correct size is applied for DALL-E 3 compatibility.
Call the Command with an optional variable to store the result; if omitted, the value is pushed to the stack.
It applies to AIU.GenerateURL and AIU.GenerateFile. DALL-E 3 costs (standard quality) are: 1024x1024 ($0.040/image), 1792x1024 or 1024x1792 ($0.080/image).
Example Usage
AIU.SetImageSize|1024x1792
AIU.GetImageSize|$$SIZ
DBP.Image Size: $$SIZ
Sets the size to 1024x1792 (portrait) and retrieves it, storing "1024x1792" in $$SIZ.
Illustration
+-----------------------------+
� Set Size � � � Retrieved � ��
+--------------+--------------�
� 1024x1024 � �� 1024x1024 � ��
+--------------+--------------�
� (unset) � � �� "" � � � � � �
+-----------------------------+
Illustration of retrieving the image size, including unset state.
Syntax
AIU.GetImageSize[|P1]
AIU.Get_ImageSize[|P1]
Parameter Explanation
P1 - (Optional) The variable where the image size is stored. If omitted, the value is placed on the Top of Stack (TOS).
Example
AIU.SetImageSize|1792x1024
AIU.GetImageSize|$$DIM
DBP.Current Size: $$DIM
ENR.
Remarks
- Returns an empty string ("") if no size is set; DALL-E 3 defaults to 1024x1024 in such cases.
- Reflects the last value set by AIU.SetImageSize.
Limitations
- Accepts zero or one parameter; extra parameters trigger an error (%IC_ER_PA).
- Does not validate if the size is supported by DALL-E 3.
See also: