Перейти к основному содержанию
POST
/
flux
/
v1
/
{model}
flux generate image
curl --request POST \
  --url https://api.cometapi.com/flux/v1/{model} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "Hello"
}
'
{
  "id": "<string>",
  "polling_url": "<string>"
}

Обзор

Эндпоинт /flux/v1/\{model\} генерирует высококачественные изображения из текстовых prompt с использованием семейства моделей Flux от Black Forest Labs. Чтобы переключаться между различными вариантами Flux, достаточно заменить имя модели в пути URL.
Из-за значительных различий в списках параметров между моделями серии Flux, пожалуйста, обратитесь к официальной документации для получения подробных инструкций по использованию. Приведённый здесь список параметров предназначен только для справки.После генерации используйте эндпоинт /flux/v1/get_result, чтобы запрашивать сгенерированные изображения или отслеживать статус процесса.URL изображений, возвращаемые сервисом BFL, истекают примерно через 10 минут. Сохраните сгенерированные результаты как можно скорее.

Авторизации

Authorization
string
header
обязательно

Bearer token authentication. Use your CometAPI key.

Заголовки

Content-Type
string

Must be application/json.

Параметры пути

model
string
обязательно

Flux model variant to use, e.g. flux-pro-1.1, flux-pro, flux-dev, flux-pro-1.1-ultra.

Тело

application/json
prompt
string
по умолчанию:Hello
обязательно

Text prompt describing the image to generate.

image_prompt
string

URL of a reference image to guide the generation style or content.

width
integer

Output image width in pixels. Must be a multiple of 32. Range varies by model.

height
integer

Output image height in pixels. Must be a multiple of 32. Range varies by model.

steps
integer

Number of diffusion steps. Higher values improve quality but increase latency.

prompt_upsampling
boolean

When true, automatically enhances the prompt for more detailed results.

seed
integer

Random seed for reproducible outputs. Omit for random generation.

guidance
number

Guidance scale controlling how closely the output follows the prompt. Higher values increase prompt adherence.

safety_tolerance
integer

Safety filter tolerance level. Higher values are more permissive. Range: 0–6.

interval
integer

Diversity interval. Higher values produce more varied outputs at the cost of prompt adherence.

output_format
string

Output image format. Supported values: jpeg, png.

webhook_url
string

URL to receive a POST notification when the task completes.

webhook_secret
string

Secret string included in webhook payloads for request verification.

Ответ

200 - application/json

OK

id
string
polling_url
string