From 82fbb5e024b1644c9625239d2596947b6f75cc17 Mon Sep 17 00:00:00 2001 From: cherishsince Date: Thu, 30 May 2024 16:25:31 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91midjourney?= =?UTF-8?q?=20=E6=8F=90=E4=BA=A4=EF=BC=8C=E6=94=AF=E6=8C=81=20nijj=20?= =?UTF-8?q?=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ai/image/index.ts | 1 + src/views/ai/image/midjourney/index.vue | 19 ++++--------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/api/ai/image/index.ts b/src/api/ai/image/index.ts index ffc5a091..8e52d427 100644 --- a/src/api/ai/image/index.ts +++ b/src/api/ai/image/index.ts @@ -40,6 +40,7 @@ export interface ImageDallReqVO { export interface ImageMidjourneyImagineReqVO { prompt: string // 提示词 + model: string // 模型 mj nijj base64Array: string[] // size不能为空 } diff --git a/src/views/ai/image/midjourney/index.vue b/src/views/ai/image/midjourney/index.vue index 5b4e257e..c08ca625 100644 --- a/src/views/ai/image/midjourney/index.vue +++ b/src/views/ai/image/midjourney/index.vue @@ -77,17 +77,17 @@ interface ImageSizeVO { // 定义属性 const prompt = ref('') // 提示词 -const selectHotWord = ref('') // 选中的热词 +const selectHotWord = ref('midjourney') // 选中的热词 const hotWords = ref(['中国旗袍', '古装美女', '卡通头像', '机甲战士', '童话小屋', '中国长城']) // 热词 const selectModel = ref() // 选中的热词 const models = ref([ { - key: 'qinxi', + key: 'midjourney', name: 'MJ', image: 'https://bigpt8.com/pc/_nuxt/mj.34a61377.png', }, { - key: 'ziran', + key: 'niji', name: 'NIJI', image: 'https://bigpt8.com/pc/_nuxt/nj.ca79b143.png', }, @@ -122,18 +122,6 @@ const handlerModelClick = async (model: ImageModelVO) => { selectModel.value = model } -/** - * size - click - */ -const handlerSizeClick = async (imageSize: ImageSizeVO) => { - if (selectImageSize.value === imageSize) { - selectImageSize.value = {} as ImageSizeVO - return - } - selectImageSize.value = imageSize - console.log(imageSize) -} - /** * 图片生产 */ @@ -145,6 +133,7 @@ const handlerGenerateImage = async () => { // 发送请求 const req = { prompt: prompt.value, + model: selectModel.value.key, base64Array: [], } as ImageMidjourneyImagineReqVO await ImageApi.midjourneyImagine(req)