<< Click to Display Table of Contents >> Navigation: 3. Script Language > AI - Artificial Intelligence Commands > AIC. - Artificial Intelligence Command |
The commands provided here offer you a gateway to the cutting-edge Artificial Intelligence services provided by industry leaders such as OpenAI and GPT4All and Stability AI.
Also you can use AI-Systems like Stable Diffusion local on your Computer.
In addition, if you're interested in top-tier speech synthesis, Elevenlabs' services are also readily accessible through these commands.
If it looks like magic, its possibly AI. The AIC.-Command is the tool of choice to combine the Ingredients.
Please read details about how to prepare for using these services.
The AIC.-Command is a collection of Subcommands that will connect you SPR-Script with the world of Artificial Intelligence.
You can test your idea and verify your API-Key here, online using:
There you have all options that the SPR also offers in the Script.
If you prefer a local installation of "Better GPT" (which i can recommend) then download and install:
This way you have the client local, and you can export your prompts into a ".csv" and use them later within your Script.
The following Sample-Code will take your Theme, ask Open AI to improve it. And then generate the Picture with SDL.
You need to have your OpenAI API-Key saved locally in the Scriptfolder using the Save_Key Command.
VAR.$$THE="neural network beautiful golden girl Galaxy robot digital photorealistic NC-1701 enterprise"
VAR.$$PAO=Please make me a prompt below 231 characters, for stable diffusion using the following Theme: $$THE. Please only the result and no further comments.
' Use Image Register 0
VIN.$$IMR=0
' Set OpenAI API-Key from the saved File
AIC.SetKey|File
' Set Model-Temperature
AIC.Set_Temperature|0
' Set Max-Tokens (Possible lenght of answer, depending on the Model up to 2000 Tokens which is about ~6000 characters)
' The more Tokens you use the more you need to pay. But the longer Input and Output can be.
AIC.SetMax_Token|300
FOR.$$STP|1|25
AIC.Ask_Chat|$$PAO|$$RET
DBP. Got: <<$$RET >>
$$FIR=?path\Sample Pics\Testresult_?.png
FIL.gen|$$FIR|1|0|$$FIL
SDL.gtf|$$RET|$$FIL
ANA.Load|$$IMR|$$FIL
' This will print a Text inside the Picture
$$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
' Mow we load the picture
DBP.Loaded in IR:$$IMR -> $$FIL
ANA.Save|$$IMR|$$FIL
ANA.Show|$$IMR!
NEX.
ENR.
One of the SDL.-generated Pictures.