Stable Diffusion Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > AI - Artificial Intelligence Commands > SD - Stable Diffusion AI > SDL. - Stable Diffusion Local System >

Stable Diffusion Commands

SDL.Set Extra Parameter

Previous Top Next


MiniRobotLanguage (MRL)

 

SDL.Set Extra Parameter

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

 

Sampler_0037_Steps_140_SetSteps

Generated using SDL. and "n_iter:2" as extra Parameter.

 

Intention

 

The JSON used with SDL. is very different then what is sent to the Cloud Server using SDO.

Also the technical details are not available Online, but only

when the local Server is running, via the URL: http://127.0.0.1:7860/docs#/default/text2imgapi_sdapi_v1_txt2img_post

Anyway 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 not 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).

 

SDL.Set Extra Parameter|"save_images": true,"n_iter": 2

SDL.Set Extra Parameter|"restore faces": true

 

' Technically you could also change the Model like this:

$$MOD=v2-1_768-nonema-pruned.ckpt

SDL.Set Extra Parameter|"override_settings": {"sd_model_checkpoint": "$$MOD"}

 

 

This the complete List of parameters that can be used for the Local Server.

In the following list, those parameters that are already included in the
SDL.Generate Picture to File/Var Command,  are written in bold letters. Please do not use them a second time, 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.

{

  "enable_hr": false,

  "denoising_strength": 0,

  "firstphase_width": 0,

  "firstphase_height": 0,

  "hr_scale": 2,

  "hr_upscaler": "string",

  "hr_second_pass_steps": 0,

  "hr_resize_x": 0,

  "hr_resize_y": 0,

  "hr_sampler_name": "string",

  "hr_prompt": "",

  "hr_negative_prompt": "",

  "prompt": "",

  "styles": [

    "string"

  ],

  "seed": -1,

  "subseed": -1,

  "subseed_strength": 0,

  "seed_resize_from_h": -1,

  "seed_resize_from_w": -1,

  "sampler_name": "string",

  "batch_size": 1,

  "n_iter": 1,

  "steps": 50,

  "cfg_scale": 7,

  "width": 512,

  "height": 512,

  "restore_faces": false,

  "tiling": false,

  "do_not_save_samples": false,

  "do_not_save_grid": false,

  "negative_prompt": "string",

  "eta": 0,

  "s_min_uncond": 0,

  "s_churn": 0,

  "s_tmax": 0,

  "s_tmin": 0,

  "s_noise": 1,

  "override_settings": {},

  "override_settings_restore_afterwards": true,

  "script_args": [],

  "sampler_index": "Euler",

  "script_name": "string",

  "send_images": true,

  "save_images": false,

  "alwayson_scripts": {}

}

 

Currently the Implementation of SDL. uses only a Sub-Set of the most important Parameters.

You can add further Parameters using the SDL.Set Extra Parameter - Command.

 

 

 

Syntax

 

 

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

   SDL.Set Extra Parameter|"save_images": true,"n_iter": 2

 

 

Example

 

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

' IRS.-Sample

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

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

$$PRO=very small 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

  SDL.SetSteps|$$LOO   

  SDL.Set Extra Parameter|"save_images": true,"n_iter": 2

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

  FOR.$$LOP|0|21

    SDL.Set_Sampler|$$LOP

    SDL.Get Several|4|$$RET

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

    SDL.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: