{"id":18036,"date":"2024-08-15T16:12:08","date_gmt":"2024-08-15T08:12:08","guid":{"rendered":"https:\/\/www.1ai.net\/?p=18036"},"modified":"2024-08-15T16:12:08","modified_gmt":"2024-08-15T08:12:08","slug":"flux%e5%ae%89%e8%a3%85%e4%bd%bf%e7%94%a8%e6%8c%87%e5%8d%97%ef%bc%8c%e5%8f%88%e4%b8%80%e4%b8%aa%e7%88%86%e7%81%ab%e7%9a%84ai%e7%bb%98%e7%94%bb%e9%a1%b9%e7%9b%ae","status":"publish","type":"post","link":"https:\/\/www.1ai.net\/en\/18036.html","title":{"rendered":"Flux installation and usage guide, another popular AI painting project"},"content":{"rendered":"<div class=\"text-align-left\" data-block=\"true\" data-editor=\"wyh\" data-offset-key=\"5ce1d-0-0\">\n<div class=\"public-DraftStyleDefault-block public-DraftStyleDefault-ltr\" data-offset-key=\"5ce1d-0-0\">\n<p>Flux has become very popular recently, and the portraits have become more realistic and delicate. Can you tell that these pictures are generated by AI?<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18037\" title=\"33667d3cj00si92il0083d000gd00dcm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/33667d3cj00si92il0083d000gd00dcm.jpg\" alt=\"33667d3cj00si92il0083d000gd00dcm\" width=\"589\" height=\"480\" \/><\/p>\n<p>You can even precisely control the text you generate, such as writing on your hands and paper: I am not real.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18038\" title=\"dd109c73j00si92in00lud000sg00sgm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/dd109c73j00si92in00lud000sg00sgm.jpg\" alt=\"dd109c73j00si92in00lud000sg00sgm\" width=\"1024\" height=\"1024\" \/><\/p>\n<p>Whether it is a single person or multiple people, it is difficult to find flaws in facial lighting, skin texture, and hair.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18040\" title=\"a88a78e2j00si92in00qed000u000jim\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/a88a78e2j00si92in00qed000u000jim.jpg\" alt=\"a88a78e2j00si92in00qed000u000jim\" width=\"1080\" height=\"702\" \/><\/p>\n<p>Such realistic pictures can be easily generated using Flux:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18039\" title=\"de4d2201j00si92ii0020d000u000fem\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/de4d2201j00si92ii0020d000u000fem.jpg\" alt=\"de4d2201j00si92ii0020d000u000fem\" width=\"1080\" height=\"554\" \/><\/p>\n<p>today<strong>Step-by-step instruction<\/strong>, teach you how to use Flux.<\/p>\n<p>First experience with Flux<\/p>\n<p>Robin Rombach, a former core member of Stability AI, founded a new company: &quot;Black Forest Labs&quot; and received $32 million in financing.<\/p>\n<p>Flux is their work. The Black Forest Labs Flux.1 model family includes the following three variants:<\/p>\n<ul>\n<li>Flux.1 [pro]: This is the top version of Flux.1, providing state-of-the-art image generation performance, but the model is not open source;<\/li>\n<li>Flux.1 [dev]: open source model, but not commercially available;<\/li>\n<li>Flux.1 [schnell]: This is the fastest model in the Flux.1 model family, optimized for local development and personal use.<\/li>\n<\/ul>\n<p>Currently, ComfyUI has integrated Flux, and the experience can be deployed on ComfyUI.<\/p>\n<p>So today&#039;s tutorial is divided into two parts, ComfyUI installation and Flux installation.<\/p>\n<h5>1. Installation of ComfyUI<\/h5>\n<p>The installation of ComfyUI is very simple. Open the releases address:<\/p>\n<p><strong>https:\/\/github.com\/comfyanonymous\/ComfyUI\/releases<\/strong><\/p>\n<p>You can see the latest startup package and download it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18041\" title=\"677f76eaj00si92im005yd000u000l2m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/677f76eaj00si92im005yd000u000l2m.jpg\" alt=\"677f76eaj00si92im005yd000u000l2m\" width=\"1080\" height=\"758\" \/><\/p>\n<p>You can see these files, double-click run_nvidia_gpu.bat to start ComfyUI.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18042\" title=\"d3b94f55j00si92ij000td000ih007vm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/d3b94f55j00si92ij000td000ih007vm.jpg\" alt=\"d3b94f55j00si92ij000td000ih007vm\" width=\"665\" height=\"283\" \/><\/p>\n<p>If you don&#039;t have an N card, you can use run_cpu.bat to start ComfyUI using only the CPU.<\/p>\n<p>After running successfully, it will automatically open the usage page, like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18043\" title=\"8e8be2e2j00si92il003ld000u000fem\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/8e8be2e2j00si92il003ld000u000fem.jpg\" alt=\"8e8be2e2j00si92il003ld000u000fem\" width=\"1080\" height=\"554\" \/><\/p>\n<p>To use ComfyUI, you must install a plug-in, ComfyUI-Manager.<\/p>\n<p>The installation method is very simple. We open a computer and enter the root directory of the ComfyUI project:<\/p>\n<p>terminal<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18044\" title=\"93fa82f9j00si92im003md000u000f8m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/93fa82f9j00si92im003md000u000f8m.jpg\" alt=\"93fa82f9j00si92im003md000u000f8m\" width=\"1080\" height=\"548\" \/><\/p>\n<p>You can see that my ComfyUI is stored in the directory. Then we go to the custom_nodes directory and use the command:<\/p>\n<p>F:\\Code\\ComfyUI_windows_portable<\/p>\n<p>cd .\\ComfyUI\\custom_nodes\\<\/p>\n<p>Like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18045\" title=\"e0ad17caj00si92im004sd000u000f8m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/e0ad17caj00si92im004sd000u000f8m.jpg\" alt=\"e0ad17caj00si92im004sd000u000f8m\" width=\"1080\" height=\"548\" \/><\/p>\n<p>Then clone the ComfyUI-Manager project locally and use the command:<\/p>\n<p>git clone https:\/\/github.com\/ltdrdata\/ComfyUI-Manager.git<\/p>\n<p>Then restart ComfyUI and you can see the Manager in the lower right corner:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18046\" title=\"7d4b2c06j00si92im003yd000u000ggm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/7d4b2c06j00si92im003yd000u000ggm.jpg\" alt=\"7d4b2c06j00si92im003yd000u000ggm\" width=\"1080\" height=\"592\" \/><\/p>\n<p>This means that ComfyUI is ready.<\/p>\n<h5>2. Flux<\/h5>\n<p>ComfyUI has provided a deployment tutorial for Flux. This is a demo:<\/p>\n<p><strong>https:\/\/comfyanonymous.github.io\/ComfyUI_examples\/flux\/<\/strong><\/p>\n<p>We need to download 4 things in total:<\/p>\n<ul>\n<li>t5xxl_fp16.safetensors: placed in the ComfyUI\/models\/clip\/ directory<\/li>\n<li>clip_l.safetensors: placed in the ComfyUI\/models\/clip\/ directory<\/li>\n<li>ae.safetensors: placed in the ComfyUI\/models\/vae\/ directory<\/li>\n<li>flux1-dev.safetensors: placed in the ComfyUI\/models\/unet\/ directory<\/li>\n<\/ul>\n<p>Download t5xxl_fp16.safetensors and clip_l.safetensors:<\/p>\n<p><strong>https:\/\/huggingface.co\/comfyanonymous\/flux_text_encoders\/tree\/main<\/strong><\/p>\n<p>t5xxl is divided into fp16 and fp8. If your memory exceeds 32GB, use fp16. If not, use fp8.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18047\" title=\"b0ce4f4ej00si92il002id000pq00e8m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/b0ce4f4ej00si92il002id000pq00e8m.jpg\" alt=\"b0ce4f4ej00si92il002id000pq00e8m\" width=\"926\" height=\"512\" \/><\/p>\n<p>ae.safetensors and flux1-dev.safetensors download address:<\/p>\n<p><strong>https:\/\/huggingface.co\/black-forest-labs\/<a href=\"https:\/\/www.1ai.net\/en\/tag\/flux\" title=\"_OTHER ORGANISER\" target=\"_blank\" >FLUX<\/a>.1-dev\/tree\/main<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18048\" title=\"0a5514d5j00si92im005wd000u000g6m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/0a5514d5j00si92im005wd000u000g6m.jpg\" alt=\"0a5514d5j00si92im005wd000u000g6m\" width=\"1080\" height=\"582\" \/><\/p>\n<p>If the GPU performance is insufficient or the video memory is insufficient, you can use the quantized version of the fp8 model, which will be much faster. Download address:<\/p>\n<p><strong>https:\/\/huggingface.co\/Kijai\/flux-fp8\/tree\/main<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18051\" title=\"e890d62bj00si92ik0033d000u00093m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/e890d62bj00si92ik0033d000u00093m.jpg\" alt=\"e890d62bj00si92ik0033d000u00093m\" width=\"1080\" height=\"327\" \/><\/p>\n<p>Just put these 4 models into the corresponding directories.<\/p>\n<p>Finally, let&#039;s download an official picture:<\/p>\n<p><strong>https:\/\/comfyanonymous.github.io\/ComfyUI_examples\/flux\/flux_dev_example.png<\/strong><\/p>\n<p><strong>Be sure to use this link<\/strong>, download the image.<\/p>\n<p>We open ComfyUI and drag this picture into ComfyUI:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18049\" title=\"57f2acd1j00si92im004md000u000fem\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/57f2acd1j00si92im004md000u000fem.jpg\" alt=\"57f2acd1j00si92im004md000u000fem\" width=\"1080\" height=\"554\" \/><\/p>\n<p>You will find that you have opened the entire node workflow of Flux:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18050\" title=\"d8df84f4j00si92im005gd000u000gcm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/d8df84f4j00si92im005gd000u000gcm.jpg\" alt=\"d8df84f4j00si92im005gd000u000gcm\" width=\"1080\" height=\"588\" \/><\/p>\n<p>This is because the image not only stores the information of the image itself, but also the information of each node in the workflow.<\/p>\n<p>We click the Queue Prompt to run the entire workflow:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18052\" title=\"e5d1af0ej00si92im005ed000u000fem\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/e5d1af0ej00si92im005ed000u000fem.jpg\" alt=\"e5d1af0ej00si92im005ed000u000fem\" width=\"1080\" height=\"554\" \/><\/p>\n<p>Wait a moment and you will see the generated image:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18053\" title=\"a4c2570ej00si92ii002bd000u000fem\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/a4c2570ej00si92ii002bd000u000fem.jpg\" alt=\"a4c2570ej00si92ii002bd000u000fem\" width=\"1080\" height=\"554\" \/><\/p>\n<p>I have an RTX 4090. After loading the model, I only run the Clip Text Encode part. For a 1024*1024 image, it takes about 20 seconds to run one image.<\/p>\n<p>This is the official workflow of ComfyUI. You can also use Flux workflows published by other authors, such as this one:<\/p>\n<p><strong>https:\/\/openart.ai\/workflows\/shark_better_98\/realism-no-lora\/3EhdlEU8Edh3xgjYsIQD<\/strong><\/p>\n<p>This is a realistic character workflow, we choose to download:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18054\" title=\"484eca72j00si92im00bhd000u000hem\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/484eca72j00si92im00bhd000u000hem.jpg\" alt=\"484eca72j00si92im00bhd000u000hem\" width=\"1080\" height=\"626\" \/><\/p>\n<p>A json file will be downloaded, which contains the workflow information.<\/p>\n<p>Let&#039;s drag the json file into ComfyUI:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18055\" title=\"7a283d4bj00si92ii001wd000u000fem\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/7a283d4bj00si92ii001wd000u000fem.jpg\" alt=\"7a283d4bj00si92ii001wd000u000fem\" width=\"1080\" height=\"554\" \/><\/p>\n<p>The workflow is updated:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18056\" title=\"90e32ad2j00si92im005ed000u000fem\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/90e32ad2j00si92im005ed000u000fem.jpg\" alt=\"90e32ad2j00si92im005ed000u000fem\" width=\"1080\" height=\"554\" \/><\/p>\n<p>If some nodes are<strong>Red<\/strong>, in an error state, like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18057\" title=\"2cecf254j00si92ii000id0006z006bm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/2cecf254j00si92ii000id0006z006bm.jpg\" alt=\"2cecf254j00si92ii000id0006z006bm\" width=\"251\" height=\"227\" \/><\/p>\n<p>That means you need to install the corresponding plug-in. Click Manager -&gt; Install Missing Custom Nodes to install the missing nodes:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18058\" title=\"63c212ebj00si92im005kd000u000fem\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/63c212ebj00si92im005kd000u000fem.jpg\" alt=\"63c212ebj00si92im005kd000u000fem\" width=\"1080\" height=\"554\" \/><\/p>\n<p>This can solve most of the red nodes. If there are still red errors, it means that the Manager tool does not include this. You can install it through the URL. For example, the ComfyUI-Saveaswebp node cannot be installed through the Manager.<\/p>\n<p>Then you can go to Github and search for the address of ComfyUI-Saveaswebp:<\/p>\n<p><strong>https:\/\/github.com\/Kaharos94\/ComfyUI-Saveaswebp<\/strong><\/p>\n<p>You can select Manager-&gt;Install via Git URL to install this tool:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18059\" title=\"4849dc31j00si92im0060d000u000fem\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/4849dc31j00si92im0060d000u000fem.jpg\" alt=\"4849dc31j00si92im0060d000u000fem\" width=\"1080\" height=\"554\" \/><\/p>\n<p>If it prompts that it is unsafe, you can directly open custom_nodes\\ComfyUI-Manager\\config.ini<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18060\" title=\"7313c9f8j00si92im00bdd000u000llm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/7313c9f8j00si92im00bdd000u000llm.jpg\" alt=\"7313c9f8j00si92im00bdd000u000llm\" width=\"1080\" height=\"777\" \/><\/p>\n<p>Just change security_level = weak.<\/p>\n<p>After all configurations are completed, click Queue Prompt to run the workflow.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18061\" title=\"25fe148dj00si92ii002ad000u000fem\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/08\/25fe148dj00si92ii002ad000u000fem.jpg\" alt=\"25fe148dj00si92ii002ad000u000fem\" width=\"1080\" height=\"554\" \/><\/p>\n<p><strong>The effect is still very amazing!<\/strong><\/p>\n<p>The final generated image can also be combined with the video generation method to further generate AI video.<\/p>\n<p>If many people like the content of this issue, I will continue to release some tutorials on how to make Flux combined with AI videos.<\/p>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Recently Flux has been exploding in popularity, with more realistic and detailed portraits of people. Can you tell that these images were generated by AI? You can even precisely control the generated text, such as writing on hands and paper: I am not real. Whether it's a single person or multiple people, it's hard to see any flaws in the lighting of the face, skin texture, hair, and so on. And such realistic pictures can be easily generated using Flux: today's hands-on instruction to teach you how to use Flux. Flux first experience Former Stability AI core member Robin Rombach founded a new company: \"Black Forest Labs\", and received 32 million dollars in funding. Flux is the work they released. Flux is the work they released, Hessian<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[149,144],"tags":[491,2328,3853],"collection":[],"class_list":{"0":"post-18036","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-jiaocheng","7":"category-baike","8":"tag-ai","10":"tag-flux"},"acf":[],"_links":{"self":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts\/18036","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/comments?post=18036"}],"version-history":[{"count":0,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts\/18036\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/media?parent=18036"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/categories?post=18036"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/tags?post=18036"},{"taxonomy":"collection","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/collection?post=18036"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}