🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
🌐 chore: translate non-English comments to English in comfyui (#13712)
LobeHub Bot8b5aaeebdf1f
diff --git a/src/server/services/comfyui/__tests__/fixtures/supported.fixture.ts b/src/server/services/comfyui/__tests__/fixtures/supported.fixture.tsindex b6fd4a52e95..9d7ce13f5ed 100644--- a/src/server/services/comfyui/__tests__/fixtures/supported.fixture.ts+++ b/src/server/services/comfyui/__tests__/fixtures/supported.fixture.ts@@ -1,11 +1,11 @@-// 可扩展的支持配置接口+// Extensible support configuration interfaceexport interface SupportedConfig {extensions?: Record<string, any>;models: Record<string, string[]>;workflows: string[];}-// 基础支持配置+// Base support configurationconst baseConfig: SupportedConfig = {extensions: {},models: {@@ -15,12 +15,12 @@ const baseConfig: SupportedConfig = {workflows: ['flux-dev', 'flux-schnell', 'flux-kontext', 'flux-krea', 'simple-sd', 'sd35'],};-// 动态配置合并函数+// Dynamic configuration merge functionfunction mergeConfig(base: SupportedConfig, custom?: Partial<SupportedConfig>): SupportedConfig {if (!custom) return base;return {- // 去重+ // Deduplicateextensions: {...base.extensions,...custom.extensions,@@ -36,10 +36,10 @@ models: {};}-// 可扩展的 fixture 对象+// Extensible fixture objectexport const supportedFixture = {-- // 扩展工具函数++ // Extension utility functionsaddCustomModels: (modelType: string, models: string[]) => {baseConfig.models[modelType] = [...(baseConfig.models[modelType] || []), ...models].filter((model, index, array) => array.indexOf(model) === index,@@ -58,13 +58,13 @@ addCustomWorkflows: (workflows: string[]) => {-// 获取当前配置(支持自定义扩展)+// Get current configuration (supports custom extensions)getConfig: (customConfig?: Partial<SupportedConfig>): SupportedConfig => {return mergeConfig(baseConfig, customConfig);},-// 验证帮助函数+// Validation helper functionsisSupported: (model: string, customConfig?: Partial<SupportedConfig>) => {const config = mergeConfig(baseConfig, customConfig);const allModels = Object.values(config.models).flat();@@ -72,10 +72,10 @@ isSupported: (model: string, customConfig?: Partial<SupportedConfig>) => {},- // 向后兼容的属性(保持现有测试不受影响)+ // Backward-compatible properties (keep existing tests unaffected)models: baseConfig.models,- // 重置为基础配置(用于测试隔离)+ // Reset to base configuration (for test isolation)reset: () => {baseConfig.models = {flux: ['flux-dev', 'flux-schnell', 'flux-kontext', 'flux-krea'],diff --git a/src/server/services/comfyui/__tests__/helpers/mockContext.ts b/src/server/services/comfyui/__tests__/helpers/mockContext.tsindex a00e6c3e294..11ee679e600 100644--- a/src/server/services/comfyui/__tests__/helpers/mockContext.ts+++ b/src/server/services/comfyui/__tests__/helpers/mockContext.ts@@ -8,7 +8,6 @@ import { type WorkflowContext } from '@/server/services/comfyui/core/workflowBui/*** Create a mock WorkflowContext for testing- * 创建测试用的模拟 WorkflowContext*/export function createMockContext(): WorkflowContext {return {@@ -55,9 +54,9 @@ export function createMockContext(): WorkflowContext {validateConnection: vi.fn().mockResolvedValue(undefined),},modelResolverService: {- // 新的服务层方法+ // New service layer methodsgetOptimalComponent: vi.fn().mockImplementation((type: string, modelFamily: string) => {- // 根据不同的组件类型和模型家族返回相应的默认值+ // Return corresponding defaults based on component type and model familyif (type === 't5') {return Promise.resolve(TEST_COMPONENTS.FLUX.T5);}@@ -76,7 +75,7 @@ export function createMockContext(): WorkflowContext {return Promise.resolve(null);}),- // 保留旧方法以兼容+ // Keep legacy methods for compatibilityselectComponents: vi.fn().mockResolvedValue({clip: [TEST_COMPONENTS.FLUX.T5, TEST_COMPONENTS.FLUX.CLIP_L],t5: TEST_COMPONENTS.FLUX.T5,@@ -93,6 +92,5 @@ export function createMockContext(): WorkflowContext {/*** Default mock context instance- * 默认的模拟上下文实例*/export const mockContext = createMockContext();