修复了ComfyUI V2工作流模板参数配置中的关键bug: 🐛 问题描述: - 当数值参数(最小值、最大值、步长、默认值等)设置为0时,由于JavaScript的falsy值特性,使用 || 操作符会导致显示空字符串而不是0 🔧 修复内容: - ✅ 最小值字段:schema.min || '' → schema.min !== undefined ? schema.min : '' - ✅ 最大值字段:schema.max || '' → schema.max !== undefined ? schema.max : '' - ✅ 步长字段:schema.step || '' → schema.step !== undefined ? schema.step : '' - ✅ 默认值字段(数字类型):schema.default || '' → schema.default !== undefined ? schema.default : '' - ✅ 宽度字段:schema.width || '' → schema.width !== undefined ? schema.width : '' - ✅ 高度字段:schema.height || '' → schema.height !== undefined ? schema.height : '' - ✅ 时长字段:schema.duration || '' → schema.duration !== undefined ? schema.duration : '' - ✅ 文件大小字段:schema.maxSize ? Math.round(...) → schema.maxSize !== undefined ? Math.round(...) : '' 💡 技术细节: - 使用 !== undefined 检查而不是 || 操作符,确保0值能正确显示 - 保持字符串字段使用 || '' 的逻辑,因为空字符串是合理的默认值 - 确保所有数值类型字段都能正确处理0值 🎯 影响范围: - 整数类型参数的最小值、最大值、步长配置 - 浮点数类型参数的数值范围设置 - 媒体类型参数的尺寸和大小限制 - 所有数值类型的默认值设置 这个修复确保了用户可以正确设置0作为参数值, 特别重要的是最小值为0的场景(如步长、范围等)。 |
||
|---|---|---|
| .. | ||
| desktop | ||