Initial commit

This commit is contained in:
2026-09-27 15:20:26 -05:00
commit 72f40c7792
14 changed files with 466 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -e
PROMPT="$1"
SERVER_IP="192.168.2.154"
API_URL="http://${SERVER_IP}:5005/v1/images/generations"
# Note: Using "flux-schnell" to match our api.py logic
RESPONSE=$(curl -s -X POST "$API_URL" \
-H "Content-Type: application/json" \
-d "{
\"prompt\": \"$PROMPT\",
\"model\": \"flux-schnell\"
}")
BASE64=$(echo "$RESPONSE" | jq -r '.data[0].b64_json')
if [ "$BASE64" == "null" ]; then
echo "Error: $(echo "$RESPONSE" | jq -r .detail)"
exit 1
fi
OUTDIR="downloads/flux_images"
mkdir -p "$OUTDIR"
OUTFILE="${OUTDIR}/$(date +%s).png"
echo "$BASE64" | base64 -d > "$OUTFILE"
echo "Image generated: $OUTFILE"