Endpoint
POST /v1/images/generations
Headers
Authorization: 可选 示例:Bearer xxx
Request example
"{\r\n \"model\": \"qwen-image-plus\", //支持模型qwen-image-plus、qwen-image-max、qwen-image-2.0、qwen-image-2.0-pro\r\n \"input\": {\r\n \"prompt\": \"一间有着精致窗户的花店,漂亮的木质门,摆放着花朵\", //正向提示词,支持中英文,长度不超过800个字符,每个汉字/字母占一个字符,超过部分会自动截断\r\n \"negative_prompt\": \"\" //反向提示词,用来描述不希望在画面中看到的内容,可以对画面进行限制\r\n },\r\n \"parameters\": {\r\n \"size\": \"1024*1024\", //图片规格,图像宽高边长的像素范围为:[512, 1440]\r\n \"n\": 1 //图片数量,1-4.默认1\r\n }\r\n}"
Responses
200: 成功
OpenAPI specification
openapi: 3.0.1
info:
title: ''
description: ''
version: 1.0.0
paths:
/v1/images/generations:
post:
summary: 千问文生图
deprecated: false
description: >-
官方文档:https://bailian.console.aliyun.com/cn-beijing/?spm=5176.12818093_47.console-base_search-panel.dtab-product_sfm.3be916d08ZgBq6&scm=20140722.S_sfm._.ID_sfm-RL_%E6%A8%A1%E5%9E%8B-LOC_console_console-OR_ser-V_4-P0_1&tab=api#/api/?type=model&url=2976416
tags:
- 图片
parameters:
- name: Authorization
in: header
description: ''
required: false
example: Bearer xxx
schema:
type: string
requestBody:
content:
application/json:
schema:
type: string
example: "{\r\n \"model\": \"qwen-image-plus\", //支持模型qwen-image-plus、qwen-image-max、qwen-image-2.0、qwen-image-2.0-pro\r\n \"input\": {\r\n \"prompt\": \"一间有着精致窗户的花店,漂亮的木质门,摆放着花朵\", //正向提示词,支持中英文,长度不超过800个字符,每个汉字/字母占一个字符,超过部分会自动截断\r\n \"negative_prompt\": \"\" //反向提示词,用来描述不希望在画面中看到的内容,可以对画面进行限制\r\n },\r\n \"parameters\": {\r\n \"size\": \"1024*1024\", //图片规格,图像宽高边长的像素范围为:[512, 1440]\r\n \"n\": 1 //图片数量,1-4.默认1\r\n }\r\n}"
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
request_id:
type: string
output:
type: object
properties:
task_id:
type: string
task_status:
type: string
submit_time:
type: string
scheduled_time:
type: string
end_time:
type: string
results:
type: array
items:
type: object
properties:
orig_prompt:
type: string
actual_prompt:
type: string
url:
type: string
x-apifox-orders:
- orig_prompt
- actual_prompt
- url
task_metrics:
type: object
properties:
TOTAL:
type: integer
SUCCEEDED:
type: integer
FAILED:
type: integer
required:
- TOTAL
- SUCCEEDED
- FAILED
x-apifox-orders:
- TOTAL
- SUCCEEDED
- FAILED
required:
- task_id
- task_status
- submit_time
- scheduled_time
- end_time
- results
- task_metrics
x-apifox-orders:
- task_id
- task_status
- submit_time
- scheduled_time
- end_time
- results
- task_metrics
usage:
type: object
properties:
image_count:
type: integer
required:
- image_count
x-apifox-orders:
- image_count
required:
- request_id
- output
- usage
x-apifox-orders:
- request_id
- output
- usage
example:
request_id: f767d108-7d50-908b-a6d9-xxxxxx
output:
task_id: d492bffd-10b5-4169-b639-xxxxxx
task_status: SUCCEEDED
submit_time: '2025-01-08 16:03:59.840'
scheduled_time: '2025-01-08 16:03:59.863'
end_time: '2025-01-08 16:04:10.660'
results:
- orig_prompt: 一间有着精致窗户的花店,漂亮的木质门,摆放着花朵
actual_prompt: >-
一间有着精致雕花窗户的花店,漂亮的深色木质门上挂着铜制把手。店内摆放着各式各样的鲜花,包括玫瑰、百合和向日葵,色彩鲜艳,生机勃勃。背景是温馨的室内场景,透过窗户可以看到街道。高清写实摄影,中景构图。
url: >-
https://dashscope-result-wlcb.oss-cn-wulanchabu.aliyuncs.com/1.png
task_metrics:
TOTAL: 1
SUCCEEDED: 1
FAILED: 0
usage:
image_count: 1
headers: {}
x-apifox-name: 成功
security: []
x-apifox-folder: 图片
x-apifox-status: released
x-run-in-apifox: https://app.apifox.com/web/project/5443699/apis/api-330569734-run
components:
schemas: {}
securitySchemes: {}
servers: []
security: []
