示例: FLUX.1 [Dev] 文本生成图片
OpenAPI Specification
yaml
openapi: 3.0.1
info:
title: ''
description: "本页接口说明详见下方接口定义;参数取值与返回以本平台实测为准。"
version: 1.0.0
paths:
/fal/fal-ai/flux-1/dev:
post:
summary: '示例: FLUX.1 [Dev] 文本生成图片'
deprecated: false
description: "本页为 Fal.ai 兼容格式的示例接口,对应 POST /fal/fal-ai/flux-1/dev。该平台模型统一按 Fal.ai 格式调用,替换本平台接入地址与令牌即可对接;请求参数与返回值以本平台实测为准,计费口径以本平台计费页为准(待补)。"
tags:
- Fal.ai 平台兼容
parameters:
- name: Content-Type
in: header
description: "该字段的取值与含义以本平台实际返回为准。"
required: false
example: application/json
schema:
type: string
- name: Authorization
in: header
description: "该字段的取值与含义以本平台实际返回为准。"
required: false
example: Bearer {{YOUR_API_KEY}}
schema:
type: string
default: Bearer {{YOUR_API_KEY}}
requestBody:
content:
application/json:
schema:
title: FLUX.1 文本生成图片请求参数
type: object
properties:
prompt:
type: string
description: "图片描述词,即期望模型生成的场景与内容,必填"
num_images:
type: integer
description: "生成图片数量,最大 4,默认 1"
image_size:
oneOf:
- type: object
properties: {}
- type: string
enum:
- square_hd
- square
- portrait_4_3
- portrait_16_9
- landscape_4_3
- landscape_16_9
description: "预设图片尺寸(也可自定义分辨率,见下文),默认 landscape_4_3"
sync_mode:
type: boolean
description: "是否同步生成:true 为图片上传完成后同步返回,false 为异步,默认 false"
guidance_scale:
type: number
description: "引导系数,数值越大越贴近提示词;默认 3.5,取值范围 1–20"
num_inference_steps:
type: integer
description: "推理迭代步数,影响图片精细度;默认 28,取值范围 1–50"
seed:
type: integer
description: "随机数种子;设置后,相同描述与参数多次请求会生成一致的图片"
enable_safety_checker:
type: boolean
description: "是否启用内容安全检查,默认 true"
required:
- prompt
definitions:
ImageSize:
type: object
properties:
width:
type: integer
description: "自定义宽度,默认 512,最大 14142"
height:
type: integer
description: "自定义高度,默认 512,最大 14142"
examples: {}
responses:
'200':
description: "该字段的取值与含义以本平台实际返回为准。"
content:
application/json:
schema:
type: object
properties: {}
headers: {}
security: []
components:
schemas: {}
securitySchemes: {}
servers: []
security: []
使用提示:本页接口的 Base URL 为
https://api.allyang.cn,请求头需携带Authorization: Bearer <令牌>(令牌在控制台「令牌管理」中创建)。示例中的任务 ID、时间戳与文件地址均为示意值,实际以平台返回为准。本页为聚合平台兼容格式,模型可用性与计费以本平台「模型广场」公布为准。