> ## 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 Dev 图生图

> Flux Dev 图生图 API 根据文本提示词编辑一张源图，输出 PNG 或 JPEG。

> [!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)接口获取结果。

## 提交任务

向 `POST /api/generate/submit` 发送 `model: "blackforestlabs/flux/dev/image-to-image"` 和一个 `input` 对象。使用 `Authorization: Bearer VIDGO_API_KEY` 认证。

* `prompt`：必填字符串。描述图像或编辑指令，去除首尾空白后至少一个字符。
* `image_urls`：必填数组，包含一个公开的 HTTP(S) 源图 URL。源图会引导编辑后的输出。
* `n`：正整数，指定输出图像数量，默认 `1`。
* `output_format`：`png` 或 `jpeg`，默认 `png`。

### 画布参数

`size` 定义文生图的画布，默认 `1:1`。图生图会以源图引导输出。请求示例提供了源图、提示词、图像数量和输出格式。

## 获取图像

提交响应会返回 `data.task_id`。使用[查询任务状态](https://docs.vidgo.ai/zh/api-manual/task-management/status.md)跟踪任务经过 `not_started`、`running`、`finished` 或 `failed` 等状态。

状态为 `finished` 时，从 `data.files[].file_url` 读取图像 URL。状态为 `failed` 时，读取 `data.error_message`。

可以在顶层提供 `callback_url`，通过 [Webhook](https://docs.vidgo.ai/zh/api-manual/task-management/webhooks.md) 接收最终结果。

## 已验证示例

此示例通过 Vidgo 测试 API 生成。源图和结果图托管在 Vidgo CDN 上。

![源图](https://cdn.vidgo.ai/apis/models/blackforestlabs/flux/dev/image-to-image/v1/01/input.png)

![更温暖的阅览室](https://cdn.vidgo.ai/apis/models/blackforestlabs/flux/dev/image-to-image/v1/01/output.png)

```json theme={null}
{
  "code": 200,
  "data": {
    "task_id": "I0RYI5JVOJC6CR8I",
    "status": "finished",
    "files": [
      {
        "file_url": "https://cdn.vidgo.ai/apis/models/blackforestlabs/flux/dev/image-to-image/v1/01/output.png",
        "file_type": "image"
      }
    ],
    "created_time": "2026-09-25T11:22:15",
    "error_message": null,
    "progress": 100
  }
}
```


## OpenAPI

````yaml zh/api-manual/image-series/blackforestlabs-flux-dev-image-to-image.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: Vidgo API - Flux Dev 图生图
  description: Flux Dev 图生图 API。
  version: 1.0.0
servers:
  - url: https://api.vidgo.ai
    description: 生产环境服务器
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Flux Dev
      summary: 提交 Flux Dev 图生图任务
      operationId: submitFluxDevImageToImage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              default:
                summary: 更温暖的阅览室
                value:
                  model: blackforestlabs/flux/dev/image-to-image
                  input:
                    prompt: >-
                      Reimagine this same reading room as a warm and inviting
                      evening interior. Retain the principal perspective, the
                      large window on the left, the central rectangular table
                      and chairs, and the low shelves on the right. Replace the
                      cold concrete wall finish with warm light-oak paneling and
                      the floor with natural oak planks; give the chairs
                      comfortable muted rust-colored upholstery. Add subtle warm
                      reading light above the table and a gentle glow along the
                      shelves. Through the existing window, show the soft blue
                      light of dusk. Realistic architectural photography with
                      convincing wood grain, fabric texture and balanced warm
                      interior light against cool outdoor light. The room
                      remains simple, unoccupied and clearly related to the
                      original layout. No text, logos, commercial styling or
                      watermark.
                    'n': 1
                    output_format: png
                    image_urls:
                      - >-
                        https://cdn.vidgo.ai/apis/models/blackforestlabs/flux/dev/image-to-image/v1/01/input.png
              image-to-image-02:
                summary: 海岸绘画习作
                value:
                  model: blackforestlabs/flux/dev/image-to-image
                  input:
                    prompt: >-
                      A bold Fauvist oil painting on rough linen canvas of a
                      golden dog running on a beach. PAINTING, not a photograph.
                      Broad angular strokes of ochre, terracotta and cream
                      construct the complete dog in SIDE PROFILE facing RIGHT,
                      tail to the LEFT; keep the overall dog silhouette and
                      beach subject from the reference. Four natural legs in a
                      running stride. The entire animal fits comfortably in the
                      lower half of the portrait canvas. Build the sea and sky
                      from large flat patches of muted teal, pale blue and warm
                      grey. Scraped palette-knife impasto, thick raised paint
                      ridges, broken color and visible bristle marks across
                      every part of the composition, simplified shapes,
                      expressive brushwork, deliberately painterly edges. An
                      unframed full-bleed fine-art painting with no decorative
                      border, no lettering, no signature, no watermark.
                    'n': 1
                    output_format: jpeg
                    image_urls:
                      - >-
                        https://cdn.vidgo.ai/apis/models/blackforestlabs/flux/dev/image-to-image/v1/02/input.png
              image-to-image-03:
                summary: 庭院秋雨
                value:
                  model: blackforestlabs/flux/dev/image-to-image
                  input:
                    prompt: >-
                      Use the supplied photograph as the fixed composition for a
                      seasonal weather variation. Show the SAME entire
                      dark-green step-through bicycle from the SAME SIDE VIEW:
                      front wheel and wicker front basket on the LEFT, rear
                      wheel and saddle on the RIGHT, two wheels side by side and
                      both fully visible. Keep the pale plaster wall directly
                      behind the bicycle, the wooden gate on the far LEFT and
                      the leafy tree above the wall on the RIGHT. Preserve the
                      original wide camera position, lens perspective, bicycle
                      position and scale. Change only the weather, ground
                      moisture and foliage: soft overcast autumn daylight, fine
                      rain, wet stone paving with small puddles, scattered
                      russet leaves, and amber foliage on the existing tree.
                      Realistic gentle reflections, naturally aged materials and
                      subtle rain streaks. A quiet residential courtyard, not an
                      alley. Do not rotate the bicycle or move the camera. No
                      rear view, no people, no extra bicycles, no text, no
                      logos, no watermark.
                    'n': 1
                    output_format: png
                    image_urls:
                      - >-
                        https://cdn.vidgo.ai/apis/models/blackforestlabs/flux/dev/image-to-image/v1/03/input.png
      responses:
        '200':
          description: 任务提交成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
              example:
                code: 200
                data:
                  task_id: I0RYI5JVOJC6CR8I
                  status: running
                  created_time: '2026-09-25T11:22:15'
        '400':
          description: 请求参数无效
        '401':
          description: 未授权
components:
  schemas:
    SubmitRequest:
      type: object
      required:
        - model
        - input
      additionalProperties: false
      properties:
        model:
          type: string
          enum:
            - blackforestlabs/flux/dev/image-to-image
        callback_url:
          type: string
          format: uri
          description: 可选的 Webhook 回调 URL。
        input:
          type: object
          required:
            - image_urls
            - prompt
          description: 单图编辑参数。
          properties:
            prompt:
              type: string
              description: 描述要生成的图像或要做的修改。去除首尾空白后至少一个字符。
              minLength: 1
              example: >-
                Reimagine this same reading room as a warm and inviting evening
                interior. Retain the principal perspective, the large window on
                the left, the central rectangular table and chairs, and the low
                shelves on the right. Replace the cold concrete wall finish with
                warm light-oak paneling and the floor with natural oak planks;
                give the chairs comfortable muted rust-colored upholstery. Add
                subtle warm reading light above the table and a gentle glow
                along the shelves. Through the existing window, show the soft
                blue light of dusk. Realistic architectural photography with
                convincing wood grain, fabric texture and balanced warm interior
                light against cool outdoor light. The room remains simple,
                unoccupied and clearly related to the original layout. No text,
                logos, commercial styling or watermark.
            image_urls:
              type: array
              items:
                type: string
                format: uri
              minItems: 1
              maxItems: 1
              description: 图生图编辑的源图 URL。提供一张图像。
              example:
                - >-
                  https://cdn.vidgo.ai/apis/models/blackforestlabs/flux/dev/image-to-image/v1/01/input.png
            size:
              type: string
              description: >-
                文生图的输出画布。预设：1:1（512×512）、1:1
                HD（1024×1024）、4:3（1024×768）、3:4（768×1024）、16:9（1024×576）、9:16（576×1024）。自定义
                WIDTHxHEIGHT 尺寸为正整数。图生图的输出由源图决定。


                使用预设（`1:1`、`1:1 HD`、`4:3`、`3:4`、`16:9`、`9:16`）或自定义
                `WIDTHxHEIGHT` 尺寸。
              default: '1:1'
            'n':
              type: integer
              description: 输出图像数量。
              default: 1
              example: 1
              minimum: 1
            output_format:
              type: string
              description: 输出图像格式。
              enum:
                - jpeg
                - png
              default: png
              example: png
          additionalProperties: false
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          example: 200
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
            status:
              type: string
              enum:
                - not_started
                - running
                - failed
            created_time:
              type: string
              format: date-time
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: '使用 `Authorization: Bearer VIDGO_API_KEY`。'

````

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