Flux Kontext
Geração e edição avançada de imagens com modelos Flux Kontext
Funcionalidades
- Geração de texto para imagem
- Transferência de estilo
- Edição de imagem
- Saída de alta fidelidade
Preços
| Model | Credits |
|---|---|
| flux-kontext-pro | 2 (~$0.02) |
| flux-kontext-max | 4 (~$0.04) |
Endpoint
POST
/api/v1/images/generateParâmetros
| Parâmetro | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| model | string | Obrigatório | "flux-kontext-pro" or "flux-kontext-max" |
| type | string | Opcional | "text-to-image" or "image-to-image" (default: text-to-image) |
| prompt | string | Obrigatório | Text description |
| image_urls | string[] | Opcional | Input image URLs or base64 for editing/style transfer |
| input_image | string | Opcional | Deprecated. Alias for image_urls[0] |
| image_size | string | Opcional | Output image size (e.g. 1024x1024) |
Exemplo de Solicitação
{
"model": "flux-kontext-pro",
"type": "image-to-image",
"prompt": "Transform into a watercolor painting style",
"image_urls": ["https://tempfile.aiquickdraw.com/workers/nano/image_1772780968156_ygk0zm.png"]
}Exemplo de Resposta
{
"success": true,
"data": {
"task_id": "task_flux123",
"credits_used": 2,
"remaining_credits": 498
}
}Exemplos de Código
curl -X POST https://gateway.bananapro.site/api/v1/images/generate \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-kontext-pro",
"type": "image-to-image",
"prompt": "Transform into a watercolor painting style",
"image_urls": ["https://tempfile.aiquickdraw.com/workers/nano/image_1772780968156_ygk0zm.png"]
}'