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 > ! SDL - TXT2IMG >

Stable Diffusion Commands

SDL.Generate Picture to Var

Previous Top Next


MiniRobotLanguage (MRL)

 

SDL.Generate Picture to Var

Generate an image using the Stable Diffusion AI and store it in a specified variable.

 

SDL_Test_0396 

Image generated with the Script below.

 

 

Intention

 

The SDL.Generate Picture to Var command interfaces with the Stable Diffusion AI,

taking in a prompt (and an optional negative prompt) to guide the AI in generating an image.

 

The resultant image is stored in a specified variable P3 or placed on the Top of Stack if no destination variable is provided.

The output File format is ".png".

 

' Short Sample:

$$PRO="Sunset over the mountains"

$$NEG="No animals"

SDL.Generate Picture to Var|$$PRO|$$NEG|$$IMG

' Do something with the PNG-Data in the $$IMG Variable

ENR.

 

 

' Here is a Long Sample

$$PRO=Bio Food, natural women, meditating on a rainbow

$$NEG=ugly,comic,unrealistic,fat,unhealty,malformed faces

 

SDL.SetSteps|10 

SDL.Set_Sampler|3

' Choose your Model with the following line

'SDL.Set Model Free|dreamlike-photoreal-2.0.safetensors

SDL.Set Extra Parameter|"restore_faces": true

SDL.gtv|$$PRO|$$NEG|$$RES

LEN.$$RES|$$LEN

IVV.$$LEN>1000

' Here we construct a Filename and save the PNG-File

  RND.0|1000|$$ERG

  FMT.$$ERG|0000 

  $$PAT=?exeloc\SDL_Test_$$ERG.png

  CTF.$$PAT|$$RES

  ANA.load|0|$$PAT

  ANA.Resizeto|0|1|640|640

  ANA.show|1!

  ANA.Save|1|$$PAT

ELS.

  SDL.Get Several|6|$$RET

  DBP.$$RET

  SDL.Show Error

  MBT.No File generated.

EIF.

ENR.

 

 

Syntax

 

 

SDL.Generate Picture to Var[|P1][|P2][|P3][|P4]

 

 

Parameter Explanation

 

P1 - <Prompt>: The guiding input for the Stable Diffusion AI, directing the characteristics or theme of the generated image.

P2 - (optional) <Negative Prompt>: Optional. A negative prompt that instructs the AI on what to avoid or exclude in the generated image.

P3 - (optional) <Variable for Result>: Optional. The variable where the generated image data will be stored. If omitted, the result is placed on the Top of Stack (TOS).

 

 

Example

 

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

' SDL.-Sample

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

$$PRO=Bio Food, natural women, meditating on a rainbow

$$NEG=ugly,comic,unrealistic,fat,unhealty,malformed faces

 

SDL.SetSteps|10 

SDL.Set_Sampler|3

' Choose your Model with the following line

SDL.Set Model Free|dreamlike-photoreal-2.0.safetensors

SDL.Set Extra Parameter|"restore_faces": true

SDL.gtv|$$PRO|$$NEG|$$RES

LEN.$$RES|$$LEN

IVV.$$LEN>1000

  RND.0|1000|$$ERG

  FMT.$$ERG|0000 

  $$PAT=?exeloc\SDL_Test_$$ERG.png

  CTF.$$PAT|$$RES

  ANA.load|0|$$PAT

  ANA.Resizeto|0|1|640|640

  ANA.show|1!

  ANA.Save|1|$$PAT

ELS.

  SDL.Get Several|6|$$RET

  DBP.$$RET

  SDL.Show Error

  MBT.No File generated.

EIF.

ENR.

 

 

 

 

 

Remarks

 

  This is an Command for special use and my not be needed for daily use.

 

  Generally you can prefer and directly use the SDL.Generate Picture to File - Command, as this Command is for special use only.

  Its currently not possible to directly transfer the generated Image into an Image Register.

  The only way is, Saving the Image and Loading the Image using ANA.Load.

 

 

Limitations:

 

-

 

 

See also: