{"id":174,"date":"2024-02-20T06:47:14","date_gmt":"2024-02-20T06:47:14","guid":{"rendered":"https:\/\/zahiralam.com\/blog\/?p=174"},"modified":"2024-08-19T15:54:08","modified_gmt":"2024-08-19T15:54:08","slug":"installing-and-running-stable-diffusion-webui-forge-on-cpu-only-ubuntu-systems","status":"publish","type":"post","link":"https:\/\/zahiralam.com\/blog\/installing-and-running-stable-diffusion-webui-forge-on-cpu-only-ubuntu-systems\/","title":{"rendered":"Installing and Running Stable Diffusion WebUI-Forge on CPU-Only Ubuntu Systems"},"content":{"rendered":"\n<p>Stable Diffusion WebUI-Forge is a user-friendly interface for text-to-image AI models, designed to work with the Stable Diffusion model. This article provides a comprehensive guide on how to install the WebUI-Forge on an CPU-based Ubuntu system without a GPU. The installation process involves setting up a Python environment, cloning the repository, and running the application with CPU-specific settings.\n\n\n\n<p><strong>Pro Tip<\/strong>: If you&#8217;re interested in exploring the cutting-edge FLUX.1-dev model for creating stunning images, don&#8217;t miss my latest guide. Learn how to install it via WebUI Forge on Ubuntu here:\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-zahirs-blog wp-block-embed-zahirs-blog\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"XqoogIjaSz\"><a href=\"https:\/\/zahiralam.com\/blog\/from-text-to-image-install-flux-1-dev-via-webui-forge-on-ubuntu\/\">From Text to Image: Install FLUX.1-dev via WebUI Forge on Ubuntu<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;From Text to Image: Install FLUX.1-dev via WebUI Forge on Ubuntu&#8221; &#8212; Zahirs Blog\" src=\"https:\/\/zahiralam.com\/blog\/from-text-to-image-install-flux-1-dev-via-webui-forge-on-ubuntu\/embed\/#?secret=AgaKwJMMoI#?secret=XqoogIjaSz\" data-secret=\"XqoogIjaSz\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Steps to Install WebUI-Forge on Ubuntu with an Intel CPU (No GPU):<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. Ensure your system is updated:<\/h3>\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-1\">sudo apt update\nsudo apt upgrade<\/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#sudo%20apt%20update%0Asudo%20apt%20upgrade\">\n                            <button class=\"copy-button\" data-label=\"sudo apt update\nsudo apt upgrade\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<h3 class=\"wp-block-heading\">2. Install Miniconda or Anaconda to manage Python environments:<\/h3>\n\n\n\n<p>Download and follow the instructions from below mentioned tutorial:&nbsp;\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-zahirs-blog wp-block-embed-zahirs-blog\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"rj3kqauiOS\"><a href=\"https:\/\/zahiralam.com\/blog\/conda-installation-on-ubuntu-simplified-step-by-step-instructions-with-activation-and-deactivation\/\">Conda Installation on Ubuntu: Simplified Step-by-Step Instructions with Activation and Deactivation<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Conda Installation on Ubuntu: Simplified Step-by-Step Instructions with Activation and Deactivation&#8221; &#8212; Zahirs Blog\" src=\"https:\/\/zahiralam.com\/blog\/conda-installation-on-ubuntu-simplified-step-by-step-instructions-with-activation-and-deactivation\/embed\/#?secret=JmCH3KQ7dx#?secret=rj3kqauiOS\" data-secret=\"rj3kqauiOS\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">3. Create a new Conda environment with Python 3.10:<\/h3>\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-2\">conda create -n webui-forge python=3.10<\/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%20webui-forge%20python%3D3.10\">\n                            <button class=\"copy-button\" data-label=\"conda create -n webui-forge python=3.10\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<h3 class=\"wp-block-heading\">4. Activate the newly created Conda environment:<\/h3>\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-3\">conda activate webui-forge<\/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%20activate%20webui-forge\">\n                            <button class=\"copy-button\" data-label=\"conda activate webui-forge\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<h3 class=\"wp-block-heading\">5. Clone the Stable Diffusion WebUI-Forge repository:<\/h3>\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-4\">git clone https:\/\/github.com\/lllyasviel\/stable-diffusion-webui-forge.git<\/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%2Flllyasviel%2Fstable-diffusion-webui-forge.git\">\n                            <button class=\"copy-button\" data-label=\"git clone https:\/\/github.com\/lllyasviel\/stable-diffusion-webui-forge.git\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<h3 class=\"wp-block-heading\">6. Navigate to the cloned repository directory:<\/h3>\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-5\">cd stable-diffusion-webui-forge<\/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#cd%20stable-diffusion-webui-forge\">\n                            <button class=\"copy-button\" data-label=\"cd stable-diffusion-webui-forge\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<h3 class=\"wp-block-heading\">7. Run the WebUI script with CPU-only flags:<\/h3>\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-6\">.\/webui.sh --always-cpu --skip-torch-cuda-test<\/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#.%2Fwebui.sh%20--always-cpu%20--skip-torch-cuda-test\">\n                            <button class=\"copy-button\" data-label=\".\/webui.sh --always-cpu --skip-torch-cuda-test\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>The <code>--always-cpu<\/code> flag tells the script to use the CPU for processing, while <code>--skip-torch-cuda-test<\/code> skips the CUDA compatibility test, which is unnecessary for CPU-only setups.\n\n\n\n<p>\n\n\n\n<p>\n\n\n\n<h2 class=\"wp-block-heading\">FAQs and Troubleshooting:<\/h2>\n\n\n\n<p>Q: What if I encounter a &#8220;command not found&#8221; error when running the script?<br>A: Ensure you have the necessary execution permissions for the script:\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-7\">chmod +x webui.sh<\/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#chmod%20%2Bx%20webui.sh\">\n                            <button class=\"copy-button\" data-label=\"chmod +x webui.sh\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>\n\n\n\n<p>Q: How do I resolve dependency issues during installation?<br>A: Make sure to update Conda and install any missing dependencies manually:\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-8\">conda update --all\nconda install<\/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%20update%20--all%0Aconda%20install\">\n                            <button class=\"copy-button\" data-label=\"conda update --all\nconda install\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>\n\n\n\n<p>Q: The script is running, but I can&#8217;t access the WebUI. What should I do?<br>A: Check if the server is running on the correct port and ensure your firewall settings allow traffic on that port.\n\n\n\n<p>\n\n\n\n<p>Q: What if I encounter a memory error while running the model on CPU?<br>A: Running AI models on a CPU can be memory-intensive. Close unnecessary applications to free up RAM or consider adding more RAM to your system.\n\n\n\n<p>\n\n\n\n<p>Q: How can I resolve issues with incompatible Python packages?<br>A: Use Conda to manage package versions and resolve conflicts:\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-9\">conda install =<\/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%20%3D\">\n                            <button class=\"copy-button\" data-label=\"conda install =\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>\n\n\n\n<p>Q: What if I encounter a &#8216;missing package&#8217; error during installation?<br>A: Ensure all dependencies are installed. You can install missing packages using <code>pip<\/code> or <code>conda<\/code>.\n\n\n\n<p>\n\n\n\n<p>Q: The script fails to start, mentioning a lack of GPU. What should I do?<br>A: Make sure you included the <code>--always-cpu<\/code> flag when running the script to force CPU mode.\n\n\n\n<p>\n\n\n\n<p>Q: I&#8217;m experiencing slow performance. Is this normal?<br>A: Yes, running AI models on a CPU is significantly slower than on a GPU. Be patient with processing times.\n\n\n\n<p>\n\n\n\n<p>Q: How can I update the WebUI-Forge to the latest version?<br>A: Pull the latest changes from the GitHub repository using <code>git pull<\/code> and rerun the installation script\n\n\n\n<p>\n\n\n\n<p>Q: What should I do if I encounter a Python or Conda environment-related issue?<br>A: Verify that the correct Python version is being used and that all dependencies are compatible. Re-create the Conda environment if necessary.\n\n\n\n<p>\n\n\n\n<p>Q: What if I encounter a &#8216;ModuleNotFoundError&#8217; after running the <code>.\/webui.sh<\/code> script?<br>A: Ensure all required Python packages are installed. You may need to install missing modules using <code>pip install<\/code>.\n\n\n\n<p>\n\n\n\n<p>Q: I&#8217;m getting an &#8216;Out of Memory&#8217; error. How can I fix this?<br>A: Try increasing the swap space on your Ubuntu system or close other memory-intensive applications while running the web UI.\n\n\n\n<p>\n\n\n\n<p>Q: The installation is taking a long time or hanging. What&#8217;s wrong?<br>A: Check your internet connection and ensure that GitHub is not experiencing downtime. Also, verify that you have sufficient disk space.\n\n\n\n<p>\n\n\n\n<p>Q: The web UI doesn&#8217;t start, and I see a &#8216;Permission denied&#8217; error.**<br>A: Make the <code>webui.sh<\/code> script executable by running <code>chmod +x webui.sh<\/code> and then try running it again.\n\n\n\n<p>\n\n\n\n<p>Q: How can I access the web UI from a browser?<br>A: Once the web UI is running, open a web browser and navigate to <code>http:\/\/localhost:7860<\/code> or the IP address and port specified in the terminal output.\n\n\n\n<p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion:<\/h2>\n\n\n\n<p>With these steps, you can successfully install and run Stable Diffusion WebUI-Forge on your Intel CPU-powered Ubuntu system. Enjoy exploring the world of AI-generated art without the need for a GPU.\n","protected":false},"excerpt":{"rendered":"<p>Stable Diffusion WebUI-Forge is a user-friendly interface for text-to-image AI models, designed to work with the Stable Diffusion model. This article provides a comprehensive guide [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":725,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[36,37,18],"class_list":["post-174","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-artificial-intelligence","tag-conda","tag-stable-diffusion","tag-ubuntu"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts\/174","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=174"}],"version-history":[{"count":6,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts\/174\/revisions"}],"predecessor-version":[{"id":996,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts\/174\/revisions\/996"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/media\/725"}],"wp:attachment":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/media?parent=174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/categories?post=174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/tags?post=174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}