Update ComfyUI to v0.7.0 with PyTorch optimizations#16
Conversation
- ComfyUI: 0.6.0 → 0.7.0 (released 2025-12-31) - Frontend package: 1.34.9 → 1.37.1 - Manager: 4.0.2 → 4.0.4 - Workflow templates: 0.7.59 → 0.7.65 - Workflow templates core: 0.3.43 → 0.3.65 - Workflow templates media API: 0.3.22 → 0.3.34 - Workflow templates media video: 0.3.19 → 0.3.22 - Workflow templates media image: 0.3.36 → 0.3.47 - Workflow templates media other: 0.3.47 → 0.3.63 - KJNodes: 2025-12-21 → 2025-12-28 - WanVideoWrapper: 2025-12-24 → 2025-12-31
- Add ultralytics for Impact Subpack's UltralyticsDetectorProvider node - Create PEP 405 compliant venv structure for mutable package installs - Add version constraints to prevent Manager from overriding vendored packages - Set UV_CONSTRAINT alongside PIP_CONSTRAINT for uv compatibility
- Update nixpkgs from April 2025 to December 2025 - Migrate from legacy darwin.apple_sdk.frameworks.Metal to apple-sdk_14 - Disable failing imageio test_process_termination (exit code 6 vs 2)
The nixpkgs update brought aiohttp 3.13.2 which uses grpc/c-ares for async DNS resolution. This consumes significantly more file descriptors per connection. Combined with ComfyUI-Manager's concurrent HTTP requests during startup, this exhausts the default macOS limit of 256 FDs. Add ulimit -n 10240 to the launcher to prevent "Too many open files" errors on both macOS and Linux.
Skip Cargo.lock, Cargo.toml, and .cargo-checksum.json files when pushing build dependencies. These intermediate files cause upload retries and aren't useful for cache consumers who pull pre-built packages.
Work around nixpkgs-unstable issues where certain packages are marked in meta.badPlatforms even though they work: - cudnn 9.13.0 for CUDA 12.8 on x86_64-linux - kornia-rs on aarch64-linux Added allowUnsupportedSystem = true to: - mkCudaPkgs helper (CUDA builds) - pkgsLinuxX86 (x86_64 Docker images) - pkgsLinuxArm64 (aarch64 Docker images) See: NixOS/nixpkgs#458799 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
cuda_compat is only available for aarch64-linux (Jetson devices) but was incorrectly being pulled into the dependency tree on x86_64-linux builds. This adds an overlay to set cuda_compat = null on x86_64-linux systems, preventing the build failure "variable $src or $srcs should point to source". Combined with allowUnsupportedSystem for the cudnn badPlatforms workaround, CUDA builds now work correctly on x86_64-linux. See: NixOS/nixpkgs#458799 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Switch from compiling PyTorch from source to using pre-built wheels from pytorch.org for CUDA builds. This provides: - Fast builds (~2GB download vs hours of compilation) - Low memory usage (no 30-60GB RAM requirement) - All GPU architectures (Pascal through Hopper) in one package - CUDA 12.4 runtime bundled in wheels Also removes architecture-specific packages (cuda-sm61, etc.) since the wheel-based approach supports all architectures universally. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
PyTorch 2.9.x in nixpkgs has MPS bugs on macOS 26 (Tahoe) that cause trace trap crashes during SDXL inference. Pin to 2.5.1 pre-built wheels from pytorch.org for macOS Apple Silicon. - Add darwinArm64 wheel pins in nix/versions.nix - Add macOS-specific torch/torchvision/torchaudio overrides - Exclude kornia on macOS (Cargo build issues unrelated to torch) Fixes: pytorch/pytorch#167679
Code Review: ComfyUI v0.7.0 Update with PyTorch OptimizationsSummaryThis is a well-executed major update that significantly improves the build system by switching from source compilation to pre-built PyTorch wheels. The changes are well-documented and the approach is sound. ✅ StrengthsArchitecture & Design
Code Quality
🔍 Issues & ConcernsCritical Issues1. Missing The # Should be added to pkgsLinuxX86 config (around line 60):
pkgsLinuxX86 = import nixpkgs {
system = "x86_64-linux";
config = {
allowUnfree = true;
allowBrokenPredicate = pkg: (pkg.pname or "") == "open-clip-torch";
allowUnsupportedSystem = true; # ← Missing! Needed for cudnn workaround
};
};2. Potential metadata corruption issue (nix/python-overrides.nix:71-78) The sed commands that strip nvidia-* and triton dependencies could be fragile: sed -i '/^Requires-Dist: nvidia-/d' "$metadata"
sed -i '/^Requires-Dist: triton/d' "$metadata"Concerns:
Recommendation: Use more specific patterns: sed -i '/^Requires-Dist: nvidia-c[ua]/d' "$metadata" # nvidia-cuda-*, nvidia-cublas-*, etc.
sed -i '/^Requires-Dist: triton[^-]/d' "$metadata" # Match "triton" but not "python-triton"3. kornia exclusion on macOS lacks explanation (nix/packages.nix:158) ++ lib.optionals (pkgs.stdenv.isLinux && ps ? kornia && available ps.kornia) [ ps.kornia ]The code excludes kornia on macOS, mentioned briefly in PR description as "Cargo build issues unrelated to torch", but:
Security Concerns1. File descriptor limit increase (nix/packages.nix:232-235) ulimit -n 10240 2>/dev/null || trueWhile the justification is sound (aiohttp/grpc DNS resolver), this is a significant increase from default limits. The silent failure ( Recommendations:
2. Cachix filtering (scripts/push-to-cachix.sh:153-155) ALL_PATHS=$(echo "$ALL_PATHS" | grep -vE '(Cargo\.lock|Cargo\.toml|\.cargo-checksum\.json)$')Good approach, but the regex could be more defensive: ALL_PATHS=$(echo "$ALL_PATHS" | grep -vE '/(Cargo\.lock|Cargo\.toml|\.cargo-checksum\.json)$')Add leading Code Quality Issues1. Inconsistent version constraint format (nix/packages.nix:55-61) comfyui-frontend-package>=${versions.vendored.frontendPackage.version}
comfyui-workflow-templates>=${versions.vendored.workflowTemplates.version}
# ...Using comfyui-frontend-package==${versions.vendored.frontendPackage.version}2. Duplicate library path handling (nix/python-overrides.nix:23-28, 31-45) The # Common libs for all wheels
commonWheelBuildInputs = [ stdenv.cc.cc.lib zlib libGL glib ];
# CUDA-specific libs
cudaRuntimeLibs = lib.optionals useCuda [ ... ];
# Combined
wheelBuildInputs = commonWheelBuildInputs ++ cudaRuntimeLibs;3. Silent test disabling (nix/python-overrides.nix:89, 147, 203) pythonImportsCheck = [ ];
doCheck = false;Disabling all import checks for wheel packages means we won't catch packaging issues. At minimum, we should check that torch imports successfully: pythonImportsCheck = [ "torch" ]; # Basic smoke test🎯 RecommendationsHigh Priority
Medium Priority
Low Priority
📊 Test CoverageThe test plan shows:
Recommendation: Before merging, verify at minimum that Linux CUDA builds successfully, as this is the major change in this PR. 🔒 Security AssessmentOverall: Low Risk No critical security issues, but:
📝 DocumentationExcellent - The PR description, commit messages, and code comments are thorough and well-written. The CLAUDE.md and README.md updates accurately reflect the changes. Final VerdictConditional Approval This is excellent work that significantly improves the project. However, please address:
Great work on this modernization effort! The wheel-based approach is a massive improvement for users. Review generated with guidance from project CLAUDE.md conventions |
- Use exact version pinning (==) for vendored packages instead of >= - Add comment explaining kornia exclusion on macOS with issue reference 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Code Review: ComfyUI v0.7.0 Update with PyTorch OptimizationsThis is an excellent PR that significantly improves the build system. The migration from compiling PyTorch from source to using pre-built wheels is a major quality-of-life improvement. Here's my detailed review: ✅ Strengths1. Architecture Simplification
Location: 2. Build Performance & Resource Usage
Location: 3. macOS MPS Fix
Locations:
4. Code Quality
5. Documentation Updates
🔍 Potential Issues1. NixOS Module Still References Removed Packages
|
| Aspect | Rating | Notes |
|---|---|---|
| Code Quality | ⭐⭐⭐⭐⭐ | Excellent structure, well-commented |
| Architecture | ⭐⭐⭐⭐⭐ | Major simplification, great UX improvement |
| Testing | ⭐⭐⭐⭐½ | Comprehensive, missing NixOS module verification |
| Documentation | ⭐⭐⭐⭐⭐ | Thorough updates to all user-facing docs |
| Breaking Changes | ⭐⭐⭐⭐ | Well-documented, but module needs updating |
| Security | ⭐⭐⭐⭐ | Good practices, pre-built wheels are trusted source |
Overall Assessment: This is a high-quality PR that makes significant improvements to build ergonomics and performance. The main blocker is fixing the NixOS module to match the flake changes. Once that's addressed, this is ready to merge.
🔧 Action Items
Before merging:
- Fix
nix/modules/comfyui.nixto remove architecture-specific package references - Test NixOS module with simplified
cuda = trueoption - Update module documentation in README.md
Suggested follow-ups (can be separate PRs):
- Add Cargo artifact filter explanation
- Document wheel trust model in security section
- Test on arm64 Linux if supported
Great work on this modernization! 🎉
- kornia-rs has aarch64-linux in badPlatforms, causing CI failures - Also improve Cachix filter regex to be more defensive 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Code Review: ComfyUI v0.7.0 Update with PyTorch OptimizationsThis is a substantial and well-executed PR that modernizes the build system with significant architectural improvements. Overall, the code quality is excellent, but I've identified a few areas for consideration. 🎯 Summary AssessmentStrengths:
Risk Level: Medium (significant architectural changes, but well-tested) 📋 Detailed Findings1. Critical: PyTorch Version Pinning
|
The wheel-based CUDA approach supports all GPU architectures in a single package, so architecture-specific options are no longer needed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Comprehensive Code Review: ComfyUI v0.7.0 Update with PyTorch OptimizationsSummaryThis is a well-executed major update that significantly improves the build system by switching from source compilation to pre-built PyTorch wheels. The changes are thoroughly tested, well-documented, and represent a major usability improvement. ✅ Strengths1. Architecture & Design Excellence
2. Code Quality
3. Testing & Validation
🔍 Issues FoundCritical IssuesNone - No critical bugs or security issues identified. Medium Priority Issues
Low Priority / Nitpicks
🎯 Best Practices Observed
🔒 Security Considerations
📊 Performance ConsiderationsMassive improvements:
✅ Test Coverage AssessmentThe test plan is thorough:
Recommendation: Consider adding a test for the removed architecture-specific packages to ensure users get clear error messages if they try to use the old package names. 📝 RecommendationsRequired for MergeNone - The PR is ready to merge as-is. All issues found are minor. Suggested Improvements (Post-merge)
🎉 ConclusionAPPROVE ✅ This is an excellent PR that represents a significant improvement to the project:
The switch to pre-built PyTorch wheels is the right technical choice and is implemented cleanly. The code quality is high with good documentation and proper Nix patterns throughout. Great work! 🚀 Review generated based on CLAUDE.md guidelines and Nix best practices |
Summary
This PR updates ComfyUI to v0.7.0 and includes significant improvements to the build system, particularly for PyTorch handling on both CUDA (Linux) and MPS (macOS) platforms.
Key Changes
Detailed Changes
🚀 Pre-built PyTorch CUDA Wheels (Linux)
cuda-sm61,cuda-sm86, etc.) - no longer needed🍎 macOS MPS Fix
🔧 Build System Fixes
darwin.apple_sdk.frameworks.Metaltoapple-sdk_14Test Plan
nix flake checkpassesBreaking Changes
cuda-sm61,cuda-sm86, etc.)nix run .#cudainstead - it now supports all architecturesFiles Changed
nix/versions.nixnix/python-overrides.nixnix/packages.nixflake.nixscripts/push-to-cachix.shRelated Issues