Skip to content

Commit dd76cc5

Browse files
committed
【增加】ai image 增加千帆模型
1 parent 9336280 commit dd76cc5

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/views/ai/image/index/components/other/index.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ import {
8383
ImageHotWords,
8484
ImageModelVO,
8585
OtherPlatformEnum,
86+
QianFanModels,
8687
TongYiWanXiangModels
8788
} from '@/views/ai/utils/constants'
8889
@@ -96,7 +97,7 @@ const prompt = ref<string>('') // 提示词
9697
const width = ref<number>(512) // 图片宽度
9798
const height = ref<number>(512) // 图片高度
9899
const otherPlatform = ref<string>(AiPlatformEnum.TONG_YI) // 平台
99-
const models = ref<ImageModelVO[]>(TongYiWanXiangModels) // 模型
100+
const models = ref<ImageModelVO[]>(TongYiWanXiangModels) // 模型 TongYiWanXiangModels、QianFanModels
100101
const model = ref<string>(models.value[0].key) // 模型
101102
102103
@@ -154,8 +155,10 @@ const settingValues = async (detail: ImageVO) => {
154155
/** 平台切换 */
155156
const handlerPlatformChange = async (platform) => {
156157
// 切换平台,切换模型、风格
157-
if (AiPlatformEnum.YI_YAN === platform) {
158+
if (AiPlatformEnum.TONG_YI === platform) {
158159
models.value = TongYiWanXiangModels
160+
} else if (AiPlatformEnum.YI_YAN === platform) {
161+
models.value = QianFanModels
159162
} else {
160163
models.value = []
161164
}

src/views/ai/utils/constants.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const OtherPlatformEnum:ImageModelVO [] = [
3030
},
3131
{
3232
key: AiPlatformEnum.YI_YAN,
33-
name: '百度图片'
33+
name: '百度千帆'
3434
}
3535
]
3636

@@ -259,6 +259,14 @@ export const TongYiWanXiangModels: ImageModelVO[] = [
259259
}
260260
]
261261

262+
export const QianFanModels: ImageModelVO[] = [
263+
{
264+
key: 'sd_xl',
265+
name: 'sd_xl'
266+
}
267+
]
268+
269+
262270
export const StableDiffusionClipGuidancePresets: ImageModelVO[] = [
263271
{
264272
key: 'NONE',

0 commit comments

Comments
 (0)