{"id":980,"date":"2024-08-19T15:27:05","date_gmt":"2024-08-19T15:27:05","guid":{"rendered":"https:\/\/zahiralam.com\/blog\/?p=980"},"modified":"2024-08-19T17:15:51","modified_gmt":"2024-08-19T17:15:51","slug":"from-text-to-image-install-flux-1-dev-via-webui-forge-on-ubuntu","status":"publish","type":"post","link":"https:\/\/zahiralam.com\/blog\/from-text-to-image-install-flux-1-dev-via-webui-forge-on-ubuntu\/","title":{"rendered":"From Text to Image: Install FLUX.1-dev via WebUI Forge on Ubuntu"},"content":{"rendered":"\n<p>FLUX.1-dev is an advanced model for generating high-quality images. If you&#8217;re looking to harness the power of FLUX.1-dev on your Ubuntu system, this guide will walk you through the necessary steps. From setting up your environment to launching the WebUI, you&#8217;ll have everything you need to start generating stunning images.\n\n\n\n<p><strong>Step 1: Prepare Your Ubuntu System<\/strong>\n\n\n\n<p>Before installing FLUX.1-dev, ensure that your system is up-to-date and that you have Python and pip installed. Additionally, you&#8217;ll need to install <code>aria2<\/code> for downloading the model files.\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Update Your System:<\/strong> Open a terminal and run the following commands:<\/li>\n<\/ol>\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-1\">sudo apt-get update\nsudo apt-get upgrade -y<\/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-get%20update%0Asudo%20apt-get%20upgrade%20-y\">\n                            <button class=\"copy-button\" data-label=\"sudo apt-get update\nsudo apt-get upgrade -y\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\">\n<li><strong>Install Python and pip:<\/strong> If you don&#8217;t already have Python and pip installed, you can do so with:<\/li>\n<\/ol>\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-2\">sudo apt-get install -y python3 python3-pip<\/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-get%20install%20-y%20python3%20python3-pip\">\n                            <button class=\"copy-button\" data-label=\"sudo apt-get install -y python3 python3-pip\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\">\n<li><strong>Install aria2:<\/strong> <code>aria2<\/code> is a utility that will allow us to download the FLUX.1-dev model efficiently.<\/li>\n<\/ol>\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-3\">sudo apt-get install -y aria2<\/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-get%20install%20-y%20aria2\">\n                            <button class=\"copy-button\" data-label=\"sudo apt-get install -y aria2\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p><strong>Step 2: Clone the Stable Diffusion WebUI Repository<\/strong>\n\n\n\n<p>Next, you&#8217;ll need to clone the repository that includes the FLUX.1-dev model.\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\ncd 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#git%20clone%20https%3A%2F%2Fgithub.com%2Flllyasviel%2Fstable-diffusion-webui-forge%0Acd%20stable-diffusion-webui-forge\">\n                            <button class=\"copy-button\" data-label=\"git clone https:\/\/github.com\/lllyasviel\/stable-diffusion-webui-forge\ncd stable-diffusion-webui-forge\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>This command will create a directory called <code>stable-diffusion-webui-forge<\/code> and navigate into it.\n\n\n\n<p><strong>Step 3: Download the FLUX.1-dev Model<\/strong>\n\n\n\n<p>With the repository cloned, you can now download the FLUX.1-dev model using <code>aria2<\/code>.\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-5\">aria2c -c -x 16 -s 16 -k 1M https:\/\/huggingface.co\/lllyasviel\/flux1-dev-bnb-nf4\/resolve\/main\/flux1-dev-bnb-nf4-v2.safetensors -d models\/Stable-diffusion -o flux1-dev-bnb-nf4-v2.safetensors<\/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#aria2c%20-c%20-x%2016%20-s%2016%20-k%201M%20https%3A%2F%2Fhuggingface.co%2Flllyasviel%2Fflux1-dev-bnb-nf4%2Fresolve%2Fmain%2Fflux1-dev-bnb-nf4-v2.safetensors%20-d%20models%2FStable-diffusion%20-o%20flux1-dev-bnb-nf4-v2.safetensors\">\n                            <button class=\"copy-button\" data-label=\"aria2c -c -x 16 -s 16 -k 1M https:\/\/huggingface.co\/lllyasviel\/flux1-dev-bnb-nf4\/resolve\/main\/flux1-dev-bnb-nf4-v2.safetensors -d models\/Stable-diffusion -o flux1-dev-bnb-nf4-v2.safetensors\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>This command downloads the FLUX.1-dev model and saves it in the <code>models\/Stable-diffusion<\/code> directory.\n\n\n\n<p><strong>Step 4: Configure the WebUI<\/strong>\n\n\n\n<p>Before launching the WebUI, you may need to pass specific arguments, especially if you&#8217;re using FLUX.1-dev. One important argument is <code>--disable-xformers<\/code>, which ensures compatibility with FLUX.1-dev.\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-6\">python launch.py --theme dark --disable-xformers<\/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%20launch.py%20--theme%20dark%20--disable-xformers\">\n                            <button class=\"copy-button\" data-label=\"python launch.py --theme dark --disable-xformers\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>This command will start the WebUI with a dark theme and disable Xformers, which is necessary for FLUX.1-dev to run correctly.\n\n\n\n<p>\n\n\n\n<p><strong>Conclusion<\/strong>\n\n\n\n<p>By following these steps, you can successfully install and run FLUX.1-dev on your Ubuntu system. Whether you&#8217;re an artist or a developer, FLUX.1-dev offers a powerful toolset for creating stunning images. Experiment with different models, embeddings, and upscalers to get the best results from your setup.\n\n\n\n<p>Happy generating!\n\n\n\n<p><strong>Note:<\/strong> If you run into any issues during installation or usage, ensure that all dependencies are correctly installed and that your system meets the necessary requirements. For further customization or troubleshooting, refer to the official documentation of the tools and models you&#8217;re using.\n","protected":false},"excerpt":{"rendered":"<p>FLUX.1-dev is an advanced model for generating high-quality images. If you&#8217;re looking to harness the power of FLUX.1-dev on your Ubuntu system, this guide will [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":998,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[214],"tags":[228,229,18,38],"class_list":["post-980","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-installation","tag-flux-1","tag-text-to-image","tag-ubuntu","tag-webui-forge"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts\/980","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=980"}],"version-history":[{"count":2,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts\/980\/revisions"}],"predecessor-version":[{"id":984,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts\/980\/revisions\/984"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/media\/998"}],"wp:attachment":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/media?parent=980"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/categories?post=980"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/tags?post=980"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}