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.Set_Size Free

Previous Top Next


MiniRobotLanguage (MRL)

 

SDL.Set_Size_Free

Set image size for SDO. and SDL.

 

clip0750

 

Intention

This command is used to set the size of the image that will be generated by the Stable Diffusion Online (SDO) service.

The size is specified in pixels and must be a multiple of 64 and greater than or equal to 128.

The first parameter, P1, specifies the width of the image.
If the second parameter, P2, is provided, it specifies the height of the image. If P2 is omitted, the height will be the same as the width.

 
There are rules for the possibly image sizes depending on the used Engine. This command will NOT try to fix malformed size parameters.

If you do want that use "SDL.Set_Size".
 
General Rules for the Image Size:

 

Both the height and width of the image must be multiples of 64 and greater than or equal to 128.

The default value for both dimensions is 512.

 

Engine-Specific Rules:

 

512 Engines: For engines that have a resolution of 512 (like stable-diffusion-512-v2-0 or stable-inpainting-512-v2-0), the product of the height and width of the image must be between 262,144 and 1,048,576. This means that the dimensions of your image could range from 512x512 (which equals 262,144) up to approximately 1024x1024 (which equals 1,048,576).

 

768 Engines: For engines that have a resolution of 768 (like stable-diffusion-768-v2-0), the product of the height and width of the image must be between 589,824 and 1,048,576. This means that the dimensions of your image could range from approximately 768x768 (which equals 589,824) up to approximately 1024x1024 (which equals 1,048,576).

 

SDXL Beta: For the stable-diffusion-xl-beta-v2-2-2 engine, the dimensions can be as low as 128 and as high as 896, as long as neither dimension exceeds 512. If either dimension is greater than 512, then the other dimension can be at most 512.

 

SDXL v0.9 and v1.0: For the stable-diffusion-xl-1024-v0-9 and stable-diffusion-xl-1024-v1-0 engines, the valid dimensions are 1024x1024, 1152x896, 1216x832, 1344x768, 1536x640, 640x1536, 768x1344, 832x1216, or 896x1152. These specific combinations ensure that the product of the height and width falls within the acceptable range for these engines.

 

Examples:

 

' This command sets the image size to 512x768 pixels 

SDL.SetSize Free|512|768

 

' This command sets the image size to 1024x1024 pixels

SDL.SetSize Free|1024

 

' This command sets the image size to 640x640 pixels.

SDL.SetSize Free|640 

 

This command lets you set any size, however if the size is not supported you will get an error-message from the Server instead of a picture.

 

 

Syntax

 

 

SDO.Set Size Free|P1[|P2]

SDL.Set Size Free|P1[|P2]

 

 

Parameter Explanation

 

P1 - The desired height of the image in pixels. This value must be a multiple of 64 and at least 128. The actual maximum value depends on the chosen engine and the width of the image.

 

  P2 - (Optional) The desired width of the image in pixels. If omitted, the width will be the same as the height. This value must also
         be a multiple of 64 and at least 128. The actual maximum value depends on the chosen engine and the height of the image.

 

 

 

 

Example

 

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

'

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

 

 

 

 

 

Remarks

 

-

 

 

Limitations:

 
The internal Registers for SDO. and SDL. for Height and With are the same. Any change here will also change the Size Variables for SDL. This way you can more easy switch between Local and Online Rendering.

 

 

See also: