PollinationsAiPS is a PowerShell library designed to simplify interactions with the Pollinations.ai ecosystem. It allows developers and sysadmins to leverage a many powerful AI models for image creation, text generation, and audio processing without leaving the terminal.
Key Features:
- Image Generation: Create visuals from text prompts with customizable parameters.
- Text Generation: Interface with LLMs for chat and text completion.
- Audio/Voice: Support for text-to-speech and speech-to-text (depending on API availability).
- Pipeline Friendly: Designed to work with PowerShell objects and pipes.
- Easy Integration: Simple to use in your powershell workflows (.NET Framework and .NET Core) and Azure.
- Cross Platform: Just runs on Windows, macOS, and Linux. And Docker / Podman. And more.
... in pure Powershell 5+ / 7+ (Win, Linux, OSX, Docker, ...) -- PollinationsAI can be used for free (only needs registration, but no moneys)
Warning
PollinationsAI will cache the response to your request indefinitely (possibly the request as well) and the response can be accessed without authentication.
This might be what you are looking for, if you want to get persistent results to a request or want to share the response (the URL visible with -Debug is without authentication).
DO NOT enter private data (name, address, ...), personal information, information about other people, financial data and other sensetive information. It is not save to use in a corporate environment. Handle it as if you would post on X / Facebook.
See Discussion
Install-Module -Name PollinationsAiPS -Force ; Import-Module -Name PollinationsAiPS ; Get-PollinationsAiByok -Add | Out-Null
gpat "a cat"
# ... a text about a cat ...
gpai "a cat" -save
# an url to file with a catInstall-Module -Name PollinationsAiPS -ForceImport-Module -Name PollinationsAiPSonly download it into your current folder
Save-Module -Name PollinationsAiPS -Path .\ # this creates a subfolder .\PollinationsAiPS\1.0.0\Bring-Your-Own-Key method - opens a popup for you to accept to generate a temporary key and adds it to your profile (persists)
Get-PollinationsAiByok -AddBring-Your-Own-Key, but only temporary (until you close the terminal/session)
Get-PollinationsAiByok -Init-
... after restarting your powershell console, the key will be available. (
"`n`n`$env:POLLINATIONSAI_API_KEY = `"sk_..............`"" >> $PROFILE.CurrentUserAllHosts
sk_...is the API key you created at Pollinations.ai)
Important
β The specific documentation for each command
Get-PollinationsAiText-> /docs/text.md (single line input text, but all model lists)Get-PollinationsAiTextEx-> /docs/textEx.md (for multiline texts)Get-PollinationsAiImage-> /docs/image.mdGet-PollinationsAiAudio-> /docs/audio.mdPollinationsAI:\Drive -> /docs/files.md (to for images to url, to be used with the commands)ConvertFrom-AnsiEscapedStringGet-PollinationsAiByok, Alias:Get-PAByok,Get-PollinationsAiDeviceTokenGet-PollinationsAiByokWeb(Old method, but can be used to redirect to a website that receives the confirmation/apikey)
Get-PollinationsAiText "a cat"
# Ah, a cat β these furry little bundles ...- Aliases:
Get-PollinationsAiText,Get-PAiTxt,gpat
Get-PollinationsAiText "a cat." -colors
# Ah, a cat β these furry little bundles ...- Aliases:
Get-PollinationsAiText,Get-PAiTxt,gpat
Get-Content somefile.txt | Get-PollinationsAiTextEx
# ...
Get-PollinationsAiTextEx (Get-Content somefile.txt)
# ...
Get-PollinationsAiTextEx @("line 1", "line 2")
# ...
Get-PollinationsAiTextEx "line 1 `n line 2"
# ...- Aliases:
Get-PollinationsAiTextEx,Get-PAiTxtX,gpatx
Get-PollinationsAiImage "a cat" -save
# C:\Users\<username>\AppData\Local\Temp\00974dda-c60c-4c4f-b6bc-4c6e948616d5.jpg- Aliases:
Get-PollinationsAiImage,Get-PAiImg,gpai
Get-PollinationsAiAudio "a cat" -save
# C:\Users\<username>\AppData\Local\Temp\00974dda-c60c-4c4f-b6bc-4c6e948616d5.mp3- Aliases:
PollinationsAiAudio,Get-PAiAud,gpaa
Get-PollinationsAiImage -ListAll types support -List
Get-PollinationsAiImage -List -Details |? paid_only -eq $false |? input_modalities -contains image | Format-Table