@lobehub/lobehub 2.0.0-next.212 → 2.0.0-next.213

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 (74) hide show
  1. package/.github/workflows/auto-i18n.yml +1 -1
  2. package/.github/workflows/bundle-analyzer.yml +1 -1
  3. package/.github/workflows/claude-auto-testing.yml +1 -1
  4. package/.github/workflows/claude-dedupe-issues.yml +1 -1
  5. package/.github/workflows/claude-issue-triage.yml +1 -1
  6. package/.github/workflows/claude-translate-comments.yml +1 -1
  7. package/.github/workflows/claude-translator.yml +1 -1
  8. package/.github/workflows/claude.yml +1 -1
  9. package/.github/workflows/desktop-build-electron.yml +2 -2
  10. package/.github/workflows/e2e.yml +1 -1
  11. package/.github/workflows/issue-auto-close-duplicates.yml +1 -1
  12. package/.github/workflows/lighthouse.yml +2 -2
  13. package/.github/workflows/lock-closed-issues.yml +1 -1
  14. package/.github/workflows/manual-build-desktop.yml +6 -6
  15. package/.github/workflows/pr-build-desktop.yml +5 -5
  16. package/.github/workflows/pr-build-docker.yml +2 -2
  17. package/.github/workflows/release-desktop-beta.yml +4 -4
  18. package/.github/workflows/release-docker.yml +2 -2
  19. package/.github/workflows/release.yml +1 -1
  20. package/.github/workflows/sync-database-schema.yml +1 -1
  21. package/.github/workflows/sync.yml +1 -1
  22. package/.github/workflows/test.yml +5 -5
  23. package/.github/workflows/verify-desktop-patch.yml +1 -1
  24. package/CHANGELOG.md +33 -0
  25. package/changelog/v1.json +9 -0
  26. package/locales/ar/models.json +35 -4
  27. package/locales/ar/providers.json +1 -0
  28. package/locales/bg-BG/models.json +24 -1
  29. package/locales/bg-BG/providers.json +1 -0
  30. package/locales/de-DE/models.json +30 -1
  31. package/locales/de-DE/providers.json +1 -0
  32. package/locales/en-US/models.json +1 -0
  33. package/locales/en-US/providers.json +1 -0
  34. package/locales/es-ES/models.json +32 -1
  35. package/locales/es-ES/providers.json +1 -0
  36. package/locales/fa-IR/models.json +48 -1
  37. package/locales/fa-IR/providers.json +1 -0
  38. package/locales/fr-FR/models.json +47 -1
  39. package/locales/fr-FR/providers.json +1 -0
  40. package/locales/it-IT/models.json +32 -1
  41. package/locales/it-IT/providers.json +1 -0
  42. package/locales/ja-JP/models.json +2 -1
  43. package/locales/ja-JP/providers.json +1 -0
  44. package/locales/ko-KR/models.json +24 -1
  45. package/locales/ko-KR/providers.json +1 -0
  46. package/locales/nl-NL/models.json +46 -1
  47. package/locales/nl-NL/providers.json +1 -0
  48. package/locales/pl-PL/models.json +41 -1
  49. package/locales/pl-PL/providers.json +1 -0
  50. package/locales/pt-BR/models.json +32 -1
  51. package/locales/pt-BR/providers.json +1 -0
  52. package/locales/ru-RU/models.json +54 -2
  53. package/locales/ru-RU/providers.json +1 -0
  54. package/locales/tr-TR/models.json +32 -1
  55. package/locales/tr-TR/providers.json +1 -0
  56. package/locales/vi-VN/models.json +37 -1
  57. package/locales/vi-VN/providers.json +1 -0
  58. package/locales/zh-CN/models.json +24 -3
  59. package/locales/zh-CN/providers.json +1 -0
  60. package/locales/zh-TW/models.json +11 -1
  61. package/locales/zh-TW/providers.json +1 -0
  62. package/package.json +1 -1
  63. package/packages/context-engine/src/engine/messages/types.ts +1 -1
  64. package/packages/model-runtime/src/core/BaseAI.ts +1 -1
  65. package/packages/model-runtime/src/core/streams/qwen.test.ts +140 -0
  66. package/packages/model-runtime/src/core/streams/qwen.ts +17 -5
  67. package/packages/model-runtime/src/types/chat.ts +12 -12
  68. package/packages/model-runtime/src/types/error.ts +1 -1
  69. package/packages/model-runtime/src/types/image.ts +1 -1
  70. package/src/app/[variants]/(main)/chat/features/Conversation/Header/index.tsx +2 -1
  71. package/src/server/services/comfyui/config/constants.ts +7 -7
  72. package/src/server/services/comfyui/config/promptToolConst.ts +26 -26
  73. package/src/server/services/comfyui/utils/promptSplitter.ts +23 -23
  74. package/src/server/services/comfyui/utils/weightDType.ts +4 -5
@@ -6,37 +6,37 @@ import {
6
6
  } from '@/server/services/comfyui/config/promptToolConst';
7
7
 
8
8
  /**
9
- * FLUX CLIP提示词智能分割工具
10
- * 将单一prompt分离为T5-XXLCLIP-L的不同输入
9
+ * FLUX dual-CLIP prompt intelligent splitter
10
+ * Separates a single prompt into different inputs for T5-XXL and CLIP-L
11
11
  */
12
12
  export function splitPromptForDualCLIP(prompt: string): {
13
- // 风格关键词,给CLIP-L理解视觉概念
13
+ // Style keywords for CLIP-L to understand visual concepts
14
14
  clipLPrompt: string;
15
- // 完整描述,给T5-XXL理解语义
15
+ // Full description for T5-XXL to understand semantics
16
16
  t5xxlPrompt: string;
17
17
  } {
18
18
  if (!prompt) {
19
19
  return { clipLPrompt: '', t5xxlPrompt: '' };
20
20
  }
21
21
 
22
- // 获取所有风格配置
22
+ // Get all style configurations
23
23
  const styleKeywords = getAllStyleKeywords();
24
24
  const compoundStyles = getCompoundStyles();
25
25
 
26
- // 分离风格关键词
26
+ // Separate style keywords
27
27
  const lowerPrompt = prompt.toLowerCase();
28
28
  const words = prompt.split(/[\s,]+/);
29
29
  const lowerWords = lowerPrompt.split(/[\s,]+/);
30
- const stylePhrases: string[] = []; // 改为存储完整短语
30
+ const stylePhrases: string[] = []; // Changed to store complete phrases
31
31
  const contentWords: string[] = [];
32
32
  const processedIndices = new Set<number>();
33
33
 
34
- // 1. 首先检查组合风格(优先级最高)
34
+ // 1. First check compound styles (highest priority)
35
35
  for (const compound of compoundStyles) {
36
36
  const compoundLower = compound.toLowerCase();
37
37
  const index = lowerPrompt.indexOf(compoundLower);
38
38
  if (index !== -1) {
39
- // 找到组合风格,提取对应的原始短语
39
+ // Found compound style, extract corresponding original phrase
40
40
  const beforeWords = prompt
41
41
  .slice(0, Math.max(0, index))
42
42
  .split(/[\s,]+/)
@@ -56,23 +56,23 @@ export function splitPromptForDualCLIP(prompt: string): {
56
56
  }
57
57
  }
58
58
 
59
- // 2. 检查单个风格关键词和同义词
59
+ // 2. Check individual style keywords and synonyms
60
60
  for (let i = 0; i < words.length; i++) {
61
- if (processedIndices.has(i)) continue; // 跳过已处理的词
61
+ if (processedIndices.has(i)) continue; // Skip already processed words
62
62
 
63
63
  const word = words[i];
64
64
  const lowerWord = lowerWords[i];
65
65
  let isStyleWord = false;
66
66
 
67
- // 2.1 先检查同义词并标准化
67
+ // 2.1 First check synonyms and normalize
68
68
  const normalizedWord = normalizeStyleTerm(lowerWord);
69
69
 
70
- // 2.2 检查是否是风格关键词
70
+ // 2.2 Check if it's a style keyword
71
71
  for (const keyword of styleKeywords) {
72
72
  const keywordWords = keyword.toLowerCase().split(/\s+/);
73
73
 
74
74
  if (keywordWords.length === 1) {
75
- // 单词匹配(包括标准化后的词)
75
+ // Single word matching (including normalized words)
76
76
  if (lowerWord === keywordWords[0] || normalizedWord === keywordWords[0]) {
77
77
  stylePhrases.push(word);
78
78
  processedIndices.add(i);
@@ -80,7 +80,7 @@ export function splitPromptForDualCLIP(prompt: string): {
80
80
  break;
81
81
  }
82
82
  } else if (keywordWords.length > 1 && i + keywordWords.length <= words.length) {
83
- // 多词短语匹配
83
+ // Multi-word phrase matching
84
84
  const sequence = lowerWords.slice(i, i + keywordWords.length).join(' ');
85
85
  if (sequence === keyword.toLowerCase()) {
86
86
  const phraseWords: string[] = [];
@@ -89,14 +89,14 @@ export function splitPromptForDualCLIP(prompt: string): {
89
89
  processedIndices.add(i + j);
90
90
  }
91
91
  stylePhrases.push(phraseWords.join(' '));
92
- i += keywordWords.length - 1; // 跳过已匹配的词
92
+ i += keywordWords.length - 1; // Skip matched words
93
93
  isStyleWord = true;
94
94
  break;
95
95
  }
96
96
  }
97
97
  }
98
98
 
99
- // 2.3 如果不是关键词,检查是否是风格形容词
99
+ // 2.3 If not a keyword, check if it's a style adjective
100
100
  if (!isStyleWord && !processedIndices.has(i)) {
101
101
  const adjectives = extractStyleAdjectives([word]);
102
102
  if (adjectives.length > 0) {
@@ -106,25 +106,25 @@ export function splitPromptForDualCLIP(prompt: string): {
106
106
  }
107
107
  }
108
108
 
109
- // 2.4 记录非风格词
109
+ // 2.4 Record non-style words
110
110
  if (!isStyleWord && !processedIndices.has(i)) {
111
111
  contentWords.push(word);
112
112
  }
113
113
  }
114
114
 
115
- // 构建结果
115
+ // Build result
116
116
  if (stylePhrases.length > 0) {
117
- // 短语级别去重,保持多词短语的完整性
117
+ // Phrase-level deduplication, maintaining integrity of multi-word phrases
118
118
  const uniquePhrases = [...new Set(stylePhrases)];
119
119
  return {
120
- // CLIP-L专注风格和视觉概念
120
+ // CLIP-L focuses on style and visual concepts
121
121
  clipLPrompt: uniquePhrases.join(' '),
122
- // T5-XXL接收完整context以理解语义关系
122
+ // T5-XXL receives complete context to understand semantic relationships
123
123
  t5xxlPrompt: prompt,
124
124
  };
125
125
  }
126
126
 
127
- // 无风格词时的fallback:相同prompt(保证兼容性)
127
+ // Fallback when no style words: same prompt (ensures compatibility)
128
128
  return {
129
129
  clipLPrompt: prompt,
130
130
  t5xxlPrompt: prompt,
@@ -1,13 +1,12 @@
1
1
  import { resolveModel } from './staticModelLookup';
2
2
 
3
3
  /**
4
- * FLUX 模型权重类型选择工具 / FLUX Model Weight Dtype Selection Tool
4
+ * FLUX Model Weight Dtype Selection Tool
5
5
  *
6
- * @description 自动选择模型权重类型:优先使用ModelNameStandardizer推荐值,未知模型返回'default'
7
- * Automatic weight type selection: prioritize ModelNameStandardizer recommendations, return 'default' for unknown models
6
+ * @description Automatic weight type selection: prioritize ModelNameStandardizer recommendations, return 'default' for unknown models
8
7
  *
9
- * @param {string} modelName - 模型文件名或路径 / Model filename or path
10
- * @returns {string} 权重类型字符串 / Weight type string
8
+ * @param {string} modelName - Model filename or path
9
+ * @returns {string} Weight type string
11
10
  */
12
11
  export function selectOptimalWeightDtype(modelName: string): string {
13
12
  const config = resolveModel(modelName);