创建任务
OpenAPI Specification
yaml
openapi: 3.0.1
info:
title: ''
description: ''
version: 1.0.0
paths:
/tencent-vod/v1/aigc-video:
post:
summary: 创建任务
deprecated: false
description: 官方文档:https://cloud.tencent.com/document/product/266/126240
tags:
- 视频模型/腾讯AIGC视频生成
parameters:
- name: Authorization
in: header
description: ''
required: false
example: Bearer {{YOUR_API_KEY}}
schema:
type: string
- name: Content-Type
in: header
description: ''
required: false
example: application/json
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
properties:
prompt:
type: string
description: 提示词
negative_prompt:
type: string
description: |-
要阻止模型生成视频的提示词。
示例值:red
enhance_prompt:
type: string
description: |-
是否自动优化提示词。开启时将自动优化传入的 Prompt,以提升生成质量。取值有:
Enabled:开启;
Disabled:关闭;
示例值:Enabled
output_config:
type: object
properties:
storage_mode:
type: string
description: |-
存储模式。取值有:
Permanent:永久存储,生成的图片文件将存储到云点播,可在事件通知中获取到 FileId;
Temporary:临时存储,生成的图片文件不会存储到云点播,可在事件通知中获取到临时访问的 URL;
默认值:Temporary
aspect_ratio:
type: string
description: >-
指定所生成视频的宽高比。
当 ModelName 是 Kling,当文生视频时,则可选值为 16:9、9:16、 1:1,默认为16:9;
当 ModelName 是 Vidu,当文生视频时和使用参考图片生成时,则可选值为
16:9、9:16、4:3、3:4、1:1,其中仅版本q2支持4:3、3:4
当 ModelName 是 Hailuo,则暂不支持。
示例值:16:9
person_generation:
type: string
description: |-
是否允许人物或人脸生成。取值有:
AllowAdult:允许生成成人;
Disallowed:禁止在图片中包含人物或人脸;
示例值:AllowAdult
input_compliance_check:
type: string
description: |-
是否开启输入内容的合规性检查。取值有:
Enabled:开启;
Disabled:关闭;
示例值:Enabled
output_compliance_check:
type: string
description: |-
是否开启输出内容的合规性检查。取值有:
Enabled:开启;
Disabled:关闭;
示例值:Enabled
audio_generation:
type: string
description: |-
是否生成音频。支持的模型包括 GV、OS。取值有:
Enabled:开启;
Disabled:关闭;
默认值:Enabled
示例值:Enabled
duration:
type: string
description: |-
生成视频的时长,单位:秒。
当 ModelName 是 Kling,可选值为 5、10,默认为 5;
当 ModelName 是 Hailuo,可选值为 6、10,默认为 6;
当 ModelName 是 Vidu,可指定1-10;
示例值:8.0
resolution:
type: string
description: |-
生成视频的分辨率。
当 ModelName 是 Kling,可选值为 720P、1080P,默认为 720P;
当 ModelName 是 Hailuo,可选值为 768P、1080P,默认为 768P;
当 ModelName 是 Vidu,可选值为 720P、1080P,默认为 720P;
示例值:720P
x-apifox-orders:
- storage_mode
- resolution
- aspect_ratio
- audio_generation
- duration
- person_generation
- input_compliance_check
- output_compliance_check
description: 生视频任务的输出媒体文件配置。
session_id:
type: string
description: >-
用于去重的识别码,如果三天内曾有过相同的识别码的请求,则本次的请求会返回错误。最长 50
个字符,不带或者带空字符串表示不做去重。
示例值:mysession
session_context:
type: string
description: |-
来源上下文,用于透传用户请求信息,音画质重生完成回调将返回该字段值,最长 1000 个字符。
示例值:mySessionContext
tasks_priority:
type: string
description: |-
任务的优先级,数值越大优先级越高,取值范围是 -10 到 10,不填代表 0。
示例值:10
ext_info:
type: string
description: |-
保留字段,特殊用途时使用。
示例值:myextinfo
file_infos:
type: array
items:
type: object
properties:
type:
type: string
description: |-
输入的视频文件类型。取值有:
File:点播媒体文件;
Url:可访问的 URL;
示例值:File
file_id:
type: string
description: >-
图片文件的媒体文件 ID,即该文件在云点播上的全局唯一标识符,在上传成功后由云点播后台分配。可以在
视频上传完成事件通知 或 云点播控制台 获取该字段。当 Type 取值为 File 时,本参数有效。
说明:
1. 推荐使用小于7M的图片;
2. 图片格式的取值为:jpeg,jpg, png, webp。
示例值:3704211***509819
text:
type: string
description: |-
输入图片的描述信息,用于帮助模型理解图片。仅GEM 2.5、GEM 3.0 有效。
示例值:任务背景:这是需要翻新的主建筑(图1),不得改变其几何结构。
url:
type: string
description: |-
可访问的文件 URL。当 Type 取值为 Url 时,本参数有效。
说明:
1. 推荐使用小于7M的图片;
2. 图片格式的取值为:jpeg,jpg, png, webp。
示例值:https://test.com/1.png
category:
type: string
description: |-
文件分类。取值为:
Image: 图片;
Video: 视频。
示例值:Image
x-apifox-orders:
- type
- category
- file_id
- url
- text
description: >-
最多包含三张素材资源图片的列表,用于描述模型在生成视频时要使用的资源图片。
支持多图输入的模型:
1. GV,使用多图输入时,不可使用LastFrameFileId和LastFrameUrl。
2.
Vidu,支持多图参考生视频。q2模型1-7张图片,可通过FileInfos里面的ObjectId作为主体id来传入。
注意:
1. 图片大小不超过10M。
2. 支持的图片格式:jpeg、png。
last_frame_url:
type: string
description: >-
用于作为尾帧画面来生成视频的媒体文件 URL。说明:
1. 只支持模型 GV 、Kling、Vidu,其他模型暂不支持。当 ModelName 为 GV
时,如果指定该参数,则需同时指定 FileInfos 作为待生成视频的首帧。当 ModelName 为 Kling
、ModelVersion 为 2.1 并且指定输出分辨率 Resolution 为 1080P 时,才能指定该参数。当
ModelName 为 Vidu、ModelVersion 为 q2-pro、q2-turbo 时,才能指定该参数。
2. 图片大小需小于5M。
3. 3. 图片格式的取值为:jpeg,jpg, png, webp。
示例值:https://test.com/1.png
model_name:
type: string
description: |-
模型名称。取值:
Hailuo:海螺;
Kling:可灵;
Vidu;
示例值:GV
model_version:
type: string
description: |-
模型版本。取值:
当 ModelName 是 Hailuo,可选值为 02、2.3、2.3-fast;
当 ModelName 是 Kling,可选值为 1.6、2.0、2.1、2.5、O1;
当 ModelName 是 Vidu,可选值为 q2、q2-pro、q2-turbo;
示例值:2.3
scene_type:
type: string
description: |-
场景类型。取值如下:
当 ModelName 为 Kling 时:
motion_control 表示动作控制;
avatar_i2v 表示数字人;
lip_sync 表示对口型;
其他 ModelName 暂不支持。
示例值:motion_control
required:
- model_name
- prompt
- model_version
x-apifox-orders:
- model_name
- model_version
- prompt
- negative_prompt
- enhance_prompt
- file_infos
- last_frame_url
- output_config
- scene_type
- session_id
- session_context
- tasks_priority
- ext_info
example:
model_name: Kling
model_version: '1.6'
prompt: 一辆汽车在公路上行驶,阳光明媚
negative_prompt: 模糊、抖动
enhance_prompt: Enabled
output_config:
storage_mode: Temporary
media_name: car-video
duration: 8
resolution: 1080P
aspect_ratio: '16:9'
audio_generation: Enabled
person_generation: AllowAdult
input_compliance_check: Enabled
output_compliance_check: Enabled
enhance_switch: Enabled
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
status:
type: string
request_id:
type: string
response_url:
type: string
status_url:
type: string
cancel_url:
type: string
logs:
type: 'null'
metrics:
type: object
properties: {}
queue_position:
type: integer
required:
- status
- request_id
- response_url
- status_url
- cancel_url
- logs
- metrics
- queue_position
example:
Response:
TaskId: 251007502-AigcImage***2782aff1e896673f1ft
RequestId: f50d7667-72d8-46bb-a7e3-0613588971b6
headers: {}
x-apifox-name: 成功
security: []
x-apifox-folder: 视频模型/腾讯AIGC视频生成
x-apifox-status: released
x-run-in-apifox: https://app.apifox.com/web/project/5443236/apis/api-399032083-run
components:
schemas: {}
securitySchemes:
bearer:
type: http
scheme: bearer
servers:
- url: https://www.anyapi.vip
description: 正式环境
security:
- bearer: []