生成文生视频

POST /openapi/v2/video/text/generate

MethodPOST
Path/openapi/v2/video/text/generate
Typehttp
Status1
Module2102810
Folder86260306

说明

通过prompt 进行文生视频的生成

概览

MethodPOST
Path/openapi/v2/video/text/generate
Typehttp
Status1
Module2102810
Folder86260306

参数

{
  "query": [],
  "path": [],
  "cookie": [],
  "header": [
    {
      "required": false,
      "description": "",
      "type": "string",
      "id": "5v6QyuIzPR",
      "enable": true,
      "name": "API-KEY",
      "sampleValue": "{{YOUR_API_KEY}}"
    },
    {
      "required": false,
      "description": "",
      "type": "string",
      "id": "PmeSAvA4ST",
      "enable": true,
      "name": "Content-Type",
      "sampleValue": "application/json"
    }
  ]
}

请求体

{
  "type": "application/json",
  "parameters": [],
  "jsonSchema": {
    "type": "object",
    "properties": {
      "aspect_ratio": {
        "type": "string",
        "description": "1. 基础提供 \"16:9\",\"9.16\",\"4:3\",\"3:4\",\"1:1\" 画幅比\n2. v6,c1 支持 \"16:9\",\"9.16\",\"4:3\",\"3:4\",\"1:1\",\"2:3\",\"3:2\",\"21:9\""
      },
      "duration": {
        "type": "integer",
        "description": "视频生成时长\n视频生成时长\nv.3.5/v4/v4.5 : 5/8 (v3.5 1080p 无法使用 8)\nv5 : 5/8\nv5.5/5.6 : 5/8/10 (1080p 无法使用 10)\nv6/c1 : 1~15 任意时长"
      },
      "model": {
        "type": "string",
        "description": "模型 \"v3.5\",\"v4\",\"v4.5\", \"v5\",\"v5.5\",\"v5.6\",\"v6\",\"c1\""
      },
      "motion_mode": {
        "type": "string",
        "description": "\"normal\",\"fast\". \"fast\" 不支持 8s, \"v5\" 以上版本不支持此字段"
      },
      "camera_movement": {
        "type": "string",
        "description": "可以在文/图生视频添加运镜(支持v4,v4.5版本)\n支持参数: \"horizontal_left\",\"horizontal_right\",\"vertical_up\",\"vertical_down\",\n\"zoom_in\",\"zoom_out\",\"crane_up\",\n\"quickly_zoom_in\",\"quickly_zoom_out\",\"smooth_zoom_in\",\n\"camera_rotation\",\"robo_arm\",\"super_dolly_out\",\"whip_pan\",\"hitchcock\",\n\"left_follow\",\"right_follow\",\"pan_left\",\"pan_right\",\"fix_bg\"\n"
      },
      "prompt": {
        "type": "string",
        "description": "5000 Characters 以内"
      },
      "quality": {
        "type": "string",
        "description": "\"360p\",\"540p\",\"720p\",\"1080p\""
      },
      "template_id": {
        "type": "integer",
        "description": "模版(特效)ID , 使用之前需要激活"
      },
      "sound_effect_switch": {
        "type": "boolean",
        "description": "v5 以下 or 有template_id时可使用. true, false\n如果想一起使用sound_effect 请传为true"
      },
      "sound_effect_content": {
        "type": "string",
        "description": "v5 以下 or 有template_id时可使用.可输入想要的音效, 如果不填写会根据视频内容生成音效"
      },
      "lip_sync_tts_switch": {
        "type": "boolean",
        "description": "true, false\n如果想一起使用对口型 请传为true"
      },
      "lip_sync_tts_content": {
        "type": "string",
        "description": "~140Chracters (UTF-8). 可输入想要的tts 内容"
      },
      "lip_sync_tts_speaker_id": {
        "type": "string",
        "description": "获取TTS 音色后的id"
      },
      "seed": {
        "type": "integer",
        "description": "可传随机数 0 - 2147483647"
      },
      "generate_multi_clip_switch": {
        "type": "boolean",
        "description": "支持:v5.5,v6\n控制单镜头, 多镜头 true: 多镜头 , false: 单镜头/"
      },
      "generate_audio_switch": {
        "type": "boolean",
        "description": "支持 v5.5,v5.6,v6,c1\n/ 控制开关Audio. true: Audio on , false: Audio off"
      }
    },
    "required": [
      "aspect_ratio",
      "duration",
      "model",
      "prompt",
      "quality"
    ],
    "x-apifox-orders": [
      "aspect_ratio",
      "duration",
      "model",
      "motion_mode",
      "camera_movement",
      "prompt",
      "quality",
      "template_id",
      "generate_audio_switch",
      "generate_multi_clip_switch",
      "sound_effect_switch",
      "sound_effect_content",
      "lip_sync_tts_switch",
      "lip_sync_tts_content",
      "lip_sync_tts_speaker_id",
      "seed"
    ]
  },
  "required": true,
  "mediaType": "",
  "examples": [
    {
      "name": "示例 1",
      "value": "{\r\n    \"aspect_ratio\": \"16:9\",\r\n    \"duration\": 5,\r\n    \"model\": \"v6\",\r\n    \"motion_mode\": \"normal\",\r\n    //\"camera_movement\": \"zoom_in\", //可以在文/图生视频添加运镜(支持v4,v4.5版本)参数请参考文档\r\n    \"prompt\": \"string\",\r\n    \"quality\": \"540p\",\r\n    //\"template_id\": 302325299692608, 激活模版才可使用\r\n    //\"sound_effect_switch\":true,\r\n    //\"sound_effect_content\":\"\",\r\n    //\"lip_sync_tts_switch\":true,\r\n    //\"lip_sync_tts_content\":\"\",\r\n    //\"lip_sync_tts_speaker_id\":\"\",\r\n    \"seed\": 0\r\n}",
      "mediaType": "application/json"
    }
  ],
  "oasExtensions": ""
}

响应

[
  {
    "id": 122001587,
    "name": "成功",
    "code": 200,
    "contentType": "json",
    "jsonSchema": {
      "type": "object",
      "properties": {}
    },
    "itemSchema": {},
    "description": "",
    "mediaType": "",
    "headers": []
  }
]