seedinteger
The seed to use for the generation. If not provided, a random seed will be used.
bfl/flux-2/klein/9b/editFlux 2 Klein 9b by BFL - AI-powered image editing, style transfer, and transformation. Edit photos with natural language instructions, remove backgrounds, change styles, and enhance images effortlessly.
Testar o modelo
PNG, JPEG, WebP, or GIF · 20 MiB maximum each
Sua saída aparecerá aqui
Preencha as entradas e clique em Executar.
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 edição de imagem: as pessoas escolhem a melhor de duas edições da mesma imagem e instrução, sem ver os nomes dos modelos.
FLUX.2 [klein] 9B, a compact open model for fast, low-cost images. Edit or combine images with an instruction.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Text instruction. |
images | image URL[] | — | Images to edit or combine, Image 1, Image 2, … |
num_inference_steps | integer 4–8 | 4 | 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 | — | Output shape. |
seed | integer | random | Fix it to compare prompt changes. |
$0.022 per image.
| Request | Price |
|---|---|
| One image | $0.022 |
Failed runs are not charged.
Other FLUX.2 endpoints: bfl/flux-2/max/edit, bfl/flux-2/pro/edit, bfl/flux-2/flex/edit, bfl/flux-2/dev/edit, bfl/flux-2/klein/9b.
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/klein/9b/edit",
"images": [
"https://static.sandbase.ai/examples/bfl/flux-2/klein/9b/edit/input_images_0.png"
],
"prompt": "Turn this into a realistic image",
"output_format": "png",
"num_inference_steps": 4
}
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.
imagesarrayThe URLs of the images for editing. A maximum of 4 images are allowed.
promptstringobrigatórioThe prompt to edit the image.
aspect_ratiostringThe aspect ratio of the generated image.
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"
num_inference_stepsintegerThe number of inference steps to perform.
Padrão: 4
Mínimo: 4
Máximo: 8
{
"model": "bfl/flux-2/klein/9b/edit",
"images": [
"https://static.sandbase.ai/examples/bfl/flux-2/klein/9b/edit/input_images_0.png"
],
"prompt": "Turn this into a realistic image",
"output_format": "png",
"num_inference_steps": 4
}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.
Ainda não foi publicada nenhuma saída de exemplo. Use Playground → Result → JSON após uma execução concluída para inspecionar sua resposta.