Merge branch 'develop' of https://github.com/HBAI-Ltd/Toonflow-app into develop
This commit is contained in:
commit
1dd328262c
@ -16,8 +16,10 @@ export default router.post(
|
||||
}),
|
||||
async (req, res) => {
|
||||
const { filePath, prompt, projectId, assetsId } = req.body;
|
||||
//拿到图片尺寸
|
||||
const projectInfo = await u.db("t_project").where({ id: projectId }).first();
|
||||
|
||||
let data = await u.editImage(filePath, prompt, projectId);
|
||||
let data = await u.editImage(filePath, prompt, projectId,projectInfo?.videoRatio!);
|
||||
const returnData: {
|
||||
id: number | null;
|
||||
url: string | null;
|
||||
|
||||
@ -77,7 +77,7 @@ async function convertDirectiveAndImages(images: Record<string, string>, directi
|
||||
* "将@图10中圈起来的部分换成@图8"
|
||||
* );
|
||||
*/
|
||||
export default async (images: Record<string, string>, directive: string, projectId: number) => {
|
||||
export default async (images: Record<string, string>, directive: string, projectId: number, aspectRatio: string | null) => {
|
||||
const { prompt, images: base64Images } = await convertDirectiveAndImages(images, directive);
|
||||
const apiConfig = await u.getPromptAi("editImage");
|
||||
|
||||
@ -86,7 +86,7 @@ export default async (images: Record<string, string>, directive: string, project
|
||||
systemPrompt: "根据用户提供的具体修改指令,对上传的图片进行智能编辑。",
|
||||
prompt: prompt,
|
||||
imageBase64: base64Images,
|
||||
aspectRatio: "16:9",
|
||||
aspectRatio: aspectRatio ? aspectRatio : "16:9",
|
||||
size: "1K",
|
||||
},
|
||||
apiConfig,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user