@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.
- package/.github/workflows/auto-i18n.yml +1 -1
- package/.github/workflows/bundle-analyzer.yml +1 -1
- package/.github/workflows/claude-auto-testing.yml +1 -1
- package/.github/workflows/claude-dedupe-issues.yml +1 -1
- package/.github/workflows/claude-issue-triage.yml +1 -1
- package/.github/workflows/claude-translate-comments.yml +1 -1
- package/.github/workflows/claude-translator.yml +1 -1
- package/.github/workflows/claude.yml +1 -1
- package/.github/workflows/desktop-build-electron.yml +2 -2
- package/.github/workflows/e2e.yml +1 -1
- package/.github/workflows/issue-auto-close-duplicates.yml +1 -1
- package/.github/workflows/lighthouse.yml +2 -2
- package/.github/workflows/lock-closed-issues.yml +1 -1
- package/.github/workflows/manual-build-desktop.yml +6 -6
- package/.github/workflows/pr-build-desktop.yml +5 -5
- package/.github/workflows/pr-build-docker.yml +2 -2
- package/.github/workflows/release-desktop-beta.yml +4 -4
- package/.github/workflows/release-docker.yml +2 -2
- package/.github/workflows/release.yml +1 -1
- package/.github/workflows/sync-database-schema.yml +1 -1
- package/.github/workflows/sync.yml +1 -1
- package/.github/workflows/test.yml +5 -5
- package/.github/workflows/verify-desktop-patch.yml +1 -1
- package/CHANGELOG.md +33 -0
- package/changelog/v1.json +9 -0
- package/locales/ar/models.json +35 -4
- package/locales/ar/providers.json +1 -0
- package/locales/bg-BG/models.json +24 -1
- package/locales/bg-BG/providers.json +1 -0
- package/locales/de-DE/models.json +30 -1
- package/locales/de-DE/providers.json +1 -0
- package/locales/en-US/models.json +1 -0
- package/locales/en-US/providers.json +1 -0
- package/locales/es-ES/models.json +32 -1
- package/locales/es-ES/providers.json +1 -0
- package/locales/fa-IR/models.json +48 -1
- package/locales/fa-IR/providers.json +1 -0
- package/locales/fr-FR/models.json +47 -1
- package/locales/fr-FR/providers.json +1 -0
- package/locales/it-IT/models.json +32 -1
- package/locales/it-IT/providers.json +1 -0
- package/locales/ja-JP/models.json +2 -1
- package/locales/ja-JP/providers.json +1 -0
- package/locales/ko-KR/models.json +24 -1
- package/locales/ko-KR/providers.json +1 -0
- package/locales/nl-NL/models.json +46 -1
- package/locales/nl-NL/providers.json +1 -0
- package/locales/pl-PL/models.json +41 -1
- package/locales/pl-PL/providers.json +1 -0
- package/locales/pt-BR/models.json +32 -1
- package/locales/pt-BR/providers.json +1 -0
- package/locales/ru-RU/models.json +54 -2
- package/locales/ru-RU/providers.json +1 -0
- package/locales/tr-TR/models.json +32 -1
- package/locales/tr-TR/providers.json +1 -0
- package/locales/vi-VN/models.json +37 -1
- package/locales/vi-VN/providers.json +1 -0
- package/locales/zh-CN/models.json +24 -3
- package/locales/zh-CN/providers.json +1 -0
- package/locales/zh-TW/models.json +11 -1
- package/locales/zh-TW/providers.json +1 -0
- package/package.json +1 -1
- package/packages/context-engine/src/engine/messages/types.ts +1 -1
- package/packages/model-runtime/src/core/BaseAI.ts +1 -1
- package/packages/model-runtime/src/core/streams/qwen.test.ts +140 -0
- package/packages/model-runtime/src/core/streams/qwen.ts +17 -5
- package/packages/model-runtime/src/types/chat.ts +12 -12
- package/packages/model-runtime/src/types/error.ts +1 -1
- package/packages/model-runtime/src/types/image.ts +1 -1
- package/src/app/[variants]/(main)/chat/features/Conversation/Header/index.tsx +2 -1
- package/src/server/services/comfyui/config/constants.ts +7 -7
- package/src/server/services/comfyui/config/promptToolConst.ts +26 -26
- package/src/server/services/comfyui/utils/promptSplitter.ts +23 -23
- 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
|
|
10
|
-
*
|
|
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
|
-
//
|
|
13
|
+
// Style keywords for CLIP-L to understand visual concepts
|
|
14
14
|
clipLPrompt: string;
|
|
15
|
-
//
|
|
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
|
|
122
|
+
// T5-XXL receives complete context to understand semantic relationships
|
|
123
123
|
t5xxlPrompt: prompt,
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
//
|
|
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
|
|
4
|
+
* FLUX Model Weight Dtype Selection Tool
|
|
5
5
|
*
|
|
6
|
-
* @description
|
|
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 -
|
|
10
|
-
* @returns {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);
|