Skip to content

Instantly share code, notes, and snippets.

@Realiserad
Created March 3, 2024 20:39
Show Gist options
  • Select an option

  • Save Realiserad/7093dd77f1bb6c002da17a43cbc4c1d4 to your computer and use it in GitHub Desktop.

Select an option

Save Realiserad/7093dd77f1bb6c002da17a43cbc4c1d4 to your computer and use it in GitHub Desktop.
Shell out AI-generated images from pollinations.ai based on a description (text2img)
#!/bin/env sh
set -e
i=0
while [ "$i" -lt "$1" ]; do
i=$((i+1))
prompt=$(echo "$2 $i" | jq --slurp --raw-input --raw-output @uri)
curl -s "https://image.pollinations.ai/prompt/$prompt" -o $i.png
done
echo "🎨 Enjoy!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment