SDO. Stable Diffusion Online

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > AI - Artificial Intelligence Commands > SD - Stable Diffusion AI > SDO. Stable Diffusion Online >

SDO. Stable Diffusion Online

SDO.Set_Size 

Previous Top Next


MiniRobotLanguage (MRL)

 

SDO.Set_Size

Set correct image size for SDO

 

clip0757

 

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.

The third parameter, P3, is optional and specifies the engine to be used for image generation.

 

The engine must be one of the following:

esrgan-v1-x2plus

stable-diffusion-xl-1024-v0-9

stable-diffusion-xl-1024-v1-0

stable-diffusion-v1

stable-diffusion-v1-5

stable-diffusion-512-v2-0

stable-diffusion-768-v2-0

stable-diffusion-depth-v2-0

stable-diffusion-512-v2-1

stable-diffusion-768-v2-1

stable-diffusion-xl-beta-v2-2-2

stable-diffusion-x4-latent-upscaler

stable-inpainting-v1-0

stable-inpainting-512-v2-0

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

If you do not want that use "SDO.Set_Size_Free".
 
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 and uses the stable-diffusion-768-v2-0 engine.

SDO.SetSize|512|768|stable-diffusion-768-v2-0

 

' This command sets the image size to 1024x1024 pixels and uses the stable-diffusion-xl-1024-v1-0 engine.

SDO.SetSize|1024|stable-diffusion-xl-1024-v1-0 

 

' This command sets the image size to 640x640 pixels and uses the default engine.

SDO.SetSize|640 

 

 

 

 

Syntax

 

 

SDO.SetSize|P1[|P2][|P3]

 

 

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.

 

P3 - (Optional) The name of the engine to be used for generating the image. If omitted, the default engine will be used.

     The available engines are:
 

esrgan-v1-x2plus

stable-diffusion-xl-1024-v0-9

stable-diffusion-xl-1024-v1-0

stable-diffusion-v1

stable-diffusion-v1-5

stable-diffusion-512-v2-0

stable-diffusion-768-v2-0

stable-diffusion-depth-v2-0

stable-diffusion-512-v2-1

stable-diffusion-768-v2-1

stable-diffusion-xl-beta-v2-2-2

stable-diffusion-x4-latent-upscaler

stable-inpainting-v1-0

stable-inpainting-512-v2-0

 

Each engine has specific requirements and limitations regarding the image dimensions. For example the esrgan engines can not be used for text-to-image. Also the "Inpainting" engines have special uses.

 

 

 

Example

 

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

'

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

 

 

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also:

 

    1.6.1. Program Flow Control

    ! Smart Package Robot 's Parallel Robot Operations

    1.5. Features and Hints