[AI tutorial]ComfyUI FLUX.1 Installation

Introducing Flux

Today, we’re going to discuss Flux, an AI image generation program released on August 1st. Flux stands out for its 12 billion parameters, which contribute to its impressive generation capabilities. Many users claim that Flux produces better results than Stable Diffusion 3.0.

A screenshot of the Flux AI model's page on Hugging Face, showcasing a grid of sample images generated by the AI, including images of a panda, a girl, and a duck.
A screenshot of the Flux AI model’s page on Hugging Face, showcasing a grid of sample images generated by the AI, including images of a panda, a girl, and a duck.

To understand Flux better, we can look at the description provided on its Hugging Face page. However, the English text might be challenging to understand, so we can easily translate the page into Chinese.

A screenshot of the Hugging Face page for Flux AI, with the page translated into Chinese. The text mentions that Flux is a 12 billion parameter AI model.
A screenshot of the Hugging Face page for Flux AI, with the page translated into Chinese. The text mentions that Flux is a 12 billion parameter AI model.

The translation reveals that Flux is a 12 billion parameter AI generation program, which explains why its generated images are superior to those of Stable Diffusion.

Using Flux with ComfyUI

To start using Flux, we need to use ComfyUI. You’ll need the latest version of ComfyUI to access the Flux-related nodes. To begin, go to the ComfyUI website and download the Flux workflow.

A screenshot of a ComfyUI webpage showing a download section for the Flux workflow, highlighting the instructions for installing necessary models: Flux, CLIP, and VAE.
A screenshot of a ComfyUI webpage showing a download section for the Flux workflow, highlighting the instructions for installing necessary models: Flux, CLIP, and VAE.

After downloading the workflow, you’ll need to install the model, CLIP, and VAE. These can be found in the same download section. Let’s install them one by one.

The first step is to update ComfyUI to its latest version. You can do this by clicking “Update ComfyUI” in the Manager Menu. It’s best to save at least 16 GB of hard drive space for this process.

A screenshot of the ComfyUI Manager Menu, highlighting the
A screenshot of the ComfyUI Manager Menu, highlighting the “Update ComfyUI” option.

After updating, we go to the ComfyUI website again and download the Flux workflow. Unzip the file and drag it into the ComfyUI interface.

A screenshot of a ComfyUI webpage, with the Flux workflow download section highlighted, showing links for the Flux model, CLIP, and VAE.
A screenshot of a ComfyUI webpage, with the Flux workflow download section highlighted, showing links for the Flux model, CLIP, and VAE.

Now we need to download and install the model. We will download the Flux 1DVSFT model, which is 23.8 GB in size.

A screenshot of a ComfyUI webpage, with the Flux model download section highlighted.
A screenshot of a ComfyUI webpage, with the Flux model download section highlighted.

Once downloaded, we copy the model file and paste it into the ComfyUI Models folder. Next, we need to download the CLIP files. The CLIP files come in two options: FP8 and FP16. You will need to choose the version that works best for your host memory. For example, if your host memory is less than 32 GB, then you’ll need to download the FP8 version.

A screenshot of the Hugging Face page for the CLIP model, showing links to download the FP8 or FP16 versions, which differ in file size and memory requirements.
A screenshot of the Hugging Face page for the CLIP model, showing links to download the FP8 or FP16 versions, which differ in file size and memory requirements.

After downloading the CLIP files, copy them to the ComfyUI Models folder. Finally, we need to download the VAE file.

Once all of the files are downloaded, we refresh the ComfyUI interface. This allows the program to locate the new models and make them available for use.

A screenshot of the ComfyUI interface, showing the workflow setup for generating images using Flux. The workflow involves nodes for random noise generation, model selection, and image generation.
A screenshot of the ComfyUI interface, showing the workflow setup for generating images using Flux. The workflow involves nodes for random noise generation, model selection, and image generation.

Generating an Image with Flux

Now, we can start generating images with Flux. The first step is to write a prompt in the ComfyUI interface.

A screenshot of the ComfyUI interface with a workflow setup for generating images using Flux, showing a prompt box for entering text descriptions.
A screenshot of the ComfyUI interface with a workflow setup for generating images using Flux, showing a prompt box for entering text descriptions.

The VAE part may need to be set to the one we downloaded earlier. You can see the prompt I’m using in the image.

A screenshot of the ComfyUI interface with the workflow setup for generating images using Flux, showing a prompt box with a detailed text description for generating an image of a girl in a living room.
A screenshot of the ComfyUI interface with the workflow setup for generating images using Flux, showing a prompt box with a detailed text description for generating an image of a girl in a living room.

This prompt describes a girl sitting on a sofa in a living room, holding a cup of coffee. We press the “Run” button and wait for the image to generate.

The image generated by Flux looks pretty good, with nice details like the girl’s fingers. However, the process took 621.67 seconds to complete, which is quite long.

We can try changing the prompt to see if we can get a better result.

A screenshot of the ComfyUI interface showing the generated image of a girl sitting on a sofa in a living room, holding a cup of coffee, with the image quality and details highlighted.
A screenshot of the ComfyUI interface showing the generated image of a girl sitting on a sofa in a living room, holding a cup of coffee, with the image quality and details highlighted.

The new prompt includes a description of a white layer, which we hope will add some realism to the image. After running the prompt, we see that the image does look a little more realistic.

That concludes our introduction to Flux and its usage with ComfyUI. If you are interested in exploring AI image generation further, consider trying out Flux, which offers high-quality results with its 12 billion parameters.

Published
Categorized as AI

Leave a comment

Your email address will not be published. Required fields are marked *