{"id":849,"date":"2024-08-05T11:15:23","date_gmt":"2024-08-05T11:15:23","guid":{"rendered":"https:\/\/zahiralam.com\/blog\/?p=849"},"modified":"2024-08-06T08:01:48","modified_gmt":"2024-08-06T08:01:48","slug":"maximize-your-system-comfyui-on-ubuntu-24-04-without-a-gpu","status":"publish","type":"post","link":"https:\/\/zahiralam.com\/blog\/maximize-your-system-comfyui-on-ubuntu-24-04-without-a-gpu\/","title":{"rendered":"Maximize Your System: ComfyUI on Ubuntu 24.04 Without a GPU"},"content":{"rendered":"\n<p>ComfyUI provides an intuitive, node-based interface for designing and executing advanced Stable Diffusion pipelines. This guide will walk you through installing ComfyUI on Ubuntu 24.04 LTS without a GPU, using Conda for environment management. This setup ensures you can run ComfyUI even if you don&#8217;t have a dedicated GPU.\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p>Before we begin, ensure that you have Ubuntu 24.04 LTS installed and updated. If you don&#8217;t have Conda installed, follow this <a href=\"https:\/\/zahiralam.com\/blog\/conda-installation-on-ubuntu-simplified-step-by-step-instructions-with-activation-and-deactivation\/\">guide on installing Conda on Ubuntu<\/a> to set it up.\n\n\n\n<h2 class=\"wp-block-heading\">Step-by-Step Installation<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Install Conda<\/h3>\n\n\n\n<p>If Conda is not already installed, follow the instructions provided in the <a href=\"https:\/\/zahiralam.com\/blog\/conda-installation-on-ubuntu-simplified-step-by-step-instructions-with-activation-and-deactivation\/\">Conda installation guide<\/a>. Once installed, you can proceed with creating a Conda environment for ComfyUI.\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Create a Conda Environment<\/h3>\n\n\n\n<p>Open a terminal and create a new Conda environment specifically for ComfyUI. We&#8217;ll use Python 3.8 for this setup:\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-1\">conda create -n comfyui python=3.8\nconda activate comfyui<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#conda%20create%20-n%20comfyui%20python%3D3.8%0Aconda%20activate%20comfyui\">\n                            <button class=\"copy-button\" data-label=\"conda create -n comfyui python=3.8\nconda activate comfyui\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Clone the ComfyUI Repository<\/h3>\n\n\n\n<p>Clone the ComfyUI repository from GitHub into a directory of your choice:\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-2\">git clone https:\/\/github.com\/comfyanonymous\/ComfyUI.git\ncd ComfyUI<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#git%20clone%20https%3A%2F%2Fgithub.com%2Fcomfyanonymous%2FComfyUI.git%0Acd%20ComfyUI\">\n                            <button class=\"copy-button\" data-label=\"git clone https:\/\/github.com\/comfyanonymous\/ComfyUI.git\ncd ComfyUI\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Install Dependencies<\/h3>\n\n\n\n<p>Inside the ComfyUI directory, install the required Python packages using <code>pip<\/code>:\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-3\">pip install -r requirements.txt<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#pip%20install%20-r%20requirements.txt\">\n                            <button class=\"copy-button\" data-label=\"pip install -r requirements.txt\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5: Set Up Models<\/h3>\n\n\n\n<p>Create directories for your Stable Diffusion checkpoints and other models:\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-4\">mkdir -p models\/checkpoints models\/vae<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#mkdir%20-p%20models%2Fcheckpoints%20models%2Fvae\">\n                            <button class=\"copy-button\" data-label=\"mkdir -p models\/checkpoints models\/vae\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>Copy your checkpoint files (e.g., <code>.ckpt<\/code>, <code>.safetensors<\/code>) into the <code>models\/checkpoints<\/code> directory. If you have VAE models, place them in <code>models\/vae<\/code>.\n\n\n\n<p>Here\u2019s how your directory structure should look:\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-5\">ComfyUI\/\n\u251c\u2500\u2500 models\/\n\u2502   \u251c\u2500\u2500 checkpoints\/\n\u2502   \u2502   \u251c\u2500\u2500 model.ckpt\n\u2502   \u2502   \u2514\u2500\u2500 model.safetensors\n\u2502   \u251c\u2500\u2500 vae\/\n\u2502   \u2502   \u2514\u2500\u2500 vae_model.ckpt<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#ComfyUI%2F%0A%E2%94%9C%E2%94%80%E2%94%80%20models%2F%0A%E2%94%82%20%20%20%E2%94%9C%E2%94%80%E2%94%80%20checkpoints%2F%0A%E2%94%82%20%20%20%E2%94%82%20%20%20%E2%94%9C%E2%94%80%E2%94%80%20model.ckpt%0A%E2%94%82%20%20%20%E2%94%82%20%20%20%E2%94%94%E2%94%80%E2%94%80%20model.safetensors%0A%E2%94%82%20%20%20%E2%94%9C%E2%94%80%E2%94%80%20vae%2F%0A%E2%94%82%20%20%20%E2%94%82%20%20%20%E2%94%94%E2%94%80%E2%94%80%20vae_model.ckpt\">\n                            <button class=\"copy-button\" data-label=\"ComfyUI\/\n\u251c\u2500\u2500 models\/\n\u2502   \u251c\u2500\u2500 checkpoints\/\n\u2502   \u2502   \u251c\u2500\u2500 model.ckpt\n\u2502   \u2502   \u2514\u2500\u2500 model.safetensors\n\u2502   \u251c\u2500\u2500 vae\/\n\u2502   \u2502   \u2514\u2500\u2500 vae_model.ckpt\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p><strong>Mandatory for Basic Use<\/strong>: Use either <code>.ckpt<\/code> or <code>.safetensors<\/code> for the main model files. You do not need both simultaneously. \n\n\n\n<p><strong>Recommended for Enhanced Quality<\/strong>: Use VAE models for better image synthesis and inpainting. \n\n\n\n<h4 class=\"wp-block-heading\">Obtaining Checkpoint Files and VAE Models<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>From Official Sources<\/strong>:\n<ul class=\"wp-block-list\">\n<li><strong>Hugging Face Model Hub<\/strong>: Hugging Face provides a wide range of models, including Stable Diffusion. You can find and download checkpoints and VAE models from the <a href=\"https:\/\/huggingface.co\/models\" target=\"_blank\" rel=\"noreferrer noopener\">Hugging Face Model Hub<\/a>.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Community Sources<\/strong>:\n<ul class=\"wp-block-list\">\n<li><strong>Civitai<\/strong>: Civitai is a popular community platform where you can find various Stable Diffusion models and VAEs uploaded by other users. Visit <a href=\"https:\/\/civitai.com\/models\" target=\"_blank\" rel=\"noreferrer noopener\">Civitai<\/a> and search for the specific models you need.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Step 6: Install the CPU Version of PyTorch<\/h3>\n\n\n\n<p>Install the CPU version of PyTorch using Conda:\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-6\">conda install pytorch torchvision torchaudio cpuonly -c pytorch<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#conda%20install%20pytorch%20torchvision%20torchaudio%20cpuonly%20-c%20pytorch\">\n                            <button class=\"copy-button\" data-label=\"conda install pytorch torchvision torchaudio cpuonly -c pytorch\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Step 7: Running ComfyUI<\/h3>\n\n\n\n<p>After setting up the dependencies and models, you can run ComfyUI using the following command for CPU-only execution:\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-7\">python main.py --cpu<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#python%20main.py%20--cpu\">\n                            <button class=\"copy-button\" data-label=\"python main.py --cpu\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>This command ensures that ComfyUI runs on the CPU, making it suitable for systems without a GPU.\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>By following these steps, you should have ComfyUI installed and running on your Ubuntu 24.04 LTS system without a GPU. This setup leverages the power of Conda for environment management, ensuring a clean and efficient installation process. If you encounter any issues, refer to the troubleshooting section in the original content or check the <a href=\"https:\/\/github.com\/comfyanonymous\/ComfyUI\" target=\"_blank\" rel=\"noreferrer noopener\">ComfyUI GitHub page<\/a> for further assistance. Enjoy designing your advanced Stable Diffusion workflows with ease!\n","protected":false},"excerpt":{"rendered":"<p>ComfyUI provides an intuitive, node-based interface for designing and executing advanced Stable Diffusion pipelines. This guide will walk you through installing ComfyUI on Ubuntu 24.04 [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":868,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[214],"tags":[40,222,66],"class_list":["post-849","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-installation","tag-ai-without-gpu","tag-comfyui","tag-ubuntu-24-04"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts\/849","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/comments?post=849"}],"version-history":[{"count":18,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts\/849\/revisions"}],"predecessor-version":[{"id":888,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts\/849\/revisions\/888"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/media\/868"}],"wp:attachment":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/media?parent=849"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/categories?post=849"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/tags?post=849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}