HTTP API for Flux image generation.
Start the server
docker build -t flux-http-server .
docker run -it \
-p 8080:8080 \
-v $HOME/.cache/huggingface:/root/.cache/huggingface \
--gpus all \
flux-http-serverThen generate an image
curl -d '{"prompt":"a sign saying hello world"}' localhost:8080/api/batch > batch.json
jq -r '.images[]' batch.json | sed 's/^data:image\/png;base64,//' | awk '{print $0 | "base64 -d > image-" NR ".png"}'