16 ms·
Be a bit careful playing with this one. I tried this: curl -s -X POST \ "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-preview
by simonw 2y ago
Be a bit careful playing with this one. I tried this:
curl -s -X POST \
"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-preview-image-generation:generateContent?key=$GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{
"parts": [
{"text": "Provide a vegetarian recipe for butter chicken but with chickpeas not chicken and include many inline illustrations along the way"}
]
}],
"generationConfig":{"responseModalities":["TEXT","IMAGE"]}
}' > /tmp/out.json
And got back 41MB of JSON with 28 base64 images in it: https://gist.github.com/simonw/55894032b2c60b35f320b6a166ded493 https://gist.github.com/simonw/55894032b2c60b35f320b6a166ded...
At 4c per image that's more than a dollar on that single prompt.
I built this quick tool https://tools.simonwillison.net/gemini-image-json https://tools.simonwillison.net/gemini-image-json for pasting that JSON into to see it rendered.
- weird-eye-issue 2y agoI mean you did ask for "many illustrations"