Downgrading Python for comfyUI: A Detailed Step-by-Step Guide

Every now and then you might find yourself having to reinstall ComfyUI. Lately my test environment of ComfyUI has been a bit wonky so I’ve decided to do a clean installation of it. Note! Since this is my test environment, I don’t actually have any models in this folder. All models are in my main ComfortUI folder and I’m using system links to access them from my test environment. That means that I can just delete the whole ComfortUI folder. If you are reinstalling a ComfortUI where you have your models located, I would suggest that you move them elsewhere during the installation so you don’t have to re-download them all later. Independent research like this is self-funded. If this guide saved you hours of troubleshooting, consider fueling the lab. Most of the time installing ComfyUI is pretty straightforward and doesn’t cause too much headache. We will be installing the portable version here today. There is a web app version as well, but I’ve tried it and I didn’t like it.

First you need to go to ComfyUI at Github, and once there, scroll down a bit until you get to the part that says Windows Portable. Click on the direct link to download in order to download a compressed folder containing everything you need. The file is a bit over 1GB. Once the file is downloaded, open it and select everything inside. Then drag all of it to an empty folder where you want your installation to be located. The current ComfyUI installation comes with Torch 2.9 for CUDA 13.0 pre-installed. I don’t want this version because it’s very new and the newest Torch and CUDA often causes dependency issues. Go to pytorch.org and scroll down to version 2.8.0. Next we are installing SageAttention and if you are reading my text guide you can just scroll down a little bit to find the instructions.

Independent research like this is self-funded. If this guide saved you hours of troubleshooting, consider fueling the lab. Important lesson: Do not install the latest x-formers. Instead you need to look at previous releases and find a version suitable for Pytorch 2.8. And that would be version 0.0.32.post1. By installing ComfyUI manager, you are doing your future self a huge favour. To install this you need to navigate to your custom nodes folder, located at ComfyUI/custom_nodes. Once there, right click inside that folder and open a command window. This will clone the repository to your custom nodes folder.

Downgrade Python VersionDowngrading Python Version: A Step-by-Step GuidePython, a versatile and widely-used programming language, is constantly evolving with new features and enhancements. However, there are instances when you may need to downgrade your Python version due to compatibility issues or project requirements. In this blog, we’ll explore the reasons for downgrading Python and provide a simple step-by-step guide to help you navigate this process.

Why Downgrade Python?

There are various reasons one might consider downgrading Python. One common scenario is when working on a project that relies on an older version of Python, and upgrading could break existing code or dependencies. Additionally, some libraries and frameworks may not yet be compatible with the latest Python release, prompting developers to stick with an earlier version.

Step 1: Check Your Current Python Version

The first step in downgrading your Python version is to check the current version installed on your system. This information is crucial for ensuring a smooth transition to the desired Python version. To check your current Python version, follow these simple steps:

  1. Open Command Prompt or Terminal: On Windows, you can press Win + R, type cmd, and press Enter. On macOS or Linux, open the Terminal application.
  2. Enter the Version Check Command: In the command prompt or terminal, type the following command and press Enter: python --version OR python -V
  3. Note Down the Version: The command’s output will show the Python version in use. Make a note of this version as you’ll need it later when downloading the desired Python version. Example: Python 3.9.2

Checking your current Python version is a simple yet crucial initial step, ensuring that you have a clear understanding of your starting point before proceeding with the downgrade. With the current version identified, you can confidently move on to the next steps in the process.

Step 2: Uninstall the Current Python Version

The second step in downgrading your Python version is to uninstall the current version that is installed on your system. This is an important step to ensure a clean transition to the desired Python version. Follow these straightforward instructions to uninstall the current Python version:

  1. Open Command Prompt or Terminal: On Windows, you can press Win + R, type cmd, and press Enter. On macOS or Linux, open the Terminal application.
  2. Run the Uninstall Command: In the command prompt or terminal, type the following command and press Enter: pip uninstall python
  3. Confirm Uninstallation: You may be prompted to confirm the uninstallation. Type ‘y’ for yes and press Enter to proceed with the removal.
  4. Wait for Completion: Allow the uninstallation process to complete. This may take a few moments as the system removes the Python version and related files.
  5. Verify Uninstallation: Once the uninstallation is complete, you can verify that Python has been successfully uninstalled by running the version check command again: python --version. If Python is uninstalled, the system will likely display that ‘python’ is not recognized as a command.

By uninstalling the current Python version, you are preparing the ground for the installation of the desired version in the next steps. With this step completed, you can move on to downloading and installing the Python version that aligns with your project requirements.

Step 3: Download the Desired Python Version

In the third step of downgrading your Python version, you will need to download the specific Python version that aligns with your project requirements. This will lead you to the Python releases page. Select the Desired Python Version: On the releases page, scroll down to find the list of available Python versions. Identify the version that you want to install. It’s important to choose a version that is compatible with your project’s requirements. Access the Download Links: Click on the version number to access the download links. Choose the appropriate installer based on your operating system (Windows, macOS, or Linux) and system architecture (32-bit or 64-bit). Download the Installer: Click on the download link to initiate the download of the installer for the selected Python version. The installer file will have a “.exe” extension for Windows, “.pkg” for macOS, and “.tar.gz” for Linux. Wait for the Download to Complete: Depending on your internet connection speed, the download may take some time. This step is crucial for obtaining the correct installer that matches your system specifications and project requirements. Once the download is complete, you can move on to the next step, which involves installing the Python version you’ve just acquired.

Step 4: Install the Downgraded Python Version

In the fourth step of downgrading your Python version, you’ll install the Python version you’ve downloaded. Follow these straightforward instructions to install the downgraded Python version:

  1. Locate the Downloaded Installer: Navigate to the folder where you downloaded the Python installer. This is typically the “Downloads” folder on your computer.
  2. Run the Installer: Double-click on the downloaded installer file to initiate the installation process. The file will have a specific extension depending on your operating system: “.exe” for Windows, “.pkg” for macOS, and “.tar.gz” for Linux.
  3. Follow the Installation Wizard: The installer will launch an installation wizard. Follow the on-screen prompts and make sure to check the option that adds Python to your system PATH. This is essential for seamless command-line access.
  4. Choose the Installation Location: During the installation process, the wizard will prompt you to choose the installation location. The default location is usually fine, but you can customize it if needed.
  5. Wait for Installation to Complete: Allow the installer to complete the installation process. This may take a few minutes as the system configures and sets up the downgraded Python version.
  6. Verify the Installation: After the installation is complete, open a new command prompt or terminal window and type the following command: python --version. This command will display the version of Python currently in use. Ensure that it matches the version you just installed, confirming a successful downgrade.

By following these steps, you have successfully installed the downgraded Python version on your system. This ensures that your development environment is aligned with the specific version required for your projects. With the installation completed, you can proceed to the final step of the process: reinstalling any packages and dependencies needed for your projects to ensure compatibility with the downgraded Python version.

Step 5: Verify the Installation

In the fifth step of downgrading your Python version, it’s crucial to verify that the installation was successful. Follow these steps to confirm that the downgraded Python version is now in use:

  1. Open Command Prompt or Terminal: Launch a new command prompt (Windows) or terminal (macOS/Linux).
  2. Enter the Version Check Command: Type the following command and press Enter to check the currently installed Python version: python --version OR python -V
  3. Verify the Version: The command’s output should now display the downgraded Python version that you installed in the previous steps. For example: Python 3.8.5
  4. Ensure Version Alignment: Confirm that the displayed version matches the version you intended to downgrade to. This verification step is crucial to ensure that your development environment is now running the desired Python version.
  5. Check for Errors: If there are any errors or if the system does not recognize the ‘python’ command, double-check the installation steps to identify and resolve any issues.

Verifying the installation ensures that the downgraded Python version is set up correctly on your system. This step is essential for avoiding potential compatibility issues and ensuring a smooth transition to the desired Python version for your projects. With successful verification, you can confidently move forward, knowing that your development environment is now aligned with the specific Python version you intended to use.

Step 6: Reinstall Packages and Dependencies

In the sixth and final step of downgrading your Python version, you’ll need to reinstall any packages and dependencies that your projects rely on. This is necessary to ensure compatibility with the newly installed, downgraded Python version. Follow these steps to reinstall packages:

  1. Open Command Prompt or Terminal: Launch a new command prompt (Windows) or terminal (macOS/Linux).
  2. Navigate to Your Project Directory: Use the cd command to navigate to the directory where your project is located. For example: cd path/to/your/project
  3. Reinstall Packages: Use the pip command to reinstall the packages and dependencies your project requires. For each package, run a command similar to the following: pip install
  4. Repeat for All Dependencies: Repeat the pip install command for each package and dependency your project needs. This ensures that all necessary components are compatible with the downgraded Python version.
  5. Verify Installation: After reinstalling the packages, you can re-run your project or check its dependencies to ensure that everything is working correctly with the downgraded Python version.

By reinstalling the packages and dependencies, you address any potential conflicts or issues that may arise due to the change in Python version. This step is essential for maintaining a stable and functional development environment. With the packages reinstalled, you have successfully completed the process of downgrading your Python version, and your projects should now be ready to run seamlessly with the desired Python version.

noimgs

tags: #comfyui #downgrade #python