AI - Internet Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > AI - Artificial Intelligence Commands > AIC. - Artificial Intelligence Command > AI - Internet Commands >

AI - Internet Commands

AIC.Download Imagefile

Previous Top Next


MiniRobotLanguage (MRL)

 

AIC.Download Image File
Download an Image File from an specified URL and save it as File.

 

Px (1)

This picture is one of 3 pictures that was created using the Script below.

 

When using the "Image Generation Commands" you may get this type of returns (see Script and picture below) that contain URL's of the generated Pictures.

Instead of having them automatically downloaded and saved, you can also do that manually.

And of course you can also download other pictures from the Internet, from social media etc. in case you have the URL.

 

' Set OpenAI API-Key from the saved File

AIC.SetKey|File

 

' This will make the AI to generate 3 Pictures

AIC.SetNumber|1

' Can be 256 or 512 or 1024

AIC.Set Image Size|256

$$TXT=Chessboard with a nice golden Boxer on a horse with 4 legs and an galactic atmospere. 

AIC.Generate Image|$$TXT

 

' Use this to see directly the last Output of the API

AIC.gtt|0|$$ROW

MBX.$$ROW

AIC.Download Image File|$$ROW|?exeloc\MyPic_****.png|005

ENR.

 

clip0607

 

 

Intention

 

The AIC.Download Image File command is designed to download images from a specified (P1) internet URL and save them to a designated location on the local storage.
This command is versatile and can be used for downloading images from various sources, including those generated through the OpenAI Image Generation commands.

Additionally, it is used internally by SPR to store images that are created by the image generation commands.

 

Syntax:

 

AIC.Download Image File|<URL>|<Path+Filename>|<Filenumber to replace "****" in the Filename>

 

 

Parameters:

<URL>: The complete URL of the image that you want to download. It must start with http:// or https://.

 

<Path+Filename>: The path where you want to save the downloaded image along with the desired filename. The path should be valid and the filename should include the file extension (e.g., .jpg, .png). You can include **** in the filename which will be replaced by the filenumber parameter.

 

<Filenumber to replace "****" in the Filename>: A number which will replace the **** in the filename. This can be used to create unique filenames for multiple downloads. It should be an integer.

 

Example Usage:

 

AIC.Download Image File|https://example.com/image.jpg|C:/images/picture****.jpg|001

 

In this example, the command will download the image from https://example.com/image.jpg and save it to C:/images/ with the filename picture001.jpg.

 

Important Considerations:

Valid URL: Ensure that the URL is valid and is accessible. URLs that require authentication or are otherwise restricted may not work.

Storage Space: Make sure that there is sufficient storage space at the specified location for the image file.

File Formats: Ensure that the filename includes the correct file extension corresponding to the format of the image being downloaded.

Permissions: The specified path should be a location where the application has write permissions.

Unique Filenames: Using the filenumber replacement feature (****) is useful for ensuring unique filenames and avoiding overwriting existing files.
Currently files with the same name will be overwritten, without any message.

 

Note:

Please use this command responsibly and ensure that you have the rights to download and use the images.
Be aware of copyright and licensing issues when downloading images from the internet.

 

 

Syntax

 

 

AIC.Download Image File|P1[|P2][|P3]

AIC.DIM|P1[|P2][|P3]

 

 

Parameter Explanation

 
P1 - URL of the file to download

P2 - opt. Variable with the Filename and Path where the Picture shall be saved. I(f the Filename contains "****", these will be replaced with the number in P3.

P3 - opt. Variable or numeric value, this is the number of alternative results. It will replace the "****" in P2.

 

 

Example

 

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

' EXAMPLE 1: AIC.-Commands

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

' Set OpenAI API-Key from the saved File

AIC.SetKey|File

 

' This will make the AI to generate 3 Pictures

AIC.SetNumber|1

' Can be 256 or 512 or 1024

AIC.Set Image Size|256

$$TXT=Chessboard with a nice golden Boxer on a horse with 4 legs and an galactic atmospere. 

AIC.Generate Image|$$TXT

 

' Use this to see the last Output of the API

AIC.gtt|0|$$ROW

MBX.$$ROW

AIC.Download Image File|$$ROW|?exeloc\MyPic_****.png|005

ENR.

 

 

Remarks

-

 

Limitations:

-

 

 

See also:

 

  Download File

  Set_Key

  Ask_Chat

  Ask_Completion