> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vidgo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# FLUX.2 Flex 文生图

> FLUX.2 Flex 文生图 API 用于探索图像构思，通过描述性提示词塑造构图和风格，输出 1K 或 2K。

> [!TIP]
>
> 1. 提交后会返回 `task_id`。如果提供了 `callback_url`，当任务状态变为 `finished` 或 `failed` 时，系统会向 `callback_url` 发送 POST 请求。
> 2. 无论是否提供 `callback_url`，都可以通过统一的[查询任务状态](https://docs.vidgo.ai/zh/api-manual/task-management/status.md)接口获取结果。

使用 FLUX.2 Flex 探索图像构思，通过描述性提示词塑造构图和风格，输出 1K 或 2K。

## 模型

* **blackforestlabs/flux-2-flex/text-to-image** - 根据文本提示词生成图像。

## 功能

* 根据文本提示词生成图像。
* 可选 `1K`、`2K` 输出分辨率。

## 输出选项

### 图像尺寸

* `size`：必填。可选值：`1:1`、`4:3`、`3:4`、`16:9`、`9:16`、`3:2`、`2:3`、`auto`。

### 分辨率

* `resolution`：必填。可选值：`1K`、`2K`。

## 高级参数

`model` 和可选的 `callback_url` 放在请求根级。所有工作流参数（包括输出选项）都放在 `input` 内。

发送本页列出的 input 字段。

### 提示词

* `prompt`：必填。描述期望的图像。长度：**3-5,000 个字符**。

## 已验证示例

此示例通过 Vidgo API 生成，也是 Playground 中的默认示例。源图和结果图托管在 Vidgo CDN 上。

![潮池野外笔记](https://cdn.vidgo.ai/apis/models/blackforestlabs/flux-2-flex/text-to-image/v1/02/output.jpg)

```json theme={null}
{
  "code": 200,
  "data": {
    "task_id": "SBR3R4D3GOFPXM1Z",
    "status": "finished",
    "files": [
      {
        "file_type": "image",
        "file_url": "https://cdn.vidgo.ai/apis/models/blackforestlabs/flux-2-flex/text-to-image/v1/02/output.jpg"
      }
    ],
    "created_time": "2026-09-26T11:07:50",
    "error_message": null,
    "progress": 100
  }
}
```


## OpenAPI

````yaml zh/api-manual/image-series/blackforestlabs-flux-2-flex-text-to-image.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: Vidgo API - FLUX.2 Flex 文生图
  description: 使用 FLUX.2 Flex 探索图像构思，通过描述性提示词塑造构图和风格，输出 1K 或 2K。
  version: 1.0.0
servers:
  - url: https://api.vidgo.ai
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Image Series
      summary: FLUX.2 Flex 文生图
      description: 发送本工作流列出的字段。将 `prompt`、`size` 和 `resolution` 放在 `input` 内。
      operationId: submit_blackforestlabs_flux_2_flex_text_to_image
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              additionalProperties: true
              properties:
                model:
                  type: string
                  example: blackforestlabs/flux-2-flex/text-to-image
                input:
                  type: object
                  required:
                    - prompt
                    - resolution
                    - size
                  properties:
                    prompt:
                      type: string
                      minLength: 3
                      maxLength: 5000
                      description: 要生成图像的文字描述，3-5,000 个字符。
                    size:
                      type: string
                      enum:
                        - '1:1'
                        - '4:3'
                        - '3:4'
                        - '16:9'
                        - '9:16'
                        - '3:2'
                        - '2:3'
                        - auto
                      description: 输出图像的宽高比。
                    resolution:
                      type: string
                      enum:
                        - 1K
                        - 2K
                      description: 输出图像分辨率。
                  additionalProperties: false
                callback_url:
                  type: string
                  nullable: true
                  description: >-
                    可选的公开 HTTP(S) 接口，用于接收任务完成通知。建议使用 HTTPS。省略、设为 null
                    或空字符串即关闭回调。
              description: model 和 callback_url 放在根级。工作流参数放在 input 内。
            examples:
              default:
                summary: 潮池野外笔记
                value:
                  model: blackforestlabs/flux-2-flex/text-to-image
                  input:
                    prompt: >-
                      An overhead photograph of an open naturalist's field
                      notebook lying on a sun-warmed basalt rock beside a tide
                      pool. The two cream, lightly textured pages are filled
                      with delicate pencil and watercolour studies: on the left
                      page a purple ochre sea star, a giant green anemone with
                      open tentacles, and a hermit crab in a turban-snail shell;
                      on the right page a cluster of goose barnacles, a small
                      tidepool sculpin, and a strand of rockweed. Each drawing
                      has a neat handwritten ink label: "Pisaster ochraceus",
                      "Anthopleura xanthogrammica", "Pagurus samuelis",
                      "Pollicipes polymerus", "Oligocottus maculosus", "Fucus
                      distichus". Across the top of the left page, the
                      handwritten heading reads exactly "LOW TIDE 0.3 m - 14
                      MAY". Small measurement ticks and fine arrows point to
                      anatomical details. A graphite pencil, a small brass
                      magnifier and a water brush rest on the pages; a few drops
                      of seawater and grains of sand sit near the paper edge.
                      Soft overcast light, true-to-life paper texture, visible
                      watercolour blooms and pencil grain, legible correctly
                      spelled handwriting, no other text, no logos, no
                      watermark.
                    size: '4:3'
                    resolution: 1K
              flex-text-to-image-01:
                summary: 高山步道路标
                value:
                  model: blackforestlabs/flux-2-flex/text-to-image
                  input:
                    prompt: >-
                      A photorealistic mid shot of a weathered larch-wood trail
                      signpost at a high Alpine mountain pass in late afternoon.
                      One small square metal plate at the top of the post and
                      three arrow-shaped boards below it, each with crisp
                      carved, white-painted capital lettering. Each board
                      carries only its own single line of text, and nothing is
                      repeated anywhere else:

                      Top square plate: "SENTIERO 443"

                      Top arrow, pointing left: "RIFUGIO NUVOLAU 1 h 20"

                      Middle arrow, pointing right: "PASSO GIAU 45 min"

                      Bottom arrow, pointing left: "LAGO FEDERA 1 h 50"

                      The wood shows deep silver-grey grain, cracks, rusted
                      bolts and patches of orange and pale-green lichen. Behind
                      the post, jagged dolomite peaks glow pink in alpenglow
                      above a scree slope, and a narrow dirt path leads away
                      with two tiny out-of-focus hikers. Low warm sun from the
                      right, shallow depth of field on the signs, 50mm lens.
                      Lettering sharp and correctly spelled, no other words or
                      numbers, no logos, no watermark.
                    size: '3:4'
                    resolution: 1K
              flex-text-to-image-03:
                summary: 轨道舱驾驶控制台
                value:
                  model: blackforestlabs/flux-2-flex/text-to-image
                  input:
                    prompt: >-
                      A cinematic view from the pilot's seat of a retro-futurist
                      research spacecraft cockpit in orbit above the night side
                      of Earth. A curved instrument console spans the frame,
                      built from brushed aluminium, olive-green enamel panels
                      and chunky toggle switches with metal guards. Only four
                      backlit amber labels appear on the console, each exactly
                      once: on the far left panel "O2 21.4%", above a round
                      analog gauge left of centre "COOLANT °C" with the needle
                      at 22, directly right of the central screen "NAV LOCK",
                      and on the far right panel "DOCK 14.2 m/s". All other
                      switches and panels are unlabeled. The central small green
                      monochrome screen shows a wireframe orbit trace with no
                      text. Through the wide front window, city lights trace
                      coastlines on the dark Earth below and a thin blue
                      atmospheric line glows along the horizon. The pilot's
                      gloved hands rest near a throttle lever at the bottom
                      edge. Subtle scratches, worn paint around the switches and
                      dust drifting in the soft cabin light. Sharp, legible
                      labels in a clean engineering typeface, physically
                      plausible lighting, no other text, no logos, no watermark.
                    size: '16:9'
                    resolution: 1K
              callback:
                summary: 接收完成回调
                value:
                  model: blackforestlabs/flux-2-flex/text-to-image
                  input:
                    prompt: >-
                      An overhead photograph of an open naturalist's field
                      notebook lying on a sun-warmed basalt rock beside a tide
                      pool. The two cream, lightly textured pages are filled
                      with delicate pencil and watercolour studies: on the left
                      page a purple ochre sea star, a giant green anemone with
                      open tentacles, and a hermit crab in a turban-snail shell;
                      on the right page a cluster of goose barnacles, a small
                      tidepool sculpin, and a strand of rockweed. Each drawing
                      has a neat handwritten ink label: "Pisaster ochraceus",
                      "Anthopleura xanthogrammica", "Pagurus samuelis",
                      "Pollicipes polymerus", "Oligocottus maculosus", "Fucus
                      distichus". Across the top of the left page, the
                      handwritten heading reads exactly "LOW TIDE 0.3 m - 14
                      MAY". Small measurement ticks and fine arrows point to
                      anatomical details. A graphite pencil, a small brass
                      magnifier and a water brush rest on the pages; a few drops
                      of seawater and grains of sand sit near the paper edge.
                      Soft overcast light, true-to-life paper texture, visible
                      watercolour blooms and pencil grain, legible correctly
                      spelled handwriting, no other text, no logos, no
                      watermark.
                    size: '4:3'
                    resolution: 1K
                  callback_url: https://your-domain.com/callback
      responses:
        '200':
          description: 任务已提交
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - data
                properties:
                  code:
                    type: integer
                    enum:
                      - 200
                  data:
                    type: object
                    required:
                      - task_id
                      - status
                      - created_time
                    properties:
                      task_id:
                        type: string
                      status:
                        type: string
                        enum:
                          - not_started
                          - running
                          - finished
                          - failed
                      created_time:
                        type: string
                        format: date-time
              example:
                code: 200
                data:
                  task_id: SBR3R4D3GOFPXM1Z
                  status: running
                  created_time: '2026-09-26T11:07:50'
        '400':
          description: 输入无效、媒体无法访问或积分不足
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '401':
          description: 凭证无效
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '403':
          description: 拒绝访问
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '404':
          description: 模型未知或已停用
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '408':
          description: 请求超时
          content:
            text/plain:
              schema:
                type: string
              example: Request timeout
        '422':
          description: JSON 无效或请求体不是对象
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '429':
          description: 超出速率限制或 API Key 积分限额
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '500':
          description: 内部错误
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '502':
          description: 无法创建生成任务
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '503':
          description: 请求的模型暂时不可用
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 使用 VIDGO_API_KEY。

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.