1
Fork 0
mirror of https://github.com/Steffo99/config-fish.git synced 2024-10-16 14:27:34 +00:00

Remove unused DALLE command

This commit is contained in:
Steffo 2024-05-20 02:04:52 +02:00
parent fc01b66e39
commit e5ff9ce230
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0

View file

@ -1,20 +0,0 @@
function dalle
set base_url "https://api.openai.com"
set response (curl --silent "$base_url/v1/images/generations" -H 'Content-Type: application/json' -H "Authorization: Bearer $OPENAI_API_KEY" -d '{"n": 1, "size": "1024x1024", "prompt":"'$argv[1]'"}')
echo "$response" | jq
set error (echo "$response" | jq '.error')
if test "$error" != "null"
return 1
end
set timestamp (echo "$response" | jq --raw-output '.created')
set image_url (echo "$response" | jq --raw-output '.data[0].url')
set output "/home/steffo/Pictures/DALL·E²/$timestamp - "$argv[1]".png"
wget --quiet --output-document="$output" "$image_url"
open "$output" > /dev/null 2> /dev/null
end