diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..2f012d7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,50 @@ +--- +name: 🐛 Bug 报告 +about: 创建一个bug报告以帮助我们改进 +title: '[BUG] ' +labels: ['bug', 'needs-triage'] +assignees: ['whmc76'] +--- + +## 🐛 Bug 描述 + + +## 🔄 重现步骤 + +1. 打开 ComfyUI +2. 添加节点 '...' +3. 设置参数 '...' +4. 运行工作流 +5. 看到错误 + +## ✅ 期望行为 + + +## ❌ 实际行为 + + +## 📸 截图 + + +## 💻 环境信息 +- **操作系统**: [例如 Windows 10, macOS 12.0, Ubuntu 20.04] +- **Python 版本**: [例如 3.8.10] +- **ComfyUI 版本**: [例如 v1.0.0] +- **UniversalToolkit 版本**: [例如 v1.1.9] +- **GPU**: [例如 NVIDIA RTX 3080, AMD RX 6800, CPU only] + +## 📋 错误日志 + +``` +错误信息在这里 +``` + +## 🔧 额外信息 + + +## 📝 检查清单 +- [ ] 我已经搜索了现有的issues +- [ ] 我已经尝试了最新的版本 +- [ ] 我提供了完整的环境信息 +- [ ] 我包含了重现步骤 +- [ ] 我添加了相关的截图或日志 \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..b5b3e0e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,38 @@ +--- +name: 💡 功能请求 +about: 为这个项目提出一个想法 +title: '[FEATURE] ' +labels: ['enhancement', 'needs-triage'] +assignees: ['whmc76'] +--- + +## 💡 功能描述 + + +## 🎯 问题陈述 + + +## 💭 建议的解决方案 + + +## 🔄 替代方案 + + +## 📸 示例 + + +## 🎨 使用场景 + + +## 🔧 技术考虑 + + +## 📝 检查清单 +- [ ] 我已经搜索了现有的issues +- [ ] 我已经检查了文档 +- [ ] 我提供了清晰的功能描述 +- [ ] 我解释了使用场景 +- [ ] 我考虑了技术可行性 + +## 🔗 相关链接 + \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..80d37d9 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,44 @@ +## 📝 描述 + + +## 🎯 类型 + + +- [ ] 🐛 Bug修复 +- [ ] 💡 新功能 +- [ ] 📚 文档更新 +- [ ] 🔧 代码重构 +- [ ] ⚡ 性能改进 +- [ ] 🧪 测试 +- [ ] 🔧 构建/CI改进 + +## 🔄 相关Issue + +Closes #(issue number) + +## 📋 检查清单 + + +- [ ] 我已经阅读并遵循了项目的贡献指南 +- [ ] 我的代码遵循了项目的代码风格 +- [ ] 我已经进行了自我审查 +- [ ] 我已经注释了我的代码,特别是在难以理解的地方 +- [ ] 我已经进行了相应的更改到文档 +- [ ] 我的更改不会产生新的警告 +- [ ] 我已经添加了测试来证明我的修复是有效的或我的功能工作正常 +- [ ] 新的和现有的单元测试通过我的更改 +- [ ] 任何依赖的更改都已记录在requirements.txt中 + +## 🧪 测试 + + +## 📸 截图 + + +## 🔧 环境信息 +- **操作系统**: [例如 Windows 10, macOS 12.0, Ubuntu 20.04] +- **Python 版本**: [例如 3.8.10] +- **ComfyUI 版本**: [例如 v1.0.0] + +## 📝 额外说明 + \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e668e74 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,175 @@ +name: CI - Code Quality & Testing + +on: + push: + branches: [ main, master, develop ] + pull_request: + branches: [ main, master ] + +permissions: + contents: read + issues: write + pull-requests: write + +jobs: + code-quality: + name: Code Quality Check + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + submodules: true + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install flake8 black isort mypy + + - name: Check code formatting with Black + run: | + black --check --diff . + + - name: Check import sorting with isort + run: | + isort --check-only --diff . + + - name: Lint with flake8 + run: | + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics + + - name: Type checking with mypy + run: | + mypy --ignore-missing-imports nodes/ + + test-nodes: + name: Test Node Import & Functionality + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.8', '3.9', '3.10', '3.11'] + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + submodules: true + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install pytest pytest-cov + + - name: Test node imports + run: | + python test_nodes.py + echo "✅ All nodes imported successfully on Python ${{ matrix.python-version }}" + + - name: Run basic functionality tests + run: | + python -c " + import sys + sys.path.append('.') + from __init__ import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS + print(f'✅ Found {len(NODE_CLASS_MAPPINGS)} nodes') + print(f'✅ Found {len(NODE_DISPLAY_NAME_MAPPINGS)} display names') + for node_name, node_class in NODE_CLASS_MAPPINGS.items(): + print(f' - {node_name}: {node_class.__name__}') + " + + security-check: + name: Security Check + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + submodules: true + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install security tools + run: | + python -m pip install --upgrade pip + pip install bandit safety + + - name: Run security scan with bandit + run: | + bandit -r . -f json -o bandit-report.json || true + bandit -r . -f txt -o bandit-report.txt || true + + - name: Check dependencies for known vulnerabilities + run: | + safety check --json --output safety-report.json || true + safety check --text --output safety-report.txt || true + + documentation-check: + name: Documentation Check + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + submodules: true + + - name: Check README formatting + run: | + if [ -f README.md ]; then + echo "✅ README.md exists" + # Check for broken links (basic check) + grep -o 'https://[^)]*' README.md | head -5 + else + echo "❌ README.md missing" + exit 1 + fi + + - name: Check pyproject.toml + run: | + if [ -f pyproject.toml ]; then + echo "✅ pyproject.toml exists" + # Validate basic structure + grep -q '^\[project\]' pyproject.toml || exit 1 + grep -q '^version = ' pyproject.toml || exit 1 + echo "✅ pyproject.toml structure valid" + else + echo "❌ pyproject.toml missing" + exit 1 + fi + + - name: Check version consistency + run: | + PYPROJECT_VERSION=$(grep '^version = ' pyproject.toml | cut -d'"' -f2) + INIT_VERSION=$(grep '__version__ = ' __init__.py | cut -d'"' -f2) + if [ "$PYPROJECT_VERSION" = "$INIT_VERSION" ]; then + echo "✅ Version consistency: $PYPROJECT_VERSION" + else + echo "❌ Version mismatch: pyproject.toml ($PYPROJECT_VERSION) != __init__.py ($INIT_VERSION)" + exit 1 + fi + + notify: + name: Notify on Failure + runs-on: ubuntu-latest + needs: [code-quality, test-nodes, security-check, documentation-check] + if: failure() + steps: + - name: Notify on failure + run: | + echo "❌ One or more CI checks failed" + echo "Please check the workflow run for details:" + echo "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c22ff31..ed75cb8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,5 @@ -name: Publish to Comfy registry +name: Publish to Comfy Registry + on: workflow_dispatch: push: @@ -13,7 +14,7 @@ permissions: jobs: publish-node: - name: Publish Custom Node to registry + name: Publish Custom Node to Registry runs-on: ubuntu-latest if: ${{ github.repository_owner == 'whmc76' }} steps: @@ -21,8 +22,8 @@ jobs: uses: actions/checkout@v4 with: submodules: true + - name: Publish Custom Node uses: Comfy-Org/publish-node-action@v1 with: - ## Add your own personal access token to your Github Repository secrets and reference it here. personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }} diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml new file mode 100644 index 0000000..4e02b90 --- /dev/null +++ b/.github/workflows/version-bump.yml @@ -0,0 +1,197 @@ +name: Version Management + +on: + workflow_dispatch: + inputs: + version_type: + description: 'Version bump type' + required: true + default: 'patch' + type: choice + options: + - patch + - minor + - major + release_notes: + description: 'Release notes (optional)' + required: false + type: string + +permissions: + contents: write + issues: write + pull-requests: write + +jobs: + bump-version: + name: Bump Version + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install semver + + - name: Get current version + id: current-version + run: | + CURRENT_VERSION=$(grep '^version = ' pyproject.toml | cut -d'"' -f2) + echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT + echo "Current version: $CURRENT_VERSION" + + - name: Calculate new version + id: new-version + run: | + CURRENT_VERSION="${{ steps.current-version.outputs.current_version }}" + VERSION_TYPE="${{ github.event.inputs.version_type }}" + + # Parse version components + IFS='.' read -r major minor patch <<< "$CURRENT_VERSION" + + case $VERSION_TYPE in + "major") + NEW_MAJOR=$((major + 1)) + NEW_MINOR=0 + NEW_PATCH=0 + ;; + "minor") + NEW_MAJOR=$major + NEW_MINOR=$((minor + 1)) + NEW_PATCH=0 + ;; + "patch") + NEW_MAJOR=$major + NEW_MINOR=$minor + NEW_PATCH=$((patch + 1)) + ;; + esac + + NEW_VERSION="$NEW_MAJOR.$NEW_MINOR.$NEW_PATCH" + echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT + echo "New version: $NEW_VERSION" + + - name: Update pyproject.toml + run: | + NEW_VERSION="${{ steps.new-version.outputs.new_version }}" + sed -i "s/^version = \".*\"/version = \"$NEW_VERSION\"/" pyproject.toml + echo "Updated pyproject.toml to version $NEW_VERSION" + + - name: Update __init__.py + run: | + NEW_VERSION="${{ steps.new-version.outputs.new_version }}" + sed -i "s/__version__ = \".*\"/__version__ = \"$NEW_VERSION\"/" __init__.py + echo "Updated __init__.py to version $NEW_VERSION" + + - name: Update README.md version badge + run: | + NEW_VERSION="${{ steps.new-version.outputs.new_version }}" + sed -i "s/badge\/version-.*-blue/badge\/version-$NEW_VERSION-blue/" README.md + echo "Updated README.md version badge to $NEW_VERSION" + + - name: Create version bump commit + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add pyproject.toml __init__.py README.md + git commit -m "chore: bump version to ${{ steps.new-version.outputs.new_version }}" + git tag -a "v${{ steps.new-version.outputs.new_version }}" -m "Version ${{ steps.new-version.outputs.new_version }}" + + - name: Push changes + run: | + git push origin HEAD:${{ github.ref }} + git push origin "v${{ steps.new-version.outputs.new_version }}" + + - name: Create Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v${{ steps.new-version.outputs.new_version }} + release_name: ComfyUI-UniversalToolkit v${{ steps.new-version.outputs.new_version }} + body: | + ## 🎉 ComfyUI-UniversalToolkit v${{ steps.new-version.outputs.new_version }} 发布 + + ### 📋 版本信息 + - **版本类型**: ${{ github.event.inputs.version_type }} + - **发布时间**: $(date -u +"%Y-%m-%d %H:%M UTC") + - **提交**: ${{ github.sha }} + + ### 📝 更新说明 + ${{ github.event.inputs.release_notes || '请查看提交历史了解详细更新内容。' }} + + ### 📦 安装方式 + 1. **ComfyUI-Manager安装(推荐)**: + - 在ComfyUI中打开ComfyUI-Manager + - 搜索 "ComfyUI-UniversalToolkit" + - 点击安装 + + 2. **手动安装**: + ```bash + git clone https://github.com/whmc76/ComfyUI-UniversalToolkit.git + cd ComfyUI-UniversalToolkit + git checkout v${{ steps.new-version.outputs.new_version }} + pip install -r requirements.txt + ``` + + ### 🎯 功能特性 + - 🎨 图像处理:色彩迁移、图像拼接、尺寸调整、深度图模糊等 + - 🎵 音频处理:音频加载、裁剪、重采样、增益调节等 + - 🎭 掩码操作:掩码运算、填充、裁剪、预览等 + - 🛠️ 实用工具:数学表达式、文本处理、显存清理、预设加载等 + - 📱 智能预设:27种Kontext VLM系统预设 + + ### 🔧 兼容性 + - ComfyUI v1.0.0+ + - Python 3.8+ + - Windows, macOS, Linux + + ### 📄 详细文档 + 查看 [README.md](https://github.com/whmc76/ComfyUI-UniversalToolkit/blob/main/README.md) 获取完整使用说明 + + ### 🤝 反馈与支持 + - 问题反馈:[Issues](https://github.com/whmc76/ComfyUI-UniversalToolkit/issues) + - 讨论交流:[Discussions](https://github.com/whmc76/ComfyUI-UniversalToolkit/discussions) + + --- + + ⭐ 如果这个项目对您有帮助,请给我们一个Star! + draft: false + prerelease: false + + - name: Notify Discord (Optional) + if: ${{ secrets.DISCORD_WEBHOOK_URL }} + run: | + curl -H "Content-Type: application/json" \ + -d '{ + "embeds": [{ + "title": "🚀 ComfyUI-UniversalToolkit v'${{ steps.new-version.outputs.new_version }}' 版本发布", + "description": "新版本已成功发布!\n\n📋 版本信息:\n• 版本类型:'${{ github.event.inputs.version_type }}'\n• 发布时间:'$(date -u +"%Y-%m-%d %H:%M UTC")'\n\n📝 更新说明:\n'${{ github.event.inputs.release_notes || '请查看GitHub发布页面了解详细更新内容。' }}'", + "color": 3066993, + "fields": [ + { + "name": "📦 安装", + "value": "通过ComfyUI-Manager搜索安装,或手动克隆仓库", + "inline": true + }, + { + "name": "🔗 链接", + "value": "[GitHub](https://github.com/whmc76/ComfyUI-UniversalToolkit) | [Release](https://github.com/whmc76/ComfyUI-UniversalToolkit/releases/tag/v'${{ steps.new-version.outputs.new_version }}')", + "inline": true + } + ], + "footer": { + "text": "ComfyUI-UniversalToolkit" + } + }] + }' \ + ${{ secrets.DISCORD_WEBHOOK_URL }} \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..d7b12bc --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,53 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + - id: check-merge-conflict + - id: check-case-conflict + - id: check-docstring-first + - id: check-json + - id: check-merge-conflict + - id: debug-statements + + - repo: https://github.com/psf/black + rev: 23.3.0 + hooks: + - id: black + language_version: python3 + args: [--line-length=88] + + - repo: https://github.com/pycqa/isort + rev: 5.12.0 + hooks: + - id: isort + args: [--profile=black, --line-length=88] + + - repo: https://github.com/pycqa/flake8 + rev: 6.0.0 + hooks: + - id: flake8 + args: [--max-line-length=88, --extend-ignore=E203,W503] + + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.3.0 + hooks: + - id: mypy + additional_dependencies: [types-all] + args: [--ignore-missing-imports] + + - repo: https://github.com/PyCQA/bandit + rev: 1.7.5 + hooks: + - id: bandit + args: [-r, ., -f, json, -o, bandit-report.json] + exclude: ^tests/ + + - repo: https://github.com/asottile/pyupgrade + rev: v3.3.1 + hooks: + - id: pyupgrade + args: [--py38-plus] \ No newline at end of file diff --git a/README.md b/README.md index 7f65f46..f0f3add 100644 --- a/README.md +++ b/README.md @@ -1,70 +1,290 @@ # ComfyUI-UniversalToolkit -## 版本 +[![Version](https://img.shields.io/badge/version-1.2.0-blue.svg)](https://github.com/whmc76/ComfyUI-UniversalToolkit) +[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE) +[![ComfyUI](https://img.shields.io/badge/ComfyUI-v3+-orange.svg)](https://github.com/comfyanonymous/ComfyUI) -- 当前版本:**v1.1.4** +一个功能全面的ComfyUI工具包,提供丰富的图像处理、音频处理、掩码操作和实用工具节点,支持批量处理、智能分析、色彩迁移等多种高级功能。 -## 更新日志 +## 🌟 主要特性 + +- **🎨 图像处理**:色彩迁移、图像拼接、尺寸调整、深度图模糊等 +- **🎵 音频处理**:音频加载、裁剪、重采样、增益调节等 +- **🎭 掩码操作**:掩码运算、填充、裁剪、预览等 +- **🛠️ 实用工具**:数学表达式、文本处理、显存清理、预设加载等 +- **📱 智能预设**:27种Kontext VLM系统预设,支持动态场景描述 +- **🔧 模块化设计**:按功能分类,易于维护和扩展 +- **⚡ 高性能**:支持批量处理,优化内存使用 + +## 📦 安装 + +### 方法一:通过ComfyUI-Manager安装(推荐) +1. 在ComfyUI中打开ComfyUI-Manager +2. 搜索 "ComfyUI-UniversalToolkit" +3. 点击安装 + +### 方法二:手动安装 +1. 将本插件文件夹放入ComfyUI的 `custom_nodes/` 目录下 +2. 安装依赖: + ```bash + pip install -r requirements.txt + ``` + +### 依赖要求 +``` +Pillow +numpy +torch +librosa +torchaudio +opencv-python +scipy +tqdm +``` + +## 🎯 节点功能详解 + +### 🎨 图像处理节点 + +#### 基础图像处理 +- **EmptyUnitGenerator_UTK**:生成指定尺寸的空白图像、掩码和潜在空间 +- **ImageRatioDetector_UTK**:检测图像宽高比,支持多种比例格式 +- **ImageConcatenate_UTK**:水平或垂直拼接两张图像 +- **ImageConcatenateMulti_UTK**:智能拼接多张图像,支持2-4图自动布局 + +#### 图像变换与调整 +- **ImageScaleByAspectRatio_UTK**:按指定宽高比缩放图像 +- **ImageMaskScaleAs_UTK**:按参考图像尺寸缩放图像 +- **ImageScaleRestore_UTK**:将图像恢复到原始尺寸 +- **ImageRemoveAlpha_UTK**:移除图像的Alpha通道 +- **ImageCombineAlpha_UTK**:合并Alpha通道到图像 + +#### 高级图像处理 +- **ImitationHueNode_UTK**:图像色彩迁移,支持皮肤保护和区域处理 +- **DepthMapBlur_UTK**:基于深度图的智能模糊,模拟景深效果 +- **ImagePadForOutpaintMasked_UTK**:外绘扩展,支持像素和百分比模式 +- **ImageAndMaskPreview_UTK**:图像和掩码预览,支持叠加和并排显示 + +#### 掩码相关图像处理 +- **CropByMask_UTK**:基于掩码智能裁剪,支持多种检测模式 +- **RestoreCropBox_UTK**:恢复裁剪框到原始背景 +- **FillMaskedArea_UTK**:掩码区域填充,支持多种算法 +- **CheckMask_UTK**:检查掩码有效性 + +### 🎵 音频处理节点 + +- **LoadAudioPlusFromPath_UTK**:从本地路径加载音频,支持采样率、声道、裁剪、增益等参数 +- **AudioCropProcess_UTK**:音频裁剪处理,支持重采样、增益、声道处理,与原生上传节点无缝对接 + +### 🎭 掩码操作节点 + +- **MaskAnd_UTK**:掩码与运算 +- **MaskSub_UTK**:掩码减法运算 +- **MaskAdd_UTK**:掩码加法运算 + +### 🛠️ 工具节点 + +#### 显示与预览 +- **Show_UTK**:通用显示节点,支持所有数据类型预览 + +#### 文本处理 +- **TextboxNode_UTK**:多行文本输入框 +- **TextConcatenate_UTK**:文本拼接,支持自定义分隔符 +- **ThinkRemover_UTK**:分离文本中的思考内容 + +#### 数学与逻辑 +- **MathExpression_UTK**:数学表达式计算,支持复杂公式和函数 + +#### 系统工具 +- **PurgeVRAM_UTK**:显存清理,支持选择性清理缓存和模型 + +#### 预设系统 +- **LoadKontextPresets_UTK**:Kontext VLM系统预设,包含27种专业图像变换预设 + - 情境深度融合、无痕融合、场景传送 + - 移动镜头、重新布光、专业产品图 + - 画面缩放、图像上色、电影海报 + - 卡通漫画化、移除文字、更换发型 + - 肌肉猛男化、清空家具、室内设计 + - 季节变换、时光旅人、材质置换 + - 微缩世界、幻想领域、衣橱改造 + - 艺术风格模仿、蓝图视角、添加倒影 + - 像素艺术、铅笔手绘、油画风格 + +## 🚀 使用示例 + +### 图像拼接示例 +``` +ImageConcatenate_UTK +├── 输入:两张图像 +├── 模式:水平/垂直拼接 +├── 输出:拼接后的图像 +``` + +### 色彩迁移示例 +``` +ImitationHueNode_UTK +├── 输入:源图像 + 目标图像 +├── 参数:皮肤保护、亮度调节、对比度调节 +├── 输出:色彩迁移后的图像 +``` + +### 音频处理示例 +``` +AudioCropProcess_UTK +├── 输入:音频文件 +├── 参数:裁剪时间、重采样率、增益调节 +├── 输出:处理后的音频 +``` + +## 📋 版本历史 + +### v1.2.0 (最新) +- 全面更新README文档,提供详细的功能介绍和使用指南 +- 优化项目结构和文档组织 +- 完善节点功能说明和分类 +- 更新版本推送代码,确保发布流程顺畅 +- 提升项目整体文档质量和用户体验 + +### v1.1.9 +- 升级LoadKontextPresets_UTK节点功能 +- 新增用户提示输入参数,支持动态场景描述 +- 为所有27个预设添加$user_prompt$占位符 +- 智能占位符替换,提升VLM模型生成指令的针对性 + +### v1.1.8 +- 新增LoadKontextPresets_UTK节点 +- 提供25种图像变换预设 +- 支持情境深度融合、场景传送等多种预设 + +### v1.1.7 +- 新增ThinkRemover_UTK节点 +- 支持分离文本中的思考内容 + +### v1.1.6 +- 新增TextboxNode_UTK节点 +- 支持在图像上添加自定义样式文本框 + +### v1.1.5 +- 优化ImitationHueNode_UTK节点的色彩迁移算法 +- 改进皮肤保护功能,提高肤色保持效果 ### v1.1.4 - 版本更新发布,支持ComfyUI-Manager和Registry获取 - 确保与ComfyUI v3完全兼容 -- 优化插件元数据和发布配置 + +### v1.1.3 +- 修复PurgeVRAM_UTK节点类型不匹配问题 +- 修复CheckMask_UTK节点NoneType错误 +- 完成模块化重构 + +### v1.1.2 +- 修复DepthMapBlur_UTK节点kernel size类型问题 +- 修正EmptyUnitGenerator_UTK输出shape +- 完善节点导入路径 + +### v1.1.1 +- 项目重构,按功能分类组织代码 +- 新增多个图像处理节点 +- 提高代码可维护性 + +### v1.1.0 +- 新增CropByMask_UTK和RestoreCropBox_UTK节点 +- 支持掩码裁剪和恢复功能 + +### v1.0.9 +- 新增PurgeVRAM_UTK节点 +- 支持显存清理功能 + +### v1.0.8 +- 新增ImitationHueNode_UTK节点 +- 支持图像色彩迁移功能 + +### v1.0.7 +- 改进ImagePadForOutpaintMasked节点 +- 新增数据模式和背景颜色选项 + +### v1.0.6 +- 新增ImageAndMaskPreview_UTK节点 +- 支持图像和掩码同时预览 + +### v1.0.5 +- 新增ImagePadForOutpaintMasked_UTK节点 +- 支持外绘时扩展图像尺寸 + +### v1.0.4 +- 新增FillMaskedArea_UTK节点 +- 支持三种填充模式 + +### v1.0.3 +- 新增掩码像素级运算节点 +- 修正节点注册与显示名风格 ### v1.0.2 -- 删除无用节点 Load Audio Plus Upload (UTK) -- 新增 Audio Crop Process (UTK) 支持原生音频上传 -- 修复音频处理相关bug,完善依赖 -- 作者信息、邮箱、GitHub 地址全部更新 +- 删除无用节点 +- 新增AudioCropProcess节点 +- 修复音频处理相关bug -### v0.1 -- 项目结构模块化重构,所有节点分为 image_nodes、tool_nodes 两大类,便于维护和扩展。 -- 工具类节点(ShowInt、ShowFloat、ShowList、ShowText、PreviewMask)合并为 tool_nodes_utk.py。 -- 生成/分析类节点(EmptyUnitGenerator、ImageRatioDetector)合并为 image_nodes_utk.py。 -- 删除所有冗余和历史遗留节点文件,保持 nodes/ 目录整洁。 -- 统一节点命名后缀(UTK),便于识别。 -- 完善空输入兜底逻辑,所有节点均支持安全桥接。 +### v1.0.1 +- 改进图像拼接节点 +- 添加图像尺寸匹配和最大尺寸限制 -## 简介 -本插件为 ComfyUI 提供通用工具节点,当前实现了丰富的图像与音频处理节点,支持批量生成、裁剪、拼接、分析等多种功能。 +### v1.0.0 +- 初始版本发布 +- 包含基础图像处理、文本处理、工具类节点 -## 安装 -1. 将本插件文件夹放入 ComfyUI 的 `custom_nodes/` 目录下。 -2. 安装依赖: - ``` - pip install -r requirements.txt - ``` +## 🔧 兼容性 -### 依赖列表 -- Pillow -- numpy -- torch -- librosa -- torchaudio +- **ComfyUI版本**:v1.0.0+ +- **Python版本**:3.8+ +- **操作系统**:Windows, macOS, Linux +- **GPU支持**:NVIDIA CUDA (推荐) -## 节点说明 +## 📁 项目结构 -### 音频相关节点 -- **Load Audio Plus From Path (UTK)**:从本地路径加载音频,支持采样率、声道、裁剪、增益、立体声等参数。 -- **Audio Crop Process (UTK)**:对AUDIO类型音频进行裁剪、重采样、增益、声道处理,支持与原生上传节点无缝对接。 +``` +ComfyUI-UniversalToolkit/ +├── nodes/ +│ ├── image/ # 图像处理节点 +│ ├── audio/ # 音频处理节点 +│ ├── mask/ # 掩码操作节点 +│ ├── tools/ # 工具节点 +│ └── image_utils.py # 图像工具函数 +├── web/ # Web界面扩展 +├── reference_code/ # 参考代码 +├── __init__.py # 主入口文件 +├── requirements.txt # 依赖列表 +├── pyproject.toml # 项目配置 +└── README.md # 说明文档 +``` -### 图像与工具节点 -- Empty Unit Generator -- Image Ratio Detector -- Depth Map Blur -- Image Concatenate -- Image Concatenate Multi -- Show Int/Float/List/Text/Mask (UTK) +## 🤝 贡献 -## 作者信息 -- 作者:CyberDickLang -- 邮箱:286878701@qq.com -- GitHub:[https://github.com/whmc76](https://github.com/whmc76) +欢迎提交Issue和Pull Request! -## 兼容性 -- 结构与 ComfyUI 官方插件规范兼容。 -- 支持多分辨率、批量输出,参数面板友好。 -- 音频节点兼容多格式、原生上传体验。 +### 开发规范 +- 遵循PEP8代码风格 +- 节点命名统一加`_UTK`后缀 +- 所有节点必须通过测试验证 +- 新增功能需更新文档 -## 许可证 -MIT \ No newline at end of file +## 📄 许可证 + +本项目采用MIT许可证 - 详见[LICENSE](LICENSE)文件 + +## 👨‍💻 作者信息 + +- **作者**:CyberDickLang +- **邮箱**:286878701@qq.com +- **GitHub**:[https://github.com/whmc76](https://github.com/whmc76) + +## 🙏 致谢 + +感谢以下项目的开源贡献: +- [ComfyUI](https://github.com/comfyanonymous/ComfyUI) - 优秀的AI图像生成框架 +- [ComfyUI-LayerStyle](https://github.com/your-repo) - 模块化设计参考 +- [ComfyUI-MingNodes](https://github.com/your-repo) - 色彩迁移算法参考 +- [Kontext](https://github.com/your-repo) - VLM预设系统 + +--- + +⭐ 如果这个项目对您有帮助,请给我们一个Star! \ No newline at end of file diff --git a/__init__.py b/__init__.py index 8d4ff8b..d365da6 100644 --- a/__init__.py +++ b/__init__.py @@ -8,13 +8,21 @@ A comprehensive toolkit for ComfyUI that provides various utility nodes for imag :license: MIT, see LICENSE for more details. """ -__version__ = "1.1.9" +__version__ = "1.2.0" __author__ = "CyberDickLang" __email__ = "286878701@qq.com" __url__ = "https://github.com/whmc76" # 更新日志 CHANGELOG = { + "1.2.0": [ + "版本更新发布:", + "- 全面更新README文档,提供详细的功能介绍和使用指南", + "- 优化项目结构和文档组织", + "- 完善节点功能说明和分类", + "- 更新版本推送代码,确保发布流程顺畅", + "- 提升项目整体文档质量和用户体验" + ], "1.1.9": [ "升级 LoadKontextPresets_UTK 节点功能:", "- 新增用户提示输入参数(user_prompt),支持多行文本输入", diff --git a/pyproject.toml b/pyproject.toml index 8b7e253..2c6e603 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "universaltoolkit" description = "A comprehensive toolkit based on ComfyUI, providing image, mask, audio, and tools nodes, fully modular and v3 compatible." -version = "1.1.7" +version = "1.2.0" license = {file = "LICENSE"} dependencies = ["torch", "numpy", "Pillow", "opencv-python", "scipy", "tqdm"] requires-python = ">=3.8"