官方文档: https://fal.ai/models/fal-ai/flux-pro/kontext/text-to-image
POST
/fal-ai/flux-pro/kontext/text-to-image/fal-ai/flux-pro/kontext/text-to-image
API Key application/json
请求示例
curl -X POST https://top.qingyuntop.ai/fal-ai/flux-pro/kontext/text-to-image \
-H "Authorization: Bearer ${QINGYUN_TOP_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture.",
"guidance_scale": 3.5,
"num_images": 1,
"output_format": "jpeg",
"safety_tolerance": "2",
"aspect_ratio": "1:1"
}'请求参数
| 参数 | 位置 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|---|
prompt | JSON body | string | 是 | 生成图像的提示。 | - |
guidance_scale | JSON body | number | 否 | CFG(无分类器引导)量表用于衡量您希望模型在寻找相关图像时与提示的贴近程度。默认值:3.5 范围值1-20 | - |
num_images | JSON body | integer | 否 | 生成的图像数量。默认值:1 范围值1-4 | - |
output_format | JSON body | string | 否 | 生成图片的格式。默认值:"jpeg" 支持default、png、jpeg | - |
safety_tolerance | JSON body | string | 否 | 生成图像的安全容差等级。1 表示最严格,5 表示最宽松。默认值:"2" | - |
aspect_ratio | JSON body | string | 否 | 生成图像的宽高比。默认值:"1:1" 支持:21:9、16:9、4:3、3:2、1:1、2:3、3:4、9:16、9:21 | - |
返回响应 (200)
此部分没有定义参数。
响应示例
{
"status": "IN_QUEUE",
"request_id": "acf05732-7cb3-445b-9f39-fdaeccb1d730",
"response_url": "https://queue.fal.run/fal-ai/flux-pro/requests/acf05732-7cb3-445b-9f39-fdaeccb1d730",
"status_url": "https://queue.fal.run/fal-ai/flux-pro/requests/acf05732-7cb3-445b-9f39-fdaeccb1d730/status",
"cancel_url": "https://queue.fal.run/fal-ai/flux-pro/requests/acf05732-7cb3-445b-9f39-fdaeccb1d730/cancel",
"logs": null,
"metrics": {},
"queue_position": 0
}来源原始接口定义(用于追溯)
以下内容来自 Apifox 快照,可能包含兼容层字段或旧示例;公开调用请以本页的协议说明和当前模型列表为准。
{
"id": 495899891,
"name": "/fal-ai/flux-pro/kontext/text-to-image",
"type": "http",
"serverId": "",
"preProcessors": [],
"postProcessors": [],
"inheritPreProcessors": {},
"inheritPostProcessors": {},
"description": "官方文档: https://fal.ai/models/fal-ai/flux-pro/kontext/text-to-image",
"operationId": "",
"sourceUrl": "",
"method": "post",
"path": "/fal-ai/flux-pro/kontext/text-to-image",
"tags": [],
"status": 1,
"requestBody": {
"type": "application/json",
"parameters": [],
"jsonSchema": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "生成图像的提示。"
},
"guidance_scale": {
"type": "number",
"description": "CFG(无分类器引导)量表用于衡量您希望模型在寻找相关图像时与提示的贴近程度。默认值:3.5 范围值1-20"
},
"num_images": {
"type": "integer",
"description": "生成的图像数量。默认值:1 范围值1-4"
},
"output_format": {
"type": "string",
"description": "生成图片的格式。默认值:\"jpeg\" 支持default、png、jpeg"
},
"safety_tolerance": {
"type": "string",
"description": "生成图像的安全容差等级。1 表示最严格,5 表示最宽松。默认值:\"2\""
},
"aspect_ratio": {
"type": "string",
"description": "生成图像的宽高比。默认值:\"1:1\" 支持:21:9、16:9、4:3、3:2、1:1、2:3、3:4、9:16、9:21"
}
},
"required": [
"prompt"
],
"x-apifox-orders": [
"prompt",
"guidance_scale",
"num_images",
"output_format",
"safety_tolerance",
"aspect_ratio"
]
},
"examples": [
{
"mediaType": "application/json",
"value": "{\r\n \"prompt\": \"Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \\\"FLUX\\\" is painted over it in big, white brush strokes with visible texture.\",\r\n \"guidance_scale\": 3.5,\r\n \"num_images\": 1,\r\n \"output_format\": \"jpeg\",\r\n \"safety_tolerance\": \"2\",\r\n \"aspect_ratio\": \"1:1\"\r\n}"
}
],
"mediaType": "",
"oasExtensions": "",
"required": false,
"additionalContentTypes": []
},
"parameters": {
"path": [],
"query": [],
"cookie": [],
"header": []
},
"commonParameters": {
"query": [],
"body": [],
"cookie": [],
"header": []
},
"auth": {},
"responses": [
{
"id": 105106992,
"name": "成功",
"code": 200,
"contentType": "json",
"jsonSchema": {
"type": "object",
"properties": {},
"x-apifox-orders": []
},
"itemSchema": {},
"description": "",
"mediaType": "",
"headers": [],
"oasExtensions": ""
}
],
"responseExamples": [
{
"name": "成功示例",
"responseId": 105106992,
"data": "{\r\n \"status\": \"IN_QUEUE\",\r\n \"request_id\": \"acf05732-7cb3-445b-9f39-fdaeccb1d730\",\r\n \"response_url\": \"https://queue.fal.run/fal-ai/flux-pro/requests/acf05732-7cb3-445b-9f39-fdaeccb1d730\",\r\n \"status_url\": \"https://queue.fal.run/fal-ai/flux-pro/requests/acf05732-7cb3-445b-9f39-fdaeccb1d730/status\",\r\n \"cancel_url\": \"https://queue.fal.run/fal-ai/flux-pro/requests/acf05732-7cb3-445b-9f39-fdaeccb1d730/cancel\",\r\n \"logs\": null,\r\n \"metrics\": {},\r\n \"queue_position\": 0\r\n}",
"description": "",
"oasKey": "",
"oasExtensions": "",
"id": "019fc09b-0b32-74f2-944a-d8aeea0e41ff"
}
],
"codeSamples": [],
"projectId": 8662722,
"moduleId": 8310462,
"folderId": 92436089,
"ordering": 36,
"responsibleId": 0,
"commonResponseStatus": {},
"advancedSettings": {
"disabledSystemHeaders": {}
},
"customApiFields": {},
"oasExtensions": "",
"mockScript": {},
"createdAt": "2026-08-02T03:53:34.000Z",
"updatedAt": "2026-08-05T14:40:24.000Z",
"creatorId": 2863449,
"editorId": 2863449,
"creatorUserId": 2863449,
"editorUserId": 2863449,
"responseChildren": [
"BLANK.105106992"
],
"visibility": "INHERITED",
"securityScheme": {},
"callbacks": ""
}