<< Click to Display Table of Contents >> Navigation: 3. Script Language > AI - Artificial Intelligence Commands > SD - Stable Diffusion AI > SD - Shared Commands > Stable Diffusion - Shared Commands |
MiniRobotLanguage (MRL)
SDL.Ensure Equal Dimension / SDL.Eed
Generates a PNG image based on a given image (P1), resized to match the dimensions of a reference image (P2).
Intention
The SDL.Ensure Equal Dimension command is designed to create a new PNG image with dimensions that match those of a reference image (P2).
This command is particularly useful for ensuring that mask images are the same size as the original image.
The images themselves are not altered; instead, a temporary PNG image is generated, and its file path is returned.
The new image is based on an existing image (P1).
Special case: If a "!" prefix is used with P1, and P2 is invalid, the original path of P1 is returned otherwise in case of P2 being invalid nothing is returned.
Syntax
SDL.Ensure Equal Dimension|P1|P2[|P3]
Parameter Explanation
P1 - OriginalImageFilePath: Specifies the file path of the image to be resized.
If P2 is invalid, nothing is returned, unless you specify a "!" as prefix to P1.
P2 - ReferenceImageFilePath: Specifies the file path of the reference image. The new PNG image will match these dimensions.
P3 - (Optional): Result-TempFilePath: A variable to store the file path of the newly generated PNG image. If omitted, the result is placed on TOS.
Example
'***********************************
' SDL.-Sample for ensuring equal dimension
'***********************************
$$IMG1 = ?path/to/image1.png
$$IMG2 = ?path/to/reference_image.png
SDL.Ensure Equal Dimension|$$IMG1|$$IMG2|$$TMP
' A new PNG image is created with dimensions matching $$IMG2,
' and its file path is stored in $$TMP
Remarks
-
Limitations:
-
See also:
•