We have added the syncparameter to support synchronous return of results for easier debugging. Setting it totrueenables synchronous return.
| Parameter Name | Parameter Description |
|---|---|
| safety_tolerance | Tolerance level for input and output content moderation. Higher levels mean looser moderation restrictions. |
| webhook_url | URL to receive Webhook notifications for asynchronously obtaining generation results. |
| webhook_secret | Optional secret key for Webhook signature verification to enhance request security. |
| steps | Number of iteration steps for image generation. More steps result in richer image details but slower generation speed. |
| prompt_upsampling | Whether to perform upsampling optimization on prompts to improve prompt understanding accuracy. |
| guidance | Guidance strength, controlling the alignment between generated results and prompts. Higher values mean higher alignment but lower creativity. |
| interval | Interval for outputting intermediate results during generation, used to check generation progress. |
{
"prompt": "ein fantastisches bild",
"width": 1024,
"height": 768,
"steps": 40,
"prompt_upsampling": false,
"seed": 42,
"guidance": 2.5,
"safety_tolerance": 2,
"interval": 2,
"output_format": "jpeg",
"sync": false
}curl --location --request POST 'https://api.302.ai/flux/v1/flux-2-klein-9b' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data-raw '{
"prompt": "ein fantastisches bild",
"width": 1024,
"height": 768,
"steps": 40,
"prompt_upsampling": false,
"seed": 42,
"guidance": 2.5,
"safety_tolerance": 2,
"interval": 2,
"output_format": "jpeg",
"sync": false
}'{
"id": "5015d102-09e0-44e9-8ede-ab8c74b16ed6",
"polling_url": "https://api.us3.bfl.ai/v1/get_result?id=5015d102-09e0-44e9-8ede-ab8c74b16ed6",
"cost": 6.0,
"input_mp": 0.0,
"output_mp": 0.75
}