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

Previous Top Next


MiniRobotLanguage (MRL)

 

SDO.Set Extra Parameter

Add extra Parameter to the JSON that is sent to the Local Stable Diffusion server

 

Sampler_0042_Steps_140_SetSteps

Generated using SDO. and the Script below.

 

Intention

 

The JSON that is sent to the Cloud Server using SDO is very different then what we use with SDL. on the Local Server.

Also the technical details are available Online, via the URL:https://platform.stability.ai/docs/api-reference#tag/v1generation

and https://platform.stability.ai/sandbox/text-to-image .

 

You can add Extra-Parameter, these will be saved in an internal Register (there is one for SDL. and another for SDO.)

this will insert the content of this register without any change into the JSON before its sent to the Server.

If the Variable is empty it will not be inserted.

 

There is no Syntax checking, the given Parameter will be inserted as it is.

If the resulting JSON is invalid, the call will not produce a picture and instead will result in an error-message.

 

Due to the refined Scripting language of the SPR, handling JSON is very easy. You can just copy the Line from the JSON below, enter your value and thats it.

If you want to add multiple Extra Parameters separate them with a , (Comma).

 

As currently the SPR supports all known parameters, there seems to be no need for this Command with SDO..

As AI develops, this command is for future Expansion. General use is like this:

 

SDO.Set Extra Parameter|"clip_guidance_preset": "FAST_BLUE","n_iter": 2

 

Below the complete List of parameters that can be used for the Cloud Server.

 

All of these Parameters, are already included in the
SDO.Generate Picture to File/Var Command,  therefore you can just include them using the Standard Registers.

In case you include Text that needs to be escaped, its up to you to do so using the AIC.Escape - Command.

 

{

"cfg_scale": 7,

"clip_guidance_preset": "FAST_BLUE",

"height": 512,

"width": 512,

"sampler": "K_DPM_2_ANCESTRAL",

"samples": 1,

"steps": 75,

"text_prompts": [{}]

}

 

 

Syntax

 

 

SDO.Set Extra Parameter|P1

 

 

Parameter Explanation

 

P1 - (optional) - Additional Extra-Parameters for the JSON. Just copy the Line from the JSON.
          If you want to add multiple Extra Parameters separate them with a , (Comma).

          Here we add 2 Extra Parameters. One of them will create an error message from the Server using the Script below.

 

   SDO.Set Extra Parameter|"clip_guidance_preset": "FAST_BLUE","n_iter": 2

 

clip0741

Using Parameters that are not supported will bring up an Error Message, using the Script below.

 

Example

 

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

' SDO.-Sample

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

SDO.SetKey|File

SDO.SetSize|512|512|stable-diffusion-v1-5

 

' We will now change only this line and add weight to the prompt

$$PRO=golden robot man on rainbow colored planet planet,galaxy,planets

$$NEG=ugly,comic,unrealistic,fat

'SDL.Set Size free|512|512

FOR.$$LOO|140|150|2

  SDO.SetSteps|$$LOO   

' Currently this option will not change anything, we just use it to show usage

  SDO.Set Extra Parameter|"n_iter": 2

  $$FIL=?path\Sampler_?_Steps_$$LOO_SetSteps.jpg

  FOR.$$LOP|0|21

    SDO.Set_Sampler|$$LOP

    SDL.Get Several|4|$$RET

    DBP. Sampler=$$LOP ($$RET)

    SDO.gtf|$$PRO|$$FIL|$$NEG|7

    POP.$$PAT

    POP.$$SUC

    IVV.$$SUC=1

      ANA.load|0|$$PAT

      ANA.Resizeto|0|1|640|640

      ANA.show|1

      ANA.Save|1|$$PAT

    ELS.

      SDL.Get Several|6|$$RET

      DBP.$$RETSetSteps|10

      SDL.Show Error

      MBT.No File generated.

    EIF.

  NEX.

NEX.

MBX.!

ENR.

 

 

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also: