【优化】midjourney 提交,支持 nijj 切换

This commit is contained in:
cherishsince 2024-05-30 16:25:31 +08:00
parent 15a3e80d62
commit 82fbb5e024
2 changed files with 5 additions and 15 deletions

View File

@ -40,6 +40,7 @@ export interface ImageDallReqVO {
export interface ImageMidjourneyImagineReqVO {
prompt: string // 提示词
model: string // 模型 mj nijj
base64Array: string[] // size不能为空
}

View File

@ -77,17 +77,17 @@ interface ImageSizeVO {
//
const prompt = ref<string>('') //
const selectHotWord = ref<string>('') //
const selectHotWord = ref<string>('midjourney') //
const hotWords = ref<string[]>(['中国旗袍', '古装美女', '卡通头像', '机甲战士', '童话小屋', '中国长城']) //
const selectModel = ref<any>() //
const models = ref<ImageModelVO[]>([
{
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)