生成图生视频
POST /openapi/v2/video/img/generate
说明
通过图片进行图生视频的生成. 生成前必须传图片, 用img_id来进行请求.
概览
| Method | POST |
|---|---|
| Path | /openapi/v2/video/img/generate |
| Type | http |
| Status | 1 |
| Module | 2102810 |
| Folder | 86260306 |
参数
{ "query": [], "path": [], "cookie": [], "header": [ { "required": false, "description": "", "type": "string", "id": "UEYf7OSxYv", "enable": true, "name": "Content-Type", "sampleValue": "application/json" }, { "required": false, "description": "", "type": "string", "id": "MDdsIJA5bp", "enable": true, "name": "API-KEY", "sampleValue": "{{YOUR_API_KEY}}" } ] }
请求体
{ "type": "application/json", "parameters": [], "jsonSchema": { "type": "object", "properties": { "duration": { "type": "integer", "description": "视频生成时长\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 任意时长" }, "img_id": { "type": "integer", "description": "上传图片后获取的img_id" }, "model": { "type": "string", "description": "模型 \"v3.5\",\"v4\",\"v4.5\",\"v5\",\"v5.5\",\"v5.6\",\"v6\",\"c1\"" }, "template_id": { "type": "integer", "description": "模版ID\n" }, "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\"" }, "prompt": { "type": "string", "description": "2048 Characters 以内" }, "quality": { "type": "string", "description": "\"360p\",\"540p\",\"720p\",\"1080p\"" }, "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\n" }, "img_ids": { "type": "array", "items": { "type": "integer" }, "description": "多图模版时使用此字段. ex) \"img_ids \":[0,0]" }, "style": { "type": "string", "description": "风格,可选:\"anime\"、\"3d_animation\"、\"day\"、\"cyberpunk\"、\"comic\",如非必要可不传" }, "generate_audio_switch": { "type": "boolean", "description": "支持 v5.5,v5.6,v6,c1\n/ 控制开关Audio. true: Audio on , false: Audio off" }, "generate_multi_clip_switch": { "type": "boolean", "description": "支持 v5.5,v6 / 控制单镜头, 多镜头 true: 多镜头 , false: 单镜头" }, "thinking_type": { "type": "string", "description": "支持v5.5,v5.6,v6/ 是否使用系统优化提示词功能 \"enabled\" : 打开 \"disabled\" : 关闭. \"auto\" or omitted: 让模型自动决定" } }, "required": [ "duration", "model", "prompt", "quality", "img_id", "img_ids" ], "x-apifox-orders": [ "duration", "img_id", "img_ids", "model", "style", "template_id", "motion_mode", "camera_movement", "prompt", "quality", "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", "thinking_type", "seed" ] }, "required": true, "mediaType": "", "examples": [ { "name": "示例 1", "value": "{\r\n \"duration\": 5,\r\n \"img_id\": 1,\r\n \"model\": \"v6\",\r\n \"template_id\": 0,\r\n \"motion_mode\": \"normal\",\r\n //\"camera_movement\": \"zoom_in\", // 可以在文/图生视频添加运镜(支持v4,v4.5版本)参数请参考文档\r\n \"prompt\": \"string\",\r\n \"quality\": \"720p\",\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": 121351013, "name": "成功", "code": 200, "contentType": "json", "jsonSchema": { "type": "object", "properties": {} }, "itemSchema": {}, "description": "", "mediaType": "", "headers": [] } ]