<< 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 |
MiniRobotLanguage (MRL)
SDL.Generate Picture to File
Generates a picture using AI and saves it to a specified file as a PNG, JPG ,BMP or JPEG2000
This picture was generated using Stable Diffusion.
Intention
The SDL.Generate Picture to File command employs Stable Diffusion, an AI technology, to generate pictures from given prompts.
The generated picture is saved as a PNG file at a designated location.
Stable Diffusion:
Stable Diffusion is a type of generative model that uses diffusion processes for image synthesis. It starts from a random noise image and gradually refines it step by step until it matches the prompt description. The diffusion process can be seen as a series of small steps diffusing from a rough outline to a detailed image.
Please see here on how to install Stable Diffusion prior to using these commands.
SDL. - Stable Diffusio Local System
USAGE EXAMPLES
Generate a picture with a default number of steps:
SDL.Generate Picture to File|A sunset over the ocean|C:\Pictures\OceanSunset.png
This command generates a picture based on the prompt "A sunset over the ocean" and saves it to the file "OceanSunset.png" at the location "C:\Pictures".
Generate a picture with a specified number of steps:
SDL.Generate Picture to File|A cat sitting on a mat|C:\Pictures\Cat.png|50
This command generates a picture based on the prompt "A cat sitting on a mat" with 50 steps and saves it to the file "Cat.png" at the location "C:\Pictures".
The generated images are based on the given prompt, but as the process involves randomness, the results can vary and may not always align perfectly with the prompt.
The number of steps parameter influences the image quality and generation time. More steps usually result in better images but take longer to generate.
The "SDL.Set Picture Size" command can be used to set the size of the generated picture.
CAUTIONS
Ensure that the process has write permissions to the specified filepath and that there is sufficient disk space for the PNG file.
Keep in mind that the command's execution time depends on the number of steps and the specified picture size.
High resolution images with many steps may require significant processing time and resources.
Always validate the image quality and adjust the parameters as needed.
Syntax
SDL.Generate Picture to File|P1|P2[|P3]
Parameter Explanation
P1 - The prompt based on which the AI will generate the picture. This can be any string description. The AI uses this as a guide to create an image that aligns with the provided prompt.
P2 - The file path and filename where the generated picture will be saved. Make sure the path is valid and the process has write permissions for the specified location. The filename should include the ".png" extension.
P3 - (Optional) The number of steps the AI should take to generate the picture. More steps can lead to higher quality images but take longer to generate. If P3 is omitted, a default value (currently 25) defined by the system is used.
Example
'***********************************
' SDL.-Command Sample
'***********************************
' We will generate some pictures and write a Text on the Bottom of these pictures.
'
$$PRO=neural network beautiful golden girl Galaxy robot digital photorealistic NC-1701 enterprise
' Use Image Register 0
$$IMR=0
FOR.$$STP|1|25
$$FIR=?path\Sample Pics\Testresult_?.png
FIL.gen|$$FIR|1|0|$$FIL
SDL.gtf|$$PRO|$$FIL
ANA.Load|$$IMR|$$FIL
$$TXT=SPR/SDO. generated: $$STP Steps
$$COA=&HFFFFFF
$$COB==&H0
$$BGC=-2
$$XPA=30
$$YPA=450
ANA.PrintAt|$$IMR|$$TXT|$$COA|$$BGC|$$XPA|$$YPA|24
ANA.PrintAt|$$IMR|$$TXT|$$COB|$$BGC|($$XPA+1)|($$YPA+2)|24
DBP.Loaded in IR:$$IMR -> $$FIL
ANA.Show|$$IMR
NEX.
ENR.
'***********************************
' SDL.-Command Sample 2
' Resizing Pictures after Generation
'***********************************
SDO.SetKey|File
SDO.SetSize|512|512|stable-diffusion-v1-5
$$PRO=sexy asian women,rainbow colored hair, galaxy background
$$NEG=b/w,old(.5),fat(.3).Twins,twice,two
SDL.Set Size free|512|512
FOR.$$LOO|10|100|20
SDL.SetSteps|$$LOO
$$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|128|128
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:
• SDL. - Stable Diffusion Local