Flux is an advanced tool designed for generating high-quality images using machine learning models. By leveraging the capabilities of various neural networks, Flux AI acts as a powerful image generator that produces visually stunning results. In this tutorial series on how to use Flux models, you’ll learn how to set it up effectively. We’ll explore the comparison between Flux and Comfy-UI workflows, how to choose the best Flux models, select parameters for optimal results, and utilize Flux to generate impressive visuals. We’ll also cover techniques for upscaling images. Let’s dive into the setup process for Flux in Comfy-UI.
Chapter 1: Setting Up the Flux Ecosystem
Flux currently offers three models. The FLUX Dev Model includes FP8 and FP16 clips, as well as the Schnell Model, Next-Gen Flux Model, and GPT Generated Unified Format Model. Mimic PC at present offers Flux, Schnell, and NF4 models pre-installed with their particular clips. So, let's focus on installing the remaining files.
You can download the GGUF Model using Hugging Face. However, it allows you to download whichever size suits your needs. For example, if you need 8GB of storage, you can download the 8GB size. The larger the size, the more detail it contains. Download it by clicking here. Upload it into U-net folder present in models folder.
https://huggingface.co/city96/FLUX.1-dev-gguf/tree/main
Next, we have the GGUF Node Package. It includes some of the nodes required for the GGUF Model. So, to install this onto your Mimic PC. Simply copy the GitHub link, and paste it into the custom-nodes folders.
https://github.com/city96/ComfyUI-GGUF
The next node package is for NF4. It includes some of the nodes required for using the Next-Gen Flux Model. So, to install this onto your Mimic PC. Simply copy the GitHub link, and paste it into the custom-nodes folders.
https://github.com/comfyanonymous/ComfyUI_bitsandbytes_NF4
The next node package is of X-labs. It contains some of the needed nodes that are used when creating images. So, to install this onto your Mimic PC. Simply copy the GitHub link, and paste it into the custom-nodes folders.
https://github.com/XLabs-AI/x-flux-comfyui
Next up is Lora's, available in hugging face. It contains some of the most popular Lora’s. Make sure you only download the comfy converted loras. So, click here to download them, then upload them to Lora's folder in Mimic PC.
https://huggingface.co/XLabs-AI/flux-lora-collection/tree/main
Now let us download three Control-Nets. The HED, canny, and depth using hugging face. Only download the largest size available in the folder. Once you've downloaded all the three Control Net files. Go to Mimic PC. Click on models, then create a new folder named X-labs. Inside, Create another folder named control nets. Finally, upload all three control net files that we recently downloaded.
https://huggingface.co/XLabs-AI/flux-controlnet-hed-v3/tree/main
https://huggingface.co/XLabs-AI/flux-controlnet-canny-v3/tree/main
https://huggingface.co/XLabs-AI/flux-controlnet-depth-v3/tree/main
Finally, let's add one more necessary Node within Comfy-UI. Go to manager and select "Install Custom Nodes". Search for "Essentials" and download this two nodes. Once they have installed make sure to relaunch your Comfy-UI App. We have now successfully installed all of the required files, to use Flux on Mimic PC.
Chapter 2: Comparing Flux Workflow vs Comfy-UI Workflow
Now, let’s quickly compare the Flux workflow with Comfy-UI. The Flux workflow and Comfy-UI are two different tools for generative image workflows. Comfy-UI offers flexibility and control, while Flux is simpler and easier for beginners. The choice depends on individual needs and preferences. In summary, Users looking for advanced customization can go with Comfy-UI workflows. If you're new to generative image, Flux could be a better fit.
To remove an existing Comfy-UI Workflow, simply click the "Clear" button. To add a node, simply click twice in the clip-space. The search bar will appear. Look for "U-Net Loader" and add this node. Again, click twice, search, and add "Dual Clip Loader". Next, search "Load VAE" and add it to your clip-space. Look for "Clip text encode prompt" and add it. Copy and paste this same node below. The node above is for positive prompts, while the second is for negative prompts. Look for "Empty latent image" and add it. Search for "K-Sampler" and add it. Look for "Flux Guidance" and add it. Search for "VAE Decode" and add it. Finally, add the "Save Image" node in your clip-space. Now let's link all of those wires to their corresponding nodes. If you encounter any red errors during this process. Make sure to go into your Manager, update it, and resolve any issues. Finally, we have created the Flux Workflow by adding all of the required nodes in Mimic PC.
Chapter 3: Choosing the Best Flux Model for Your Needs
Now that our setup is complete, let's choose the best Flux model based on different specific needs. I have created five groups to show a comparison between these models. Given the same seed and same prompt to all the models. With sampler “Euler” and scheduler as “Beta”. So, lets generate images using these models. I’ll skip the generation process. As you can see, all images have been generated. Here's a side-by-side comparison of the all images.
FP8 VS FP16
FP16 is for highly detailed images, though it takes more time and memory to generate. FP8 offers a faster generation time with similar quality to FP16 but with slightly less detail. Schnell uses less memory and time but produces more cartoonish-like images. For the fastest results, NF4 and GGUF are your best options. They generate images similar to FP8 but in even less time. However, they require completely different workflows. Refer to this table to select a model which suits your needs.
Chapter 4: Parameter Selection – Why It Matters
Alright, now let’s dive into parameter selection. First up, the Guidance Value. Don’t set it too high, A guidance value of 3.5 is recommended for balanced results. Here’s how different values impact your images.
Next, the CFG Value. The recommended CFG value is 1.0. Here’s how different values impact your images. Adjust these values based on your needs to achieve optimal results. Experiment with them to find the best settings for your projects!
Chapter 5: Using Flux for Text-to-Image Generation
Let us now use Flux to generate an image. Enter your positive and negative prompts in the following boxes. Change the CFG value to 1. Change Scheduler to “Beta”. We will keep the recommended guiding value of 3 point 5. Set the width and height to
“1024 pixels”. Finally, click the “Queue Prompt” to start creating your image. The image will be generated quickly because it is a Flux FP8 Model. Look, our image had been generated. As you can see, Flux has done an excellent job with the model and text.
Chapter 6: Flux High-Resolution Upscaling
Now that we've learned how to create an image, let's look at how to upscale it using Flux. So, we need to add additional nodes to our existing workflow. Click twice in the clip space. The search bar will appear. Look for the "Clip text encode prompt" and add it. Again, click twice, search, and add "Load Upscale Model". Next, find "Ultimate SD Upscale" and add it. Finally, add the "Save Image" node into your clip-space. At first, you might see "Null Model Name" in the "Load Upscale Model" Node. So, to add an upscaler model. Navigate to Manager and click "Install Models". Search for "Upscaler" and download your preferred model. After they have been installed, make sure to restart your Comfy-UI App.
The “Ultimate SD Upscaler” has several settings. The “Upscale By” setting upscales an image by a factor of two. Change the CFG value to one. Set Scheduler to "Beta". And will keep the rest of the settings the same. Make sure you've chosen an Upscaler model. Now connect all of those wires to their respective nodes. Finally, we have created a “Flux Upscaling Workflow” in Mimic PC.
Let us now create an image using an Upscaler. As I've already entered the prompt. I'll simply click the "Queue Prompt" button. As you can see our image has been generated. Here is a comparison of the before and after results.
Conclusion
That wraps up our beginner’s guide to using Flux for image generation. We've covered everything from setting up your workflow to choosing models and fine-tuning parameters and images. With these basics, you’re now ready to start exploring Flux's powerful features in MimicPC! Login to use!