@lobehub/chat 1.105.1 → 1.105.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/changelog/v1.json +9 -0
  3. package/locales/ar/auth.json +54 -0
  4. package/locales/bg-BG/auth.json +54 -0
  5. package/locales/de-DE/auth.json +54 -0
  6. package/locales/en-US/auth.json +54 -0
  7. package/locales/es-ES/auth.json +54 -0
  8. package/locales/fa-IR/auth.json +54 -0
  9. package/locales/fr-FR/auth.json +54 -0
  10. package/locales/it-IT/auth.json +54 -0
  11. package/locales/ja-JP/auth.json +54 -0
  12. package/locales/ko-KR/auth.json +54 -0
  13. package/locales/nl-NL/auth.json +54 -0
  14. package/locales/pl-PL/auth.json +54 -0
  15. package/locales/pt-BR/auth.json +54 -0
  16. package/locales/ru-RU/auth.json +54 -0
  17. package/locales/tr-TR/auth.json +54 -0
  18. package/locales/vi-VN/auth.json +54 -0
  19. package/locales/zh-CN/auth.json +54 -0
  20. package/locales/zh-TW/auth.json +54 -0
  21. package/package.json +2 -2
  22. package/src/app/(backend)/middleware/auth/index.test.ts +5 -5
  23. package/src/app/(backend)/middleware/auth/index.ts +6 -6
  24. package/src/app/(backend)/webapi/chat/[provider]/route.test.ts +11 -9
  25. package/src/app/(backend)/webapi/plugin/gateway/route.ts +2 -2
  26. package/src/app/sitemap.tsx +1 -10
  27. package/src/config/aiModels/giteeai.ts +269 -2
  28. package/src/config/aiModels/siliconcloud.ts +24 -2
  29. package/src/config/aiModels/stepfun.ts +67 -2
  30. package/src/config/aiModels/volcengine.ts +56 -2
  31. package/src/config/aiModels/wenxin.ts +62 -2
  32. package/src/config/aiModels/xai.ts +19 -2
  33. package/src/const/auth.ts +2 -3
  34. package/src/libs/model-runtime/ModelRuntime.test.ts +3 -3
  35. package/src/libs/trpc/async/context.ts +3 -3
  36. package/src/libs/trpc/edge/context.ts +7 -2
  37. package/src/libs/trpc/edge/middleware/jwtPayload.test.ts +4 -4
  38. package/src/libs/trpc/edge/middleware/jwtPayload.ts +2 -2
  39. package/src/libs/trpc/lambda/context.ts +2 -2
  40. package/src/libs/trpc/lambda/middleware/keyVaults.ts +2 -2
  41. package/src/server/modules/AgentRuntime/index.test.ts +28 -25
  42. package/src/server/modules/AgentRuntime/index.ts +3 -3
  43. package/src/server/routers/async/caller.ts +2 -2
  44. package/src/server/routers/lambda/market/index.ts +0 -14
  45. package/src/server/routers/tools/search.test.ts +2 -2
  46. package/src/server/services/chunk/index.ts +3 -3
  47. package/src/server/services/discover/index.ts +0 -13
  48. package/src/server/sitemap.test.ts +0 -52
  49. package/src/server/sitemap.ts +1 -38
  50. package/src/services/_auth.ts +3 -3
  51. package/src/services/discover.ts +0 -4
  52. package/src/store/discover/slices/mcp/action.ts +0 -8
  53. package/src/utils/client/xor-obfuscation.test.ts +370 -0
  54. package/src/utils/client/xor-obfuscation.ts +39 -0
  55. package/src/utils/server/xor.test.ts +123 -0
  56. package/src/utils/server/xor.ts +42 -0
  57. package/src/utils/jwt.test.ts +0 -27
  58. package/src/utils/jwt.ts +0 -37
  59. package/src/utils/server/jwt.test.ts +0 -62
  60. package/src/utils/server/jwt.ts +0 -28
@@ -2,7 +2,7 @@ import { AuthObject } from '@clerk/backend';
2
2
  import { NextRequest } from 'next/server';
3
3
 
4
4
  import {
5
- JWTPayload,
5
+ ClientSecretPayload,
6
6
  LOBE_CHAT_AUTH_HEADER,
7
7
  LOBE_CHAT_OIDC_AUTH_HEADER,
8
8
  OAUTH_AUTHORIZED,
@@ -13,18 +13,18 @@ import { AgentRuntime, AgentRuntimeError, ChatCompletionErrorPayload } from '@/l
13
13
  import { validateOIDCJWT } from '@/libs/oidc-provider/jwt';
14
14
  import { ChatErrorType } from '@/types/fetch';
15
15
  import { createErrorResponse } from '@/utils/errorResponse';
16
- import { getJWTPayload } from '@/utils/server/jwt';
16
+ import { getXorPayload } from '@/utils/server/xor';
17
17
 
18
18
  import { checkAuthMethod } from './utils';
19
19
 
20
- type CreateRuntime = (jwtPayload: JWTPayload) => AgentRuntime;
20
+ type CreateRuntime = (jwtPayload: ClientSecretPayload) => AgentRuntime;
21
21
  type RequestOptions = { createRuntime?: CreateRuntime; params: Promise<{ provider: string }> };
22
22
 
23
23
  export type RequestHandler = (
24
24
  req: Request,
25
25
  options: RequestOptions & {
26
26
  createRuntime?: CreateRuntime;
27
- jwtPayload: JWTPayload;
27
+ jwtPayload: ClientSecretPayload;
28
28
  },
29
29
  ) => Promise<Response>;
30
30
 
@@ -36,7 +36,7 @@ export const checkAuth =
36
36
  return handler(req, { ...options, jwtPayload: { userId: 'DEV_USER' } });
37
37
  }
38
38
 
39
- let jwtPayload: JWTPayload;
39
+ let jwtPayload: ClientSecretPayload;
40
40
 
41
41
  try {
42
42
  // get Authorization from header
@@ -55,7 +55,7 @@ export const checkAuth =
55
55
  clerkAuth = data.clerkAuth;
56
56
  }
57
57
 
58
- jwtPayload = await getJWTPayload(authorization);
58
+ jwtPayload = getXorPayload(authorization);
59
59
 
60
60
  const oidcAuthorization = req.headers.get(LOBE_CHAT_OIDC_AUTH_HEADER);
61
61
  let isUseOidcAuth = false;
@@ -6,7 +6,7 @@ import { checkAuthMethod } from '@/app/(backend)/middleware/auth/utils';
6
6
  import { LOBE_CHAT_AUTH_HEADER, OAUTH_AUTHORIZED } from '@/const/auth';
7
7
  import { AgentRuntime, LobeRuntimeAI } from '@/libs/model-runtime';
8
8
  import { ChatErrorType } from '@/types/fetch';
9
- import { getJWTPayload } from '@/utils/server/jwt';
9
+ import { getXorPayload } from '@/utils/server/xor';
10
10
 
11
11
  import { POST } from './route';
12
12
 
@@ -18,8 +18,8 @@ vi.mock('@/app/(backend)/middleware/auth/utils', () => ({
18
18
  checkAuthMethod: vi.fn(),
19
19
  }));
20
20
 
21
- vi.mock('@/utils/server/jwt', () => ({
22
- getJWTPayload: vi.fn(),
21
+ vi.mock('@/utils/server/xor', () => ({
22
+ getXorPayload: vi.fn(),
23
23
  }));
24
24
 
25
25
  // 定义一个变量来存储 enableAuth 的值
@@ -61,7 +61,7 @@ describe('POST handler', () => {
61
61
  const mockParams = Promise.resolve({ provider: 'test-provider' });
62
62
 
63
63
  // 设置 getJWTPayload 和 initAgentRuntimeWithUserPayload 的模拟返回值
64
- vi.mocked(getJWTPayload).mockResolvedValueOnce({
64
+ vi.mocked(getXorPayload).mockReturnValueOnce({
65
65
  accessCode: 'test-access-code',
66
66
  apiKey: 'test-api-key',
67
67
  azureApiVersion: 'v1',
@@ -78,7 +78,7 @@ describe('POST handler', () => {
78
78
  await POST(request as unknown as Request, { params: mockParams });
79
79
 
80
80
  // 验证是否正确调用了模拟函数
81
- expect(getJWTPayload).toHaveBeenCalledWith('Bearer some-valid-token');
81
+ expect(getXorPayload).toHaveBeenCalledWith('Bearer some-valid-token');
82
82
  expect(spy).toHaveBeenCalledWith('test-provider', expect.anything());
83
83
  });
84
84
 
@@ -104,7 +104,7 @@ describe('POST handler', () => {
104
104
  it('should have pass clerk Auth when enable clerk', async () => {
105
105
  enableClerk = true;
106
106
 
107
- vi.mocked(getJWTPayload).mockResolvedValueOnce({
107
+ vi.mocked(getXorPayload).mockReturnValueOnce({
108
108
  accessCode: 'test-access-code',
109
109
  apiKey: 'test-api-key',
110
110
  azureApiVersion: 'v1',
@@ -142,7 +142,9 @@ describe('POST handler', () => {
142
142
 
143
143
  it('should return InternalServerError error when throw a unknown error', async () => {
144
144
  const mockParams = Promise.resolve({ provider: 'test-provider' });
145
- vi.mocked(getJWTPayload).mockRejectedValueOnce(new Error('unknown error'));
145
+ vi.mocked(getXorPayload).mockImplementationOnce(() => {
146
+ throw new Error('unknown error');
147
+ });
146
148
 
147
149
  const response = await POST(request, { params: mockParams });
148
150
 
@@ -159,7 +161,7 @@ describe('POST handler', () => {
159
161
 
160
162
  describe('chat', () => {
161
163
  it('should correctly handle chat completion with valid payload', async () => {
162
- vi.mocked(getJWTPayload).mockResolvedValueOnce({
164
+ vi.mocked(getXorPayload).mockReturnValueOnce({
163
165
  accessCode: 'test-access-code',
164
166
  apiKey: 'test-api-key',
165
167
  azureApiVersion: 'v1',
@@ -189,7 +191,7 @@ describe('POST handler', () => {
189
191
 
190
192
  it('should return an error response when chat completion fails', async () => {
191
193
  // 设置 getJWTPayload 和 initAgentRuntimeWithUserPayload 的模拟返回值
192
- vi.mocked(getJWTPayload).mockResolvedValueOnce({
194
+ vi.mocked(getXorPayload).mockReturnValueOnce({
193
195
  accessCode: 'test-access-code',
194
196
  apiKey: 'test-api-key',
195
197
  azureApiVersion: 'v1',
@@ -8,7 +8,7 @@ import { AgentRuntimeError } from '@/libs/model-runtime';
8
8
  import { TraceClient } from '@/libs/traces';
9
9
  import { ChatErrorType, ErrorType } from '@/types/fetch';
10
10
  import { createErrorResponse } from '@/utils/errorResponse';
11
- import { getJWTPayload } from '@/utils/server/jwt';
11
+ import { getXorPayload } from '@/utils/server/xor';
12
12
  import { getTracePayload } from '@/utils/trace';
13
13
 
14
14
  import { parserPluginSettings } from './settings';
@@ -44,7 +44,7 @@ export const POST = async (req: Request) => {
44
44
  if (!authorization) throw AgentRuntimeError.createError(ChatErrorType.Unauthorized);
45
45
 
46
46
  const oauthAuthorized = !!req.headers.get(OAUTH_AUTHORIZED);
47
- const payload = await getJWTPayload(authorization);
47
+ const payload = getXorPayload(authorization);
48
48
 
49
49
  const result = checkAuth(payload.accessCode!, oauthAuthorized);
50
50
 
@@ -17,10 +17,9 @@ export async function generateSitemaps() {
17
17
  const staticSitemaps = sitemapModule.sitemapIndexs;
18
18
 
19
19
  // 获取需要分页的类型的页数
20
- const [pluginPages, assistantPages, mcpPages, modelPages] = await Promise.all([
20
+ const [pluginPages, assistantPages, modelPages] = await Promise.all([
21
21
  sitemapModule.getPluginPageCount(),
22
22
  sitemapModule.getAssistantPageCount(),
23
- sitemapModule.getMcpPageCount(),
24
23
  sitemapModule.getModelPageCount(),
25
24
  ]);
26
25
 
@@ -30,7 +29,6 @@ export async function generateSitemaps() {
30
29
  ...Array.from({ length: assistantPages }, (_, i) => ({
31
30
  id: `assistants-${i + 1}` as SitemapType,
32
31
  })),
33
- ...Array.from({ length: mcpPages }, (_, i) => ({ id: `mcp-${i + 1}` as SitemapType })),
34
32
  ...Array.from({ length: modelPages }, (_, i) => ({ id: `models-${i + 1}` as SitemapType })),
35
33
  ];
36
34
 
@@ -60,9 +58,6 @@ export default async function sitemap({ id }: { id: string }): Promise<MetadataR
60
58
  case SitemapType.Assistants: {
61
59
  return sitemapModule.getAssistants(page);
62
60
  }
63
- case SitemapType.Mcp: {
64
- return sitemapModule.getMcp(page);
65
- }
66
61
  case SitemapType.Plugins: {
67
62
  return sitemapModule.getPlugins(page);
68
63
  }
@@ -82,10 +77,6 @@ export default async function sitemap({ id }: { id: string }): Promise<MetadataR
82
77
  const pageNum = parseInt(id.split('-')[1], 10);
83
78
  return sitemapModule.getAssistants(pageNum);
84
79
  }
85
- if (id.startsWith('mcp-')) {
86
- const pageNum = parseInt(id.split('-')[1], 10);
87
- return sitemapModule.getMcp(pageNum);
88
- }
89
80
  if (id.startsWith('models-')) {
90
81
  const pageNum = parseInt(id.split('-')[1], 10);
91
82
  return sitemapModule.getModels(pageNum);
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard, AIImageModelCard } from '@/types/aiModel';
2
2
 
3
3
  const giteeaiChatModels: AIChatModelCard[] = [
4
4
  {
@@ -222,6 +222,273 @@ const giteeaiChatModels: AIChatModelCard[] = [
222
222
  },
223
223
  ];
224
224
 
225
- export const allModels = [...giteeaiChatModels];
225
+ const giteeaiImageModels: AIImageModelCard[] = [
226
+ {
227
+ description:
228
+ 'FLUX.1-dev 是由 Black Forest Labs 开发的一款开源 多模态语言模型(Multimodal Language Model, MLLM),专为图文任务优化,融合了图像和文本的理解与生成能力。它建立在先进的大语言模型(如 Mistral-7B)基础上,通过精心设计的视觉编码器与多阶段指令微调,实现了图文协同处理与复杂任务推理的能力。',
229
+ displayName: 'FLUX.1-dev',
230
+ enabled: true,
231
+ id: 'FLUX.1-dev',
232
+ parameters: {
233
+ imageUrl: { default: null },
234
+ prompt: {
235
+ default: '',
236
+ },
237
+ size: {
238
+ default: '1024x1024',
239
+ enum: ['1024x1024', '1536x1536'],
240
+ },
241
+ },
242
+ type: 'image',
243
+ },
244
+ {
245
+ description:
246
+ '由 Black Forest Labs 开发的 120 亿参数文生图模型,采用潜在对抗扩散蒸馏技术,能够在 1 到 4 步内生成高质量图像。该模型性能媲美闭源替代品,并在 Apache-2.0 许可证下发布,适用于个人、科研和商业用途。',
247
+ displayName: 'flux-1-schnell',
248
+ enabled: true,
249
+ id: 'flux-1-schnell',
250
+ parameters: {
251
+ prompt: {
252
+ default: '',
253
+ },
254
+ size: {
255
+ default: '1024x1024',
256
+ enum: ['1024x1024', '1536x1536', '2048x2048'],
257
+ },
258
+ },
259
+ type: 'image',
260
+ },
261
+ {
262
+ description:
263
+ 'FLUX.1-Kontext-dev 是由 Black Forest Labs 开发的一款基于 Rectified Flow Transformer 架构 的多模态图像生成与编辑模型,拥有 12B(120 亿)参数规模,专注于在给定上下文条件下生成、重构、增强或编辑图像。该模型结合了扩散模型的可控生成优势与 Transformer 的上下文建模能力,支持高质量图像输出,广泛适用于图像修复、图像补全、视觉场景重构等任务。',
264
+ displayName: 'FLUX.1-Kontext-dev',
265
+ enabled: true,
266
+ id: 'FLUX.1-Kontext-dev',
267
+ parameters: {
268
+ imageUrl: { default: null },
269
+ prompt: {
270
+ default: '',
271
+ },
272
+ size: {
273
+ default: '1024x1024',
274
+ enum: ['1024x1024', '1536x1536', '2048x2048'],
275
+ },
276
+ },
277
+ type: 'image',
278
+ },
279
+ {
280
+ description:
281
+ 'Stable Diffusion 3.5 Large Turbo 专注于高质量图像生成,具备强大的细节表现力和场景还原能力。',
282
+ displayName: 'stable-diffusion-3.5-large-turbo',
283
+ enabled: true,
284
+ id: 'stable-diffusion-3.5-large-turbo',
285
+ parameters: {
286
+ prompt: {
287
+ default: '',
288
+ },
289
+ size: {
290
+ default: '1024x1024',
291
+ enum: ['1024x1024'],
292
+ },
293
+ },
294
+ type: 'image',
295
+ },
296
+ {
297
+ description:
298
+ '由 Stability AI 推出的最新文生图大模型。这一版本在继承了前代的优点上,对图像质量、文本理解和风格多样性等方面进行了显著改进,能够更准确地解读复杂的自然语言提示,并生成更为精确和多样化的图像。',
299
+ displayName: 'stable-diffusion-3-medium',
300
+ enabled: true,
301
+ id: 'stable-diffusion-3-medium',
302
+ parameters: {
303
+ prompt: {
304
+ default: '',
305
+ },
306
+ size: {
307
+ default: '1024x1024',
308
+ enum: ['1024x1024'],
309
+ },
310
+ },
311
+ type: 'image',
312
+ },
313
+ {
314
+ description:
315
+ '由 Stability AI 开发并开源的文生图大模型,其创意图像生成能力位居行业前列。具备出色的指令理解能力,能够支持反向 Prompt 定义来精确生成内容。',
316
+ displayName: 'stable-diffusion-xl-base-1.0',
317
+ enabled: true,
318
+ id: 'stable-diffusion-xl-base-1.0',
319
+ parameters: {
320
+ prompt: {
321
+ default: '',
322
+ },
323
+ size: {
324
+ default: '1024x1024',
325
+ enum: ['1024x1024'],
326
+ },
327
+ },
328
+ type: 'image',
329
+ },
330
+ {
331
+ description:
332
+ 'Kolors 是由快手 Kolors 团队开发的文生图模型。由数十亿的参数训练,在视觉质量、中文语义理解和文本渲染方面有显著优势。',
333
+ displayName: 'Kolors',
334
+ enabled: true,
335
+ id: 'Kolors',
336
+ parameters: {
337
+ imageUrl: { default: null },
338
+ prompt: {
339
+ default: '',
340
+ },
341
+ size: {
342
+ default: '1024x1024',
343
+ enum: ['1024x1024'],
344
+ },
345
+ },
346
+ type: 'image',
347
+ },
348
+ {
349
+ description:
350
+ 'hunyuandit-v1.2-distilled 是一款轻量级的文生图模型,经过蒸馏优化,能够快速生成高质量的图像,特别适用于低资源环境和实时生成任务。',
351
+ displayName: 'HunyuanDiT-v1.2-Diffusers-Distilled',
352
+ enabled: true,
353
+ id: 'HunyuanDiT-v1.2-Diffusers-Distilled',
354
+ parameters: {
355
+ prompt: {
356
+ default: '',
357
+ },
358
+ size: {
359
+ default: '1024x1024',
360
+ enum: ['1024x1024'],
361
+ },
362
+ },
363
+ type: 'image',
364
+ },
365
+ {
366
+ description:
367
+ 'HiDream-I1 是一个全新的开源图像生成基础模型,是由国内企业智象未来开源的。拥有 170 亿参数(Flux是12B参数),能够在几秒内实现行业领先的图像生成质量。',
368
+ displayName: 'HiDream-I1-Full',
369
+ enabled: true,
370
+ id: 'HiDream-I1-Full',
371
+ parameters: {
372
+ prompt: {
373
+ default: '',
374
+ },
375
+ size: {
376
+ default: '1024x1024',
377
+ enum: ['1024x1024'],
378
+ },
379
+ },
380
+ type: 'image',
381
+ },
382
+ {
383
+ description:
384
+ 'HiDream-E1-Full 是由智象未来(HiDream.ai)推出的一款 开源多模态图像编辑大模型,基于先进的 Diffusion Transformer 架构,并结合强大的语言理解能力(内嵌 LLaMA 3.1-8B-Instruct),支持通过自然语言指令进行图像生成、风格迁移、局部编辑和内容重绘,具备出色的图文理解与执行能力。',
385
+ displayName: 'HiDream-E1-Full',
386
+ enabled: true,
387
+ id: 'HiDream-I1-Full',
388
+ parameters: {
389
+ imageUrl: { default: null },
390
+ prompt: {
391
+ default: '',
392
+ },
393
+ size: {
394
+ default: '1024x1024',
395
+ enum: ['1024x1024'],
396
+ },
397
+ },
398
+ type: 'image',
399
+ },
400
+ {
401
+ description:
402
+ 'HelloMeme 是一个可以根据你提供的图片或动作,自动生成表情包、动图或短视频的 AI 工具。它不需要你有任何绘画或编程基础,只需要准备好参考图片,它就能帮你做出好看、有趣、风格一致的内容。',
403
+ displayName: 'HelloMeme',
404
+ enabled: true,
405
+ id: 'HelloMeme',
406
+ parameters: {
407
+ imageUrl: { default: null },
408
+ prompt: {
409
+ default: '',
410
+ },
411
+ size: {
412
+ default: '1024x1024',
413
+ enum: ['1024x1024'],
414
+ },
415
+ },
416
+ type: 'image',
417
+ },
418
+ {
419
+ description:
420
+ 'OmniConsistency 通过引入大规模 Diffusion Transformers(DiTs)和配对风格化数据,提升图像到图像(Image-to-Image)任务中的风格一致性和泛化能力,避免风格退化。',
421
+ displayName: 'OmniConsistency',
422
+ enabled: true,
423
+ id: 'OmniConsistency',
424
+ parameters: {
425
+ imageUrl: { default: null },
426
+ prompt: {
427
+ default: '',
428
+ },
429
+ size: {
430
+ default: '1024x1024',
431
+ enum: ['1024x1024'],
432
+ },
433
+ },
434
+ type: 'image',
435
+ },
436
+ {
437
+ description:
438
+ 'InstantCharacter 是由腾讯 AI 团队在 2025 年发布的一款 无需微调(tuning-free) 的个性化角色生成模型,旨在实现高保真、跨场景的一致角色生成。该模型支持仅基于 一张参考图像 对角色进行建模,并能够将该角色灵活迁移到各种风格、动作和背景中。',
439
+ displayName: 'InstantCharacter',
440
+ enabled: true,
441
+ id: 'InstantCharacter',
442
+ parameters: {
443
+ imageUrl: { default: null },
444
+ prompt: {
445
+ default: '',
446
+ },
447
+ size: {
448
+ default: '1024x1024',
449
+ enum: ['1024x1024'],
450
+ },
451
+ },
452
+ type: 'image',
453
+ },
454
+ {
455
+ description:
456
+ 'DreamO 是由字节跳动与北京大学联合研发的开源图像定制生成模型,旨在通过统一架构支持多任务图像生成。它采用高效的组合建模方法,可根据用户指定的身份、主体、风格、背景等多个条件生成高度一致且定制化的图像。',
457
+ displayName: 'DreamO',
458
+ enabled: true,
459
+ id: 'DreamO',
460
+ parameters: {
461
+ imageUrl: { default: null },
462
+ prompt: {
463
+ default: '',
464
+ },
465
+ size: {
466
+ default: '1024x1024',
467
+ enum: ['1024x1024'],
468
+ },
469
+ },
470
+ type: 'image',
471
+ },
472
+ {
473
+ description:
474
+ 'AnimeSharp(又名 “4x‑AnimeSharp”) 是 Kim2091 基于 ESRGAN 架构开发的开源超分辨率模型,专注于动漫风格图像的放大与锐化。它于 2022 年 2 月重命名自 “4x-TextSharpV1”,原本也适用于文字图像但性能针对动漫内容进行了大幅优化',
475
+ displayName: 'AnimeSharp',
476
+ enabled: true,
477
+ id: 'AnimeSharp',
478
+ parameters: {
479
+ imageUrl: { default: null },
480
+ prompt: {
481
+ default: '',
482
+ },
483
+ size: {
484
+ default: '1024x1024',
485
+ enum: ['1024x1024'],
486
+ },
487
+ },
488
+ type: 'image',
489
+ },
490
+ ];
491
+
492
+ export const allModels = [...giteeaiChatModels, ...giteeaiImageModels];
226
493
 
227
494
  export default allModels;
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard, AIImageModelCard } from '@/types/aiModel';
2
2
 
3
3
  // https://siliconflow.cn/zh-cn/models
4
4
  const siliconcloudChatModels: AIChatModelCard[] = [
@@ -830,6 +830,28 @@ const siliconcloudChatModels: AIChatModelCard[] = [
830
830
  },
831
831
  ];
832
832
 
833
- export const allModels = [...siliconcloudChatModels];
833
+ const siliconcloudImageModels: AIImageModelCard[] = [
834
+ {
835
+ description:
836
+ 'Kolors 是由快手 Kolors 团队开发的基于潜在扩散的大规模文本到图像生成模型。该模型通过数十亿文本-图像对的训练,在视觉质量、复杂语义准确性以及中英文字符渲染方面展现出显著优势。它不仅支持中英文输入,在理解和生成中文特定内容方面也表现出色',
837
+ displayName: 'Kolors',
838
+ enabled: true,
839
+ id: 'Kwai-Kolors/Kolors',
840
+ parameters: {
841
+ prompt: {
842
+ default: '',
843
+ },
844
+ seed: { default: null },
845
+ size: {
846
+ default: '1024x1024',
847
+ enum: ['1024x1024', '960x1280', '768x1024', '720x1440', '720x1280'],
848
+ },
849
+ },
850
+ releasedAt: '2024-07-06',
851
+ type: 'image',
852
+ },
853
+ ];
854
+
855
+ export const allModels = [...siliconcloudChatModels, ...siliconcloudImageModels];
834
856
 
835
857
  export default allModels;
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard, AIImageModelCard } from '@/types/aiModel';
2
2
 
3
3
  // https://platform.stepfun.com/docs/pricing/details
4
4
 
@@ -275,6 +275,71 @@ const stepfunChatModels: AIChatModelCard[] = [
275
275
  },
276
276
  ];
277
277
 
278
- export const allModels = [...stepfunChatModels];
278
+ const stepfunImageModels: AIImageModelCard[] = [
279
+ // https://platform.stepfun.com/docs/llm/image
280
+ {
281
+ description:
282
+ '阶跃星辰新一代生图模型,该模型专注于图像生成任务,能够根据用户提供的文本描述,生成高质量的图像。新模型生成图片质感更真实,中英文文字生成能力更强。',
283
+ displayName: 'Step 2X Large',
284
+ enabled: true,
285
+ id: 'step-2x-large',
286
+ parameters: {
287
+ prompt: {
288
+ default: '',
289
+ },
290
+ seed: { default: null },
291
+ size: {
292
+ default: '1024x1024',
293
+ enum: ['256x256', '512x512', '768x768', '1024x1024', '1280x800', '800x1280'],
294
+ },
295
+ steps: { default: 50, max: 100, min: 1 },
296
+ },
297
+ releasedAt: '2024-08-07',
298
+ type: 'image',
299
+ },
300
+ {
301
+ description:
302
+ '该模型拥有强大的图像生成能力,支持文本描述作为输入方式。具备原生的中文支持,能够更好的理解和处理中文文本描述,并且能够更准确地捕捉文本描述中的语义信息,并将其转化为图像特征,从而实现更精准的图像生成。模型能够根据输入生成高分辨率、高质量的图像,并具备一定的风格迁移能力。',
303
+ displayName: 'Step 1X Medium',
304
+ enabled: true,
305
+ id: 'step-1x-medium',
306
+ parameters: {
307
+ prompt: {
308
+ default: '',
309
+ },
310
+ seed: { default: null },
311
+ size: {
312
+ default: '1024x1024',
313
+ enum: ['256x256', '512x512', '768x768', '1024x1024', '1280x800', '800x1280'],
314
+ },
315
+ steps: { default: 50, max: 100, min: 1 },
316
+ },
317
+ releasedAt: '2025-07-15',
318
+ type: 'image',
319
+ },
320
+ {
321
+ description:
322
+ '该模型专注于图像编辑任务,能够根据用户提供的图片和文本描述,对图片进行修改和增强。支持多种输入格式,包括文本描述和示例图像。模型能够理解用户的意图,并生成符合要求的图像编辑结果。',
323
+ displayName: 'Step 1X Edit',
324
+ enabled: true,
325
+ id: 'step-1x-edit',
326
+ parameters: {
327
+ imageUrl: { default: null },
328
+ prompt: {
329
+ default: '',
330
+ },
331
+ seed: { default: null },
332
+ size: {
333
+ default: '1024x1024',
334
+ enum: ['512x512', '768x768', '1024x1024'],
335
+ },
336
+ steps: { default: 28, max: 100, min: 1 },
337
+ },
338
+ releasedAt: '2025-03-04',
339
+ type: 'image',
340
+ },
341
+ ];
342
+
343
+ export const allModels = [...stepfunChatModels, ...stepfunImageModels];
279
344
 
280
345
  export default allModels;
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard, AIImageModelCard } from '@/types/aiModel';
2
2
 
3
3
  // modelInfo https://www.volcengine.com/docs/82379/1330310
4
4
  // pricing https://console.volcengine.com/ark/region:ark+cn-beijing/openManagement
@@ -509,6 +509,60 @@ const doubaoChatModels: AIChatModelCard[] = [
509
509
  },
510
510
  ];
511
511
 
512
- export const allModels = [...doubaoChatModels];
512
+ const volcengineImageModels: AIImageModelCard[] = [
513
+ {
514
+ /*
515
+ // TODO: AIImageModelCard 不支持 config.deploymentName
516
+ config: {
517
+ deploymentName: 'doubao-seedream-3-0-t2i-250415',
518
+ },
519
+ */
520
+ description:
521
+ 'Doubao图片生成模型由字节跳动 Seed 团队研发,支持文字与图片输入,提供高可控、高质量的图片生成体验。基于文本提示词生成图片。',
522
+ displayName: 'Doubao Seedream 3.0 t2i',
523
+ enabled: true,
524
+ id: 'doubao-seedream-3-0-t2i-250415',
525
+ parameters: {
526
+ prompt: {
527
+ default: '',
528
+ },
529
+ seed: { default: null },
530
+ size: {
531
+ default: '1024x1024',
532
+ enum: ['1024x1024', '864x1152', '1152x864', '1280x720', '720x1280', '832x1248', '1248x832', '1512x648'],
533
+ },
534
+ },
535
+ releasedAt: '2025-04-15',
536
+ type: 'image',
537
+ },
538
+ /*
539
+ // Note: Doubao 图生图模型与文生图模型公用一个 Endpoint,当前如果存在 imageUrl 会切换至 edit endpoint 下
540
+ {
541
+ config: {
542
+ deploymentName: 'doubao-seededit-3-0-i2i-250628',
543
+ },
544
+ description:
545
+ 'Doubao图片生成模型由字节跳动 Seed 团队研发,支持文字与图片输入,提供高可控、高质量的图片生成体验。支持通过文本指令编辑图像,生成图像的边长在512~1536之间。',
546
+ displayName: 'Doubao SeedEdit 3.0 i2i',
547
+ enabled: true,
548
+ id: 'doubao-seededit-3-0-i2i-250628',
549
+ parameters: {
550
+ imageUrl: { default: null },
551
+ prompt: {
552
+ default: '',
553
+ },
554
+ seed: { default: null },
555
+ size: {
556
+ default: '1024x1024',
557
+ enum: ['1024x1024', '864x1152', '1152x864', '1280x720', '720x1280', '832x1248', '1248x832', '1512x648'],
558
+ },
559
+ },
560
+ releasedAt: '2025-06-28',
561
+ type: 'image',
562
+ },
563
+ */
564
+ ];
565
+
566
+ export const allModels = [...doubaoChatModels, ...volcengineImageModels];
513
567
 
514
568
  export default allModels;