Stable Diffusion - Shared Commands 

<< 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 

SDL.Enshure Format

Previous Top Next


MiniRobotLanguage (MRL)

 

SDL.Enshure Format

Ensures the graphic file is in the specified format and optionally resizes it.

 

 

Intention

 

The SDL.Ensure Format command is designed to take an original graphic file in any of the BMP, JPG, or PNG formats and convert it to a specified format.

Optionally, it can also resize the graphic to the given dimensions.

This command is particularly useful for preparing images for other commands that require a specific format or size, such as IMG2IMG commands.

The original file will not be modified; a new file will be created if necessary.

 

 

 

 

Syntax

 

 

SDL.Enshure Format[P1] … ELS. … EIF.

 

 

Parameter Explanation

 

P1: (Required) Filepath and name of the original input graphic file. The file should be in any of the BMP, JPG, or PNG formats.

 

P2: (Required) The desired output format. This can be "PNG," "BMP," or "JPG."

 

P3: (Optional) The desired width (XSize) for the resized image. If both P3 and P4 are "0," the image will not be resized.

 

P4: (Optional) The desired height (YSize) for the resized image. If both P3 and P4 are "0," the image will not be resized.

 

P5: (Optional) A variable that will be used to store the filepath of the converted and optionally resized graphic file. If omitted, the result is placed on TOS.

 

 

 

 

Example

 

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

' SDL.-Sample for ensuring graphic format and size

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

SDL.Ensure Format|C:\Images\Original.jpg|PNG|512|512|$$RE

' The original JPG image will be converted to a PNG format and resized to 512x512. 

' $$RES will contain the path and filename of the file "to use for IMG2IMG" or whatever you want do with it.

ENR.

 

 

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also: