Skip to content

Commit d14ba2e

Browse files
committed
【增加】ChatGlm 对接 Image
1 parent dd76cc5 commit d14ba2e

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
</el-select>
6262
</el-space>
6363
</div>
64-
<div class="group-item">
64+
<div class="group-item" v-if="otherPlatform !== AiPlatformEnum.CHATGLM">
6565
<div>
6666
<el-text tag="b">图片尺寸</el-text>
6767
</div>
@@ -79,7 +79,7 @@
7979
<script setup lang="ts">
8080
import {ImageApi, ImageDrawReqVO, ImageVO} from '@/api/ai/image'
8181
import {
82-
AiPlatformEnum,
82+
AiPlatformEnum, ChatGlmModels,
8383
ImageHotWords,
8484
ImageModelVO,
8585
OtherPlatformEnum,
@@ -159,6 +159,11 @@ const handlerPlatformChange = async (platform) => {
159159
models.value = TongYiWanXiangModels
160160
} else if (AiPlatformEnum.YI_YAN === platform) {
161161
models.value = QianFanModels
162+
} else if (AiPlatformEnum.CHATGLM === platform) {
163+
models.value = ChatGlmModels
164+
// ChatGlm 模型没有 width、height 随便默认一个值过后台必填检测
165+
height.value = 512
166+
width.value = 512
162167
} else {
163168
models.value = []
164169
}

src/views/ai/utils/constants.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export const AiPlatformEnum = {
2121
STABLE_DIFFUSION: 'StableDiffusion', // Stability AI
2222
MIDJOURNEY: 'Midjourney', // Midjourney
2323
SUNO: 'Suno', // Suno AI
24+
CHATGLM: 'ChatGlm', // ChatGlm
2425
}
2526

2627
export const OtherPlatformEnum:ImageModelVO [] = [
@@ -31,6 +32,10 @@ export const OtherPlatformEnum:ImageModelVO [] = [
3132
{
3233
key: AiPlatformEnum.YI_YAN,
3334
name: '百度千帆'
35+
},
36+
{
37+
key: AiPlatformEnum.CHATGLM,
38+
name: '智铺 ChatGlm'
3439
}
3540
]
3641

@@ -266,6 +271,13 @@ export const QianFanModels: ImageModelVO[] = [
266271
}
267272
]
268273

274+
export const ChatGlmModels: ImageModelVO[] = [
275+
{
276+
key: 'cogview-3',
277+
name: 'cogview-3'
278+
}
279+
]
280+
269281

270282
export const StableDiffusionClipGuidancePresets: ImageModelVO[] = [
271283
{

0 commit comments

Comments
 (0)