<< 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 Mask Dimension / SDL.Emd
Creates a new PNG mask image with the same dimensions as an original image, fills it with a color, and positions an existing mask within it.
Intention
The SDL.Ensure Mask Dimension command generates a new PNG mask image at a temporary file path, that has the same dimensions as an original image.
It does not resize the existing mask to fit the new one. Instead, it fills the new mask with a specified color and places the existing mask at a designated position,
either cropping it or filling in extra space as needed.
Syntax
SDL.Ensure Mask Dimension|P1|P2[|P3][|P4][|P5]
Parameter Explanation
P1 - OriginalImageFilePath - Specifies the original image's file path, setting the dimensions for the new PNG mask.
P2 - MaskImageFilePath - Specifies the existing mask image's file path. This mask is positioned within the new one without resizing.
P3 - (Optional): BorderColor Specifies the fill color for the new mask. Defaults to "&H000000FF". Accepts RGB or RGBA, and can use "&H" for hex format.
P4 - (Optional): Position Sets where the existing mask is positioned within the new mask. Defaults to "LD" (Left-Down). Uses codes like "L" for Left, "C" for Center, etc.
P5 - (Optional): Result-TempFilePath A variable to store the new PNG mask's file path. If omitted, the result is placed on the Top Of Stack (TOS).
P4 - Position Codes:
L: Left
C: Center
R: Right
U: Up
D: Down
Combine codes for X and Y axes positioning, e.g., "LC" for Left-Center, "RU" for Right-Up.
Example
'***********************************
' SDL.-Sample for ensuring mask dimension
'***********************************
$$IMA=?path/to/original/image.png
$$IMB=?path/Mask.png
SDL.Ensure Mask Dimension|$$IMA|$$IMB|&HFFFFFF|LC|$$TMP
' New PNG mask created at left-center, file path stored in $$TMP
ENR.
Remarks
-
Limitations:
-
See also:
•