Skip to content

Instantly share code, notes, and snippets.

@schafeld
Created September 16, 2025 11:18
Show Gist options
  • Save schafeld/bf1aa78fa60497799dffe79f0ed27344 to your computer and use it in GitHub Desktop.
Save schafeld/bf1aa78fa60497799dffe79f0ed27344 to your computer and use it in GitHub Desktop.
Generative AI Image Enhancement (Flux, BFL, CURL)

Curl Flux Image Enhancement Example

Enhance a photo by sending its Base 64 encoded image data to Black Forest Lab's Flux API. Retrieve an enhanced image according to prompted specifications.

Template / Documentation

See Black Forest Labs docs for more details.

Code Example

curl -X POST \
  'https://api.bfl.ai/v1/flux-kontext-pro' \
  -H 'accept: application/json' \
  -H "x-key: <BFL_API_KEY>" \
  -H 'Content-Type: application/json' \
-d '{
  "prompt": "Remove the reflections in the glasses in the attached image, sharpen the people in the foreground, remove the image noise, and brighten the image slightly.",
  "input_image": "BASE64_ENCODED_IMAGE_STRING",
  "denoise": 0.7,
  "steps": 30
}'

Get the <BFL_API_KEY> at Black Forest Labs. You can encode images to Base 64 data online.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment