seedinteger
The seed to use for the generation. If not provided, a random seed will be used.
bfl/flux-2/devFlux 2 Dev by BFL - generate stunning images from text prompts with state-of-the-art AI. Supports multiple aspect ratios, styles, and high-resolution output for creative and commercial use.
Testar o modelo
Selecione um exemplo para carregar as entradas e o resultado no playground.
{
"prompt": "Dutch angle close-up of a survivor in post-apocalyptic setting, dust-covered face, dramatic harsh sunlight creating deep shadows, happy expression, desaturated dystopian color palette, gritty realism"
}Preferência humana
Classificações Elo de votos cegos lado a lado, comparadas com outros modelos de imagem e vídeo.
Classificações obtidas de Artificial Analysis Arena
Arena de texto para imagem: as pessoas escolhem a melhor de duas imagens geradas a partir do mesmo prompt, sem ver os nomes dos modelos.
FLUX.2 [dev], the open-weights 32B FLUX.2 model. Text to image.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Text instruction. |
guidance_scale | number 0–20 | 2.5 | How strictly to follow the prompt. |
num_inference_steps | integer 4–50 | 28 | More steps add detail and time. |
output_format | jpeg / png | png | Output file format. |
aspect_ratio | 21:9 / 16:9 / 3:2 / 4:3 / 5:4 / 1:1 / 4:5 / 3:4 / 2:3 / 9:16 | 16:9 | Output shape. |
seed | integer | random | Fix it to compare prompt changes. |
$0.012 per image.
| Request | Price |
|---|---|
| One image | $0.012 |
Failed runs are not charged.
Other FLUX.2 endpoints: bfl/flux-2/max, bfl/flux-2/pro, bfl/flux-2/flex, bfl/flux-2/turbo, bfl/flux-2/dev/edit.
Comece a construir
Envie este modelo pela SandBase Unified Run API.
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "bfl/flux-2/dev",
"prompt": "Dutch angle close-up of a survivor in post-apocalyptic setting, dust-covered face, dramatic harsh sunlight creating deep shadows, happy expression, desaturated dystopian color palette, gritty realism",
"aspect_ratio": "16:9",
"output_format": "png",
"guidance_scale": 2.5,
"num_inference_steps": 28
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"Crie uma chave da API SandBase e defina-a no ambiente do seu servidor. Todas as requisições usam autenticação Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Mantenha a chave no servidor. Não a exponha em código do navegador nem a comite em um repositório.
Faça POST para /v1/run com este ID de modelo e suas entradas. O exemplo de requisição acima inclui envio e polling.
Use o ID de execução retornado para fazer polling até que o status seja completed, failed ou timeout. Leia a saída somente após completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Passe uma URL de arquivo acessível publicamente no campo de imagem, vídeo ou áudio do modelo. Os formatos e limites suportados são mostrados ao lado de cada entrada do Playground.
Use o controle de upload ou substituição nos campos de imagem suportados no Playground. Campos de URL de vídeo aceitam um vídeo de condução hospedado; isso não implica suporte a upload de vídeo.
seedintegerThe seed to use for the generation. If not provided, a random seed will be used.
promptstringobrigatórioThe prompt to generate an image from.
aspect_ratiostringThe aspect ratio of the generated image.
Padrão: "16:9"
Valores possíveis: "21:9", "16:9", "3:2", "4:3", "5:4", "1:1", "4:5", "3:4", "2:3", "9:16"
output_formatstringThe format of the generated image.
Padrão: "png"
Valores possíveis: "jpeg", "png"
guidance_scalenumberGuidance Scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you.
Padrão: 2.5
Mínimo: 0
Máximo: 20
num_inference_stepsintegerThe number of inference steps to perform.
Padrão: 28
Mínimo: 4
Máximo: 50
{
"model": "bfl/flux-2/dev",
"prompt": "Dutch angle close-up of a survivor in post-apocalyptic setting, dust-covered face, dramatic harsh sunlight creating deep shadows, happy expression, desaturated dystopian color palette, gritty realism",
"aspect_ratio": "16:9",
"output_format": "png",
"guidance_scale": 2.5,
"num_inference_steps": 28
}Uma execução concluída expõe seu resultado em output. O texto a seguir é o exemplo salvo do modelo, não uma nova geração.
[
{
"source": "BFL/FLUX schema mirror",
"source_url": "https://docs.bfl.ai/flux_2/flux2_overview",
"url": "https://static.sandbase.ai/examples/9c5d6e59-b957-46c7-8c6f-2295af639f91/output/be5ccf4b-2861-4247-b4d9-3351cb2e3cf7.png"
}
]