FLUX.1 Kontext [pro]
Overview
Getting Started
Authorization
Generating images
Text to image
curl --request POST "https://relay.datacrunch.io/bfl/flux-kontext-pro" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <your_api_key>" \
--output "picture.png" \
--data '{
"prompt": "a scientist racoon eating icecream in a datacenter",
"steps": 50,
"guidance": 3.0,
"prompt_upsampling":true
}'import requests
import os
token = <your_api_key>
bearer_token = f"Bearer {token}"
url = "https://relay.datacrunch.io/bfl/flux-kontext-pro"
headers = {
"Content-Type": "application/json",
"Authorization": bearer_token
}
data = {
"prompt": "a scientist racoon eating icecream in a datacenter",
"steps": 50,
"guidance": 3.0,
"prompt_upsampling":True
}
resp = requests.post(url, headers=headers, json=data)
resp.raise_for_status()
ct = resp.headers.get("Content-Type", "")
outfile = "picture.png"
if ct.startswith("image/"):
with open(outfile, "wb") as f:
f.write(resp.content)
print(f"Saved raw image to {outfile}")Image to image
Last updated
Was this helpful?