Skip to content

Commit 5d852be

Browse files
authored
🐛 fix: some ai image bugs (#8490)
1 parent 993b0fa commit 5d852be

File tree

31 files changed

+608
-242
lines changed

31 files changed

+608
-242
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# 添加新的 AI 图像模型
2+
3+
## 兼容 openai 请求格式的模型
4+
5+
指的是可以使用 openai SDK 进行请求,并且请求参数和和返回值和 dall-e 以及 gpt-image-x 系列一致。
6+
7+
以智谱的 CogView-4 为例,它是一个兼容 openai 请求格式的模型,可以按照以下步骤添加:
8+
9+
1. 在对应的 ai models 文件 `src/config/aiModels/zhipu.ts` 中,添加模型配置,例如:
10+
11+
```ts
12+
const zhipuImageModels: AIImageModelCard[] = [
13+
// 添加模型配置
14+
// https://bigmodel.cn/dev/howuse/image-generation-model/cogview-4
15+
{
16+
description:
17+
'CogView-4 是智谱首个支持生成汉字的开源文生图模型,在语义理解、图像生成质量、中英文字生成能力等方面全面提升,支持任意长度的中英双语输入,能够生成在给定范围内的任意分辨率图像。',
18+
displayName: 'CogView-4',
19+
enabled: true,
20+
id: 'cogview-4',
21+
parameters: {
22+
prompt: {
23+
default: '',
24+
},
25+
size: {
26+
default: '1024x1024',
27+
enum: ['1024x1024', '768x1344', '864x1152', '1344x768', '1152x864', '1440x720', '720x1440'],
28+
},
29+
},
30+
releasedAt: '2025-03-04',
31+
type: 'image',
32+
},
33+
];
34+
```
35+
36+
2. 执行下 `npx i18n` 命令,更新模型描述的翻译文件

docs/development/basic/add-new-ai-image-model.zh-CN.mdx

Whitespace-only changes.

locales/ar/components.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,12 @@
7070
},
7171
"ImageUpload": {
7272
"actions": {
73-
"changeImage": "انقر لتغيير الصورة"
73+
"changeImage": "انقر لتغيير الصورة",
74+
"dropMultipleFiles": "لا يدعم تحميل ملفات متعددة في آن واحد، سيتم استخدام الملف الأول فقط"
7475
},
7576
"placeholder": {
7677
"primary": "إضافة صورة",
77-
"secondary": "انقر للتحميل"
78+
"secondary": "انقر أو اسحب للإرفاق"
7879
}
7980
},
8081
"KeyValueEditor": {
@@ -109,7 +110,7 @@
109110
},
110111
"MultiImagesUpload": {
111112
"actions": {
112-
"uploadMore": "انقر لتحميل المزيد"
113+
"uploadMore": "انقر أو اسحب لإضافة المزيد"
113114
},
114115
"modal": {
115116
"complete": "اكتمل",
@@ -119,7 +120,7 @@
119120
"upload": "تحميل الصور"
120121
},
121122
"placeholder": {
122-
"primary": "انقر لتحميل الصور",
123+
"primary": "انقر أو اسحب لتحميل الصور",
123124
"secondary": "يدعم اختيار عدة صور"
124125
},
125126
"progress": {

locales/bg-BG/components.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,12 @@
7070
},
7171
"ImageUpload": {
7272
"actions": {
73-
"changeImage": "Кликнете, за да смените изображението"
73+
"changeImage": "Кликнете, за да смените изображението",
74+
"dropMultipleFiles": "Не се поддържа качване на няколко файла едновременно, ще бъде използван само първият файл"
7475
},
7576
"placeholder": {
7677
"primary": "Добавяне на изображение",
77-
"secondary": "Кликнете, за да качите"
78+
"secondary": "Кликнете или плъзнете, за да качите"
7879
}
7980
},
8081
"KeyValueEditor": {
@@ -109,7 +110,7 @@
109110
},
110111
"MultiImagesUpload": {
111112
"actions": {
112-
"uploadMore": "Кликнете, за да качите още"
113+
"uploadMore": "Кликнете или плъзнете, за да качите още"
113114
},
114115
"modal": {
115116
"complete": "Готово",
@@ -119,7 +120,7 @@
119120
"upload": "Качване на изображение"
120121
},
121122
"placeholder": {
122-
"primary": "Кликнете, за да качите изображение",
123+
"primary": "Кликнете или плъзнете, за да качите изображение",
123124
"secondary": "Поддържа избор на няколко изображения"
124125
},
125126
"progress": {

locales/de-DE/components.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,12 @@
7070
},
7171
"ImageUpload": {
7272
"actions": {
73-
"changeImage": "Bild ändern"
73+
"changeImage": "Klicken, um das Bild zu ändern",
74+
"dropMultipleFiles": "Das Hochladen mehrerer Dateien wird nicht unterstützt, es wird nur die erste Datei verwendet"
7475
},
7576
"placeholder": {
7677
"primary": "Bild hinzufügen",
77-
"secondary": "Zum Hochladen klicken"
78+
"secondary": "Klicken oder ziehen, um hochzuladen"
7879
}
7980
},
8081
"KeyValueEditor": {
@@ -109,7 +110,7 @@
109110
},
110111
"MultiImagesUpload": {
111112
"actions": {
112-
"uploadMore": "Klicken Sie, um weitere hochzuladen"
113+
"uploadMore": "Klicken oder ziehen, um mehr hochzuladen"
113114
},
114115
"modal": {
115116
"complete": "Fertig",
@@ -119,7 +120,7 @@
119120
"upload": "Bild hochladen"
120121
},
121122
"placeholder": {
122-
"primary": "Klicken Sie, um Bilder hochzuladen",
123+
"primary": "Klicken oder ziehen, um Bilder hochzuladen",
123124
"secondary": "Mehrere Bilder können ausgewählt werden"
124125
},
125126
"progress": {

locales/en-US/components.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,12 @@
7070
},
7171
"ImageUpload": {
7272
"actions": {
73-
"changeImage": "Click to Change Image"
73+
"changeImage": "Click to change image",
74+
"dropMultipleFiles": "Uploading multiple files at once is not supported; only the first file will be used"
7475
},
7576
"placeholder": {
7677
"primary": "Add Image",
77-
"secondary": "Click to Upload"
78+
"secondary": "Click or drag to upload"
7879
}
7980
},
8081
"KeyValueEditor": {
@@ -109,7 +110,7 @@
109110
},
110111
"MultiImagesUpload": {
111112
"actions": {
112-
"uploadMore": "Click to upload more"
113+
"uploadMore": "Click or drag to upload more"
113114
},
114115
"modal": {
115116
"complete": "Done",
@@ -119,7 +120,7 @@
119120
"upload": "Upload Images"
120121
},
121122
"placeholder": {
122-
"primary": "Click to upload images",
123+
"primary": "Click or drag to upload images",
123124
"secondary": "Supports multiple image selection"
124125
},
125126
"progress": {

locales/es-ES/components.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,12 @@
7070
},
7171
"ImageUpload": {
7272
"actions": {
73-
"changeImage": "Haz clic para cambiar la imagen"
73+
"changeImage": "Haz clic para cambiar la imagen",
74+
"dropMultipleFiles": "No se admite la carga múltiple de archivos, solo se utilizará el primer archivo"
7475
},
7576
"placeholder": {
7677
"primary": "Agregar imagen",
77-
"secondary": "Haz clic para subir"
78+
"secondary": "Haga clic o arrastre para subir"
7879
}
7980
},
8081
"KeyValueEditor": {
@@ -109,7 +110,7 @@
109110
},
110111
"MultiImagesUpload": {
111112
"actions": {
112-
"uploadMore": "Haz clic para subir más"
113+
"uploadMore": "Haz clic o arrastra para subir más"
113114
},
114115
"modal": {
115116
"complete": "Completar",
@@ -119,7 +120,7 @@
119120
"upload": "Subir imágenes"
120121
},
121122
"placeholder": {
122-
"primary": "Haz clic para subir imágenes",
123+
"primary": "Haz clic o arrastra para subir imágenes",
123124
"secondary": "Se admite la selección de múltiples imágenes"
124125
},
125126
"progress": {

locales/fa-IR/components.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,12 @@
7070
},
7171
"ImageUpload": {
7272
"actions": {
73-
"changeImage": "برای تغییر تصویر کلیک کنید"
73+
"changeImage": "برای تغییر تصویر کلیک کنید",
74+
"dropMultipleFiles": "بارگذاری چندین فایل به طور همزمان پشتیبانی نمی‌شود، فقط اولین فایل استفاده خواهد شد"
7475
},
7576
"placeholder": {
7677
"primary": "افزودن تصویر",
77-
"secondary": "برای بارگذاری کلیک کنید"
78+
"secondary": "برای آپلود کلیک کنید یا بکشید"
7879
}
7980
},
8081
"KeyValueEditor": {
@@ -109,7 +110,7 @@
109110
},
110111
"MultiImagesUpload": {
111112
"actions": {
112-
"uploadMore": "برای آپلود بیشتر کلیک کنید"
113+
"uploadMore": "برای آپلود بیشتر کلیک کنید یا بکشید"
113114
},
114115
"modal": {
115116
"complete": "تکمیل",
@@ -119,7 +120,7 @@
119120
"upload": "آپلود تصویر"
120121
},
121122
"placeholder": {
122-
"primary": "برای آپلود تصویر کلیک کنید",
123+
"primary": "برای آپلود تصویر کلیک کنید یا بکشید",
123124
"secondary": "انتخاب چندین تصویر پشتیبانی می‌شود"
124125
},
125126
"progress": {

locales/fr-FR/components.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,12 @@
7070
},
7171
"ImageUpload": {
7272
"actions": {
73-
"changeImage": "Cliquez pour changer l'image"
73+
"changeImage": "Cliquez pour changer l'image",
74+
"dropMultipleFiles": "Le téléchargement multiple de fichiers n'est pas pris en charge, seul le premier fichier sera utilisé"
7475
},
7576
"placeholder": {
7677
"primary": "Ajouter une image",
77-
"secondary": "Cliquez pour télécharger"
78+
"secondary": "Cliquez ou faites glisser pour télécharger"
7879
}
7980
},
8081
"KeyValueEditor": {
@@ -109,7 +110,7 @@
109110
},
110111
"MultiImagesUpload": {
111112
"actions": {
112-
"uploadMore": "Cliquez pour télécharger plus"
113+
"uploadMore": "Cliquez ou glissez pour télécharger plus"
113114
},
114115
"modal": {
115116
"complete": "Terminé",
@@ -119,7 +120,7 @@
119120
"upload": "Télécharger des images"
120121
},
121122
"placeholder": {
122-
"primary": "Cliquez pour télécharger des images",
123+
"primary": "Cliquez ou glissez pour télécharger une image",
123124
"secondary": "Prise en charge de la sélection de plusieurs images"
124125
},
125126
"progress": {

locales/it-IT/components.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,12 @@
7070
},
7171
"ImageUpload": {
7272
"actions": {
73-
"changeImage": "Clicca per cambiare immagine"
73+
"changeImage": "Clicca per cambiare immagine",
74+
"dropMultipleFiles": "Non è supportato il caricamento multiplo di file, verrà utilizzato solo il primo file"
7475
},
7576
"placeholder": {
7677
"primary": "Aggiungi immagine",
77-
"secondary": "Clicca per caricare"
78+
"secondary": "Clicca o trascina per caricare"
7879
}
7980
},
8081
"KeyValueEditor": {
@@ -109,7 +110,7 @@
109110
},
110111
"MultiImagesUpload": {
111112
"actions": {
112-
"uploadMore": "Clicca per caricare altre"
113+
"uploadMore": "Clicca o trascina per caricare di più"
113114
},
114115
"modal": {
115116
"complete": "Completa",
@@ -119,7 +120,7 @@
119120
"upload": "Carica immagine"
120121
},
121122
"placeholder": {
122-
"primary": "Clicca per caricare immagini",
123+
"primary": "Clicca o trascina per caricare immagini",
123124
"secondary": "Supporta la selezione di più immagini"
124125
},
125126
"progress": {

0 commit comments

Comments
 (0)