{"id":158,"date":"2025-10-12T11:12:19","date_gmt":"2025-10-12T11:12:19","guid":{"rendered":"https:\/\/epimythos.com\/?p=158"},"modified":"2025-10-12T11:12:19","modified_gmt":"2025-10-12T11:12:19","slug":"comfyui-beginnings","status":"publish","type":"post","link":"https:\/\/epimythos.com\/?p=158","title":{"rendered":"ComfyUI Beginnings"},"content":{"rendered":"\n<p>I have been very quiet here on the Epimythos front but I wanted to share something. Up until now, I didn&#8217;t have a proper video card so I couldn&#8217;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).<\/p>\n\n\n\n<h1 class=\"wp-block-heading has-x-large-font-size\">How to Properly Set Up ComfyUI (and Avoid the \u201cGlobal Python Trap\u201d)<\/h1>\n\n\n\n<p>Learning ComfyUI myself, I ran into something that trips up almost every beginner: <strong>not setting up a venv<\/strong> \u2014 a Python <em>virtual environment<\/em>.<\/p>\n\n\n\n<p>If you\u2019re 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 \u2014 the \u201cTemplates\u201d tab in the sidebar is gold).<\/p>\n\n\n\n<p>But then you load a workflow, and it complains about <strong>missing custom nodes<\/strong>. You install those nodes\u2026 and their <em>requirements<\/em>. And that\u2019s where the trouble starts.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">The Pitfall: Installing Requirements Globally<\/h2>\n\n\n\n<p>You install dependencies using:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">pip install -r requirements.txt<br><\/pre>\n\n\n\n<p>It works \u2014 but if you haven\u2019t set up a <strong>venv<\/strong>, you\u2019re installing those packages into your <em>global<\/em> Python environment.<\/p>\n\n\n\n<p>That\u2019s a recipe for version conflicts down the road.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">The Fix: Migrate Everything Into a Virtual Environment<\/h2>\n\n\n\n<p>Don\u2019t worry \u2014 there\u2019s an easy way to clean things up and move all your packages into a safe sandboxed environment.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1. Save your current packages<\/h3>\n\n\n\n<p>Open a Command Prompt in your ComfyUI folder and run:<\/p>\n\n\n\n<p>pip freeze > requirements.txt<\/p>\n\n\n\n<p>This saves every installed package to a text file in that folder.<br>You can confirm it worked with:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dir \/w<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2. Create a virtual environment<\/h3>\n\n\n\n<p>Still in your ComfyUI folder:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">python -m venv venv<\/pre>\n\n\n\n<p>This creates a folder named <code>venv\/<\/code>, which will hold your isolated Python setup.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3. Activate it<\/h3>\n\n\n\n<p>Windows:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd venv\\Scripts<br>Activate<\/pre>\n\n\n\n<p>You\u2019ll know it\u2019s working if your prompt changes to show <code>(venv)<\/code>:<\/p>\n\n\n\n<p>(venv) C:\\Users\\\\Documents\\ComfyUI><\/p>\n\n\n\n<p>If you get lost, a free AI like ChatGPT can help walk you through the commands \u2014 your setup may differ slightly, or a lot if you&#8217;re on Linux obviously.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4. Install Git (if you haven\u2019t yet)<\/h3>\n\n\n\n<p>You\u2019ll want GitHub for downloading ComfyUI and custom nodes directly.<br>Install Git for Windows, then you can use commands like:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd C:\\Users\\&lt;YourName>\\Documents\\ComfyUI<br>git clone https:\/\/github.com\/comfyanonymous\/ComfyUI.git<\/pre>\n\n\n\n<p>This will create a <strong>ComfyUI folder inside your ComfyUI folder<\/strong>, which is fine \u2014 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.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5. Install ComfyUI\u2019s requirements<\/h3>\n\n\n\n<p>Now go into that new cloned folder and install its dependencies:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd ComfyUI<br>pip install -r requirements.txt<\/pre>\n\n\n\n<p><em>(This is the step I missed the first time \u2014 and spent 30 minutes wondering why things weren\u2019t working!)<\/em><\/p>\n\n\n\n<p>Then, if you saved your global packages earlier:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd ..<br>pip install -r requirements.txt<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 6. Launch ComfyUI via a Batch File<\/h3>\n\n\n\n<p>Instead of using your old desktop shortcut, create a new <code>.bat<\/code> file to launch ComfyUI from your venv.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">@echo off<br>cd \/d C:\\Users\\&lt;YourName>\\Documents\\ComfyUI<br>call venv\\Scripts\\activate<br>cd \/d C:\\Users\\&lt;YourName>\\Documents\\ComfyUI\\ComfyUI<br>python main.py<\/pre>\n\n\n\n<p>Double-click this <code>.bat<\/code> file anytime you want to start the ComfyUI server.<br>Once it\u2019s running, open your browser and go to:<\/p>\n\n\n\n<p><a href=\"http:\/\/127.0.0.1:8188\/\">http:\/\/127.0.0.1:8188\/<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Copy Over Your Workflows and Models<\/h2>\n\n\n\n<p>Your new setup will look empty at first.<br>To get back to where you were, copy your existing files:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Workflows:<\/strong> from <code>AppData\\Local\\Programs\\ComfyUI\\resources\\ComfyUI\\user\\workflows<\/code><\/li>\n\n\n\n<li><strong>Models:<\/strong> from <code>AppData\\Local\\Programs\\ComfyUI\\resources\\ComfyUI\\models<\/code><\/li>\n<\/ul>\n\n\n\n<p>Place them in the corresponding folders inside your new ComfyUI directory under <code>Documents<\/code>.<br>(Or use symbolic links if you want to avoid duplicating those huge model files \u2014 mine were ~230 GB!)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">That\u2019s It<\/h2>\n\n\n\n<p>You\u2019ve just gone from ComfyUI casual user to <em>power user<\/em> \u2014 with a clean, isolated Python setup, and hopefully a much better idea of how to control your dependencies and manage your computation environment.<\/p>\n\n\n\n<p>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&#8217;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&#8217;ll just leave my Windows install there, doesn&#8217;t really bother me.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been very quiet here on the Epimythos front but I wanted to share something. Up until now, I didn&#8217;t have a proper video card so I couldn&#8217;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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-158","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/epimythos.com\/index.php?rest_route=\/wp\/v2\/posts\/158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/epimythos.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/epimythos.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/epimythos.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/epimythos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=158"}],"version-history":[{"count":1,"href":"https:\/\/epimythos.com\/index.php?rest_route=\/wp\/v2\/posts\/158\/revisions"}],"predecessor-version":[{"id":159,"href":"https:\/\/epimythos.com\/index.php?rest_route=\/wp\/v2\/posts\/158\/revisions\/159"}],"wp:attachment":[{"href":"https:\/\/epimythos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/epimythos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/epimythos.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}