Skip to content

Instantly share code, notes, and snippets.

@ttulttul
Created April 17, 2024 18:59
Show Gist options
  • Save ttulttul/3d02a35c69b34d4cc7d083465290ea5f to your computer and use it in GitHub Desktop.
Save ttulttul/3d02a35c69b34d4cc7d083465290ea5f to your computer and use it in GitHub Desktop.
Bash script to use the Stable Diffusion 3 API
#!/bin/bash
# Assumes that your Stability API key is in STABILITY_KEY
PROMPT="$1"
DATE=$(date +%Y-%m-%d-%H%M%S)
curl -f -sS "https://api.stability.ai/v2beta/stable-image/generate/sd3" \
-H "authorization: Bearer $STABILITY_KEY" \
-H "accept: image/*" \
-F prompt="$PROMPT" \
-F output_format="jpeg" \
-o "./sd3-$DATE.jpeg"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment