petsHero-AI/docs/generate_video.md
2026-03-09 20:55:41 +08:00

11 lines
965 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# UI 开发流程
当点击中间upload an image as the base for generation 区域的时候,调用手机相册功能选择一张图片,一次只允许一张。用户选完图片后图片显示在 upload an image as the base for generation区域并隐藏提示信息。
当点击Generate Video的时候如果用户没有选择图片择提示用户选择图片如果已经选择了图片则开始按下面的步骤调用接口
# 接口调用
## 第一步
通过/v1/image/upload-presigned-url接口获取文件上传地址通常是uploadUrl1或者uploadUrl2,以及对应的filePath1和filePath2用于生成视频接口的入参
## 第二步
通过上一个接口获取的upload url 用put协议将图片上传到对应的地址注意图片上传不需要经过代理 并且需要将requiredHeaders的参数全部设置到请求头中
## 第三步
调用/v1/image/create-task接口并传入filePath1或者filePath2传入到srcImg1Url或者srcImg2Url