AI on demand: black-forest-labs/FLUX.1-schnell: Difference between revisions

From MediaWiki
Jump to navigation Jump to search
(Created page with "== Calling the model == <syntaxhighlight lang="bash"> # Set your personal key: STONEY_KEY=sk-... # Set the desired model: MODEL=black-forest-labs/FLUX.1-schnell # Set your prompt: PROMPT='Create a photorealistic picture of some cats.' # Size of the generated image (WIDTHxHEIGHT): SIZE=1024x1024 # Number of inference steps: STEPS=4 curl https://llm.stoney-cloud.com/v1/images/generations \ --silent --fail --show-error \ --header "Authorization: Bearer...")
 
 
Line 46: Line 46:
</syntaxhighlight>
</syntaxhighlight>


The resulting image is returned as a Base64-encoded string inside <code>data[0].b64_json</code>.
The resulting image is returned as a Base64-encoded string inside <code>.data[0].b64_json</code>.


[[Category:AI on demand]]
[[Category:AI on demand]]

Latest revision as of 11:32, 22 July 2026

Calling the model

# Set your personal key:
STONEY_KEY=sk-...

# Set the desired model:
MODEL=black-forest-labs/FLUX.1-schnell

# Set your prompt:
PROMPT='Create a photorealistic picture of some cats.'

# Size of the generated image (WIDTHxHEIGHT):
SIZE=1024x1024

# Number of inference steps:
STEPS=4

curl https://llm.stoney-cloud.com/v1/images/generations \
        --silent --fail --show-error \
        --header "Authorization: Bearer $STONEY_KEY" \
        --header 'Content-Type: application/json' \
        --data '{
                "model": "'"$MODEL"'",
                "prompt": "'"$PROMPT"'",
                "size": "'"$SIZE"'",
                "num_inference_steps": '"$STEPS"'
        }' \
        | jq

Example output (cropped):

{
  "created": 1784646324,
  "data": [
    {
      "b64_json": "iVBORw0KGgoAAAANSUhEUgAABAAAAAQACAIAAADwf7zUAAEAAElEQVR4AQALhP[...]AQABAP8AAP8B/v79AfANpMANoyqSAAAAAElFTkSuQmCC",
      "url": null,
      "revised_prompt": null
    }
  ],
  "output_format": "png",
  "size": "1024x1024",
  "cot_output": null
}

The resulting image is returned as a Base64-encoded string inside .data[0].b64_json.