I have been very quiet here on the Epimythos front but I wanted to share something. Up until now, I didn’t have a proper video card so I couldn’t run AI locally, and I made all of my images for Epimythos on ChatGPT with edits from my PC in Affinity. However, I did go ahead and splurge on a modern card, and a new PSU, bringing my PC firmly into the current age (my old card was 11 years old).
How to Properly Set Up ComfyUI (and Avoid the “Global Python Trap”)
Learning ComfyUI myself, I ran into something that trips up almost every beginner: not setting up a venv — a Python virtual environment.
If you’re like me, you probably jumped right in: installed ComfyUI, got it to stop outputting pure noise, started adding LoRAs, and maybe even downloaded some community workflows (which I highly recommend — the “Templates” tab in the sidebar is gold).
But then you load a workflow, and it complains about missing custom nodes. You install those nodes… and their requirements. And that’s where the trouble starts.
The Pitfall: Installing Requirements Globally
You install dependencies using:
pip install -r requirements.txt
It works — but if you haven’t set up a venv, you’re installing those packages into your global Python environment.
That’s a recipe for version conflicts down the road.
The Fix: Migrate Everything Into a Virtual Environment
Don’t worry — there’s an easy way to clean things up and move all your packages into a safe sandboxed environment.
Step 1. Save your current packages
Open a Command Prompt in your ComfyUI folder and run:
pip freeze > requirements.txt
This saves every installed package to a text file in that folder.
You can confirm it worked with:
dir /w
Step 2. Create a virtual environment
Still in your ComfyUI folder:
python -m venv venv
This creates a folder named venv/, which will hold your isolated Python setup.
Step 3. Activate it
Windows:
cd venv\Scripts
Activate
You’ll know it’s working if your prompt changes to show (venv):
(venv) C:\Users\\Documents\ComfyUI>
If you get lost, a free AI like ChatGPT can help walk you through the commands — your setup may differ slightly, or a lot if you’re on Linux obviously.
Step 4. Install Git (if you haven’t yet)
You’ll want GitHub for downloading ComfyUI and custom nodes directly.
Install Git for Windows, then you can use commands like:
cd C:\Users\<YourName>\Documents\ComfyUI
git clone https://github.com/comfyanonymous/ComfyUI.git
This will create a ComfyUI folder inside your ComfyUI folder, which is fine — it keeps everything contained. If you want to have the option to easily uninstall the copy of ComfyUI that you installed on Windows (not this venv instance of it) then you may consider at this point whether you should relocate your venv and your clone of ComfyUI.
Step 5. Install ComfyUI’s requirements
Now go into that new cloned folder and install its dependencies:
cd ComfyUI
pip install -r requirements.txt
(This is the step I missed the first time — and spent 30 minutes wondering why things weren’t working!)
Then, if you saved your global packages earlier:
cd ..
pip install -r requirements.txt
Step 6. Launch ComfyUI via a Batch File
Instead of using your old desktop shortcut, create a new .bat file to launch ComfyUI from your venv.
Example:
@echo off
cd /d C:\Users\<YourName>\Documents\ComfyUI
call venv\Scripts\activate
cd /d C:\Users\<YourName>\Documents\ComfyUI\ComfyUI
python main.py
Double-click this .bat file anytime you want to start the ComfyUI server.
Once it’s running, open your browser and go to:
Copy Over Your Workflows and Models
Your new setup will look empty at first.
To get back to where you were, copy your existing files:
- Workflows: from
AppData\Local\Programs\ComfyUI\resources\ComfyUI\user\workflows - Models: from
AppData\Local\Programs\ComfyUI\resources\ComfyUI\models
Place them in the corresponding folders inside your new ComfyUI directory under Documents.
(Or use symbolic links if you want to avoid duplicating those huge model files — mine were ~230 GB!)
That’s It
You’ve just gone from ComfyUI casual user to power user — with a clean, isolated Python setup, and hopefully a much better idea of how to control your dependencies and manage your computation environment.
As mentioned earlier, you will be creating a new, empty setup. Your new input and output directories will be different, everything will be in the ComfyUI/ComfyUI folder except everything that you symbolically linked using the yaml file. Don’t uninstall Comfy directly after. You will want to make steps to ensure that the Comfy/Comfy folder is backed up elsewhere first, you will also want a new pip freeze of your requirements at that time, if that makes sense. Me personally, I’ll just leave my Windows install there, doesn’t really bother me.

Leave a Reply