From 8f2c6ab0db42bbeb4b08ce3f47269f360509ec7b Mon Sep 17 00:00:00 2001 From: cherishsince Date: Thu, 30 May 2024 16:12:24 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=20midjourney=20=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ai/image/index.ts | 20 +++++++++++++++++++- src/views/ai/image/midjourney/index.vue | 18 ++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/api/ai/image/index.ts b/src/api/ai/image/index.ts index 99419316..ffc5a091 100644 --- a/src/api/ai/image/index.ts +++ b/src/api/ai/image/index.ts @@ -23,6 +23,14 @@ export interface ImagePageReqVO { pageSize: number // 分页大小 } +export interface ImageDallReqVO { + prompt: string // 提示词 + model: string // 模型 + style: string // 图像生成的风格 + width: string // 图片宽度 + height: string // 图片高度 +} + export interface ImageDallReqVO { prompt: string // 提示词 model: string // 模型 @@ -30,6 +38,12 @@ export interface ImageDallReqVO { size: string // size不能为空 } +export interface ImageMidjourneyImagineReqVO { + prompt: string // 提示词 + base64Array: string[] // size不能为空 +} + + // AI API 密钥 API export const ImageApi = { // 获取 image 列表 @@ -44,8 +58,12 @@ export const ImageApi = { dall: async (data: ImageDallReqVO)=> { return await request.post({ url: `/ai/image/dall`, data }) }, + // midjourney - imagine + midjourneyImagine: async (data: ImageMidjourneyImagineReqVO)=> { + return await request.post({ url: `/ai/image/midjourney/imagine`, data }) + }, // 删除 deleteImage: async (id: number)=> { - return await request.delete({ url: `/ai/image/delete-my?id=${id}`}) + return await request.delete({ url: `/ai/image/delete-id-my?id=${id}`}) }, } diff --git a/src/views/ai/image/midjourney/index.vue b/src/views/ai/image/midjourney/index.vue index 114a1467..b0569981 100644 --- a/src/views/ai/image/midjourney/index.vue +++ b/src/views/ai/image/midjourney/index.vue @@ -74,6 +74,11 @@