Using Flux.1 locally is a great option for those looking to harness the full power of this AI image generation model without relying on an online platform. Here’s a detailed guide to installing and configuring Flux.1 on your local machine.

1. System requirements

Before you get started, make sure your computer has the following minimum specifications:

  • GPU: A graphics card with at least 8 GB of VRAM (preferably 12 GB or more for better performance).
  • RAM: A minimum of 16 GB RAM, although 32 GB is recommended for heavier models.
  • Storage space: Prepare at least 50 GB of free space to store templates and dependencies.

2. Installing Comfy UI

Comfy UI is one of the most popular interfaces for using templates like Flux.1 locally.

  1. Download and install Comfy UI: Go to the GitHub repository for Comfy UI and follow the instructions to install the software. This process usually involves cloning the repository and installing the necessary Python dependencies via pip.
  2. Initial configuration: Once Comfy UI has been installed, run it to make sure the interface is displayed correctly. If you encounter any problems, check that your Python environment is configured correctly and that all dependencies are installed.

3. Download and Installation of Flux.1

Flux.1 is available in several versions suitable for different hardware configurations.

Download Flux.1 template

Go to Hugging Face and search for the Flux.1 model (Schnell or Dev). The Schnell model is lighter and recommended if you have a more modest configuration, while the Dev model offers better quality for more powerful systems.

Place files in appropriate folders:

  • Text templates: Place text template files in Comfy UI’s models/clip folder.
  • VAE (Variational Autoencoder): Download the recommended VAE template and place it in the models/vae folder.
  • UNet (Model Core): Flux.1’s main model should be placed in the models/unet folder. This is where you will place the downloaded safetensors files.

4. Configuring LoRAs for Increased Realism

Low-Rank Adaptation Models (LoRA) are extensions that improve the quality of Flux.1-generated images by fine-tuning specific details such as skin texture or shading.

  1. Downloading LoRA
  2. From Hugging Face, download Flux.1-compatible LoRA files, such as Flux.1 Realism LoRA.
  3. Installation: Place LoRA files in Comfy UI’s models/lora folder.
  4. Configuration in Comfy UI: In the Comfy UI interface, load LoRA templates into your workflows for integration into image generation processes. This can usually be done by selecting LoRA in the UI options.

5. Launch Image Generation

  1. Workflow creation: In Comfy UI, create or load a workflow that incorporates the Flux.1 template and, if necessary, LoRAs.
  2. Adjusting Parameters: Adjust the guidance scale to 2.0 to avoid artificial rendering. Experiment with other parameters such as the number of inference steps to find the optimal configuration.
  3. Image generation: Enter your prompt and launch the generation process. Depending on the complexity of the prompt and your system configuration, this can take from a few seconds to several minutes.
How to generate ultra-realistic images locally with flux.1?

If you run into memory problems (insufficient GPU VRAM), you can switch to a lighter model or reduce the image resolution.

Comfy UI also offers options for adjusting weight types (such as FP16 or FP8), which can help reduce memory load while maintaining decent image quality.

If you encounter any errors or the template doesn’t load correctly, make sure you have the latest version of Comfy UI and that all file paths are correctly configured.

You can also consult the Comfy UI support forums or Hugging Face discussions for specific advice.

If local installation is too complicated, you can follow our tutorial to use Flux.1 with replicate.com: Flux.1: Tuto to create ultra-realistic AI images in a few clicks