Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Fixing Fooocus on Windows with NVIDIA 50xx and CUDA 12.8 (Driver 572.42 Game Ready) #1159

Open
KoholSzkodzi opened this issue Feb 17, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@KoholSzkodzi
Copy link

Proposal

⚙️ Solution for Fooocus on Windows with NVIDIA 50xx Series (Tested on 5090 with Driver 572.42 Game Ready)

This guide explains how to fix compatibility issues for Stability Matrix with Fooocus on Windows using an NVIDIA 50xx series GPU (like the 5090).


🔗 Prerequisites: CUDA 12.8

You need CUDA 12.8 installed on your system for this to work.

⚠️ Important Note:

During the installation:

  • Select “Custom Install”
  • Uncheck the Graphics Drivers (The drivers included may be outdated, and using the latest Game Ready driver 572.42 is recommended).

Solution Overview

To get Fooocus working with your NVIDIA 5090, you’ll need to install a custom version of PyTorch and Torchvision that supports CUDA 12.8. Here’s how to do it:


1. 🔗 Download Compatible PyTorch and Torchvision


2. 📂 Locate the Virtual Environment

  • Find the virtual environment used by Fooocus. It’s usually here:
    C:\Users\*your_username*\AppData\Roaming\StabilityMatrix\Packages\Fooocus\venv
    
  • Navigate to this folder using File Explorer.

3. 💻 Open Command Prompt in the Correct Directory

  • In File Explorer, click on the path bar (where the folder path is displayed).
  • Type cmd and press Enter. This opens Command Prompt directly in that folder.

4. ✅ Activate the Virtual Environment

In the Command Prompt, type:

activate

You should see something like (venv) at the start of the command line.


5. 📥 Install PyTorch and Torchvision

  • Go to the folder where you downloaded the .whl files for PyTorch and Torchvision.
  • Right-click on the PyTorch file and select Copy as path.
  • In the Command Prompt, type:
    pip install "paste your file path here"
  • If it says a version is already installed, use:
    pip install "paste your file path here" --force-reinstall
  • Repeat for the Torchvision file:
    pip install "torchvision file path"
    Or, if needed:
    pip install "torchvision file path" --force-reinstall

6. 🚫 Deactivate the Virtual Environment

Once the installation is complete, type:

deactivate

This exits the virtual environment.


Done!

Your Fooocus setup should now work without errors on your NVIDIA 5090 GPU with driver 572.42 Game Ready.

@KoholSzkodzi KoholSzkodzi added the enhancement New feature or request label Feb 17, 2025
@khoidang
Copy link

I assume I can just do the same for ComfyUI?

@mohnjiles
Copy link
Contributor

mohnjiles commented Feb 18, 2025

Yes, this should work for most webUIs for 5000-series cards until there's an official release of torch with cuda 12.8.

However, you can save yourself some headache by using our built-in Python Packages dialog (in the 3-dots menu on the Packages page) to skip all the manual venv activation stuff in steps 2-4 and just go straight to step 5 like so:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants