Skip to content

Enhanced run_comfyui.bat with Automated Dependency Checking and CUDA PyTorch Detection #10705

@John-Caldwell

Description

@John-Caldwell

Feature Request: Enhanced run_comfyui.bat with Automated Dependency Checking and CUDA PyTorch Detection

Problem

Windows users often encounter frustrating issues when setting up ComfyUI:

  1. Missing Dependencies: Users encounter cryptic ModuleNotFoundError messages when dependencies are missing, requiring manual troubleshooting and installation
  2. CPU-Only PyTorch: Many users accidentally install CPU-only PyTorch, which prevents GPU acceleration and causes significant performance issues without clear indication of the problem
  3. Poor Error Messages: Existing error messages don't provide clear guidance on how to resolve issues, leaving users to search forums and documentation
  4. Installation Confusion: Users are unsure which dependencies are required vs optional, and whether they should install in virtual environments

These issues create a poor first-time user experience and increase support burden.

Proposed Solution

Enhance the run_comfyui.bat startup script to:

  • Automated Dependency Checking: Check all critical Python dependencies before launching ComfyUI, with clear prompts for missing packages
  • CUDA PyTorch Detection: Automatically detect CPU-only PyTorch installations and offer to install the CUDA-enabled version
  • User-Friendly Error Messages: Provide clear, actionable error messages with specific troubleshooting steps
  • Virtual Environment Guidance: Detect virtual environments and provide appropriate warnings and guidance
  • Progress Feedback: Show progress bars during installations for better user experience

Benefits

  • Reduced Support Burden: Common setup issues are caught and resolved automatically
  • Better User Experience: Windows users get clear guidance instead of cryptic errors
  • GPU Support: Automatically ensures users have CUDA-enabled PyTorch for optimal performance
  • Professional Appearance: Polished interface with clear formatting and helpful prompts

Implementation Details

The enhancement would:

  • Check for missing dependencies using importlib.util.find_spec()
  • Separate critical vs optional dependencies
  • Detect CPU-only PyTorch by checking version string for "+cpu" indicator
  • Provide interactive prompts for installation options
  • Maintain full backward compatibility with existing functionality

Additional Notes

  • All installations would be optional (users can cancel at any time)
  • The script would warn users about system Python vs virtual environment implications
  • All existing functionality would be preserved
  • The enhancement is designed to be safe and non-destructive

Status

I have a complete PR ready to submit if this feature is desired. The implementation includes comprehensive dependency checking, CUDA PyTorch auto-installation, user-friendly error handling, and has been tested in various scenarios.


Note: This addresses common user pain points that may not have been formally reported as issues, but are frequently encountered in the community (especially on Discord/Matrix support channels).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions