How to Install Flux.1 on ComfyUI?
Last updated on: Aug 20, 2024
If you're venturing into AI-driven image generation, Flux.1 is a name you need to know. Launched by Black Forest Labs, a team led by Robin Rombach — a key figure behind the original Stable Diffusion project — Flux.1 is setting new standards for text-to-image models. With an impressive 12 billion training parameters, this model doesn't just compete with industry giants like Midjourney and DALL-E 3; it's redefining what's possible in open-source AI art.
What is Flux.1?
Flux.1 comes in three distinct versions, each tailored for different user needs:
- FLUX.1 [pro]: A closed-source, top-tier model designed for commercial use, accessible via API. It's the go-to for enterprises needing premium performance and customization.
- FLUX.1 [dev]: An open-source, non-commercial variant distilled from FLUX.1 [pro]. It delivers similar high-quality results with optimized efficiency, making it ideal for advanced users.
- FLUX.1 [schnell]: Also open-source, this version is geared for local development and commercial use. It's designed to be fast and light on resources, perfect for quick image generation with minimal VRAM.
Now that you know what makes Flux.1 special, let's dive into the detailed steps to install it on ComfyUI.
Step 1: Install ComfyUI
First things first, if you don't already have ComfyUI, you'll need to install it. ComfyUI provides a flexible interface that makes working with complex AI models a breeze.
- Download and Install ComfyUI: Head over to the ComfyUI GitHub page and follow the installation instructions for your operating system. Once installed, it's worth spending a few minutes to familiarize yourself with its features.
- Update ComfyUI: Flux.1 requires the latest ComfyUI version. Open the ComfyUI Manager, click Update All, and then Reload the UI to avoid any compatibility issues.
Step 2: Download the Flux.1 Model
Depending on your hardware and intended use, you can choose from the Flux Dev or Flux Schnell models. Here's how to get started:
- For FLUX.1 [dev] (for high-end GPUs with 12GB VRAM+):
- Download the Model: Go to the Flux Dev page on Hugging Face, agree to the terms, and download the model file.
- Save Location: Place the model file in the ComfyUI/models/unet directory.
- For FLUX.1 [schnell] (for low-end GPUs with 12GB VRAM or less):
- Download the Model: Visit the Flux Schnell repository and grab the model file.
- Save Location: Save it in the ComfyUI/models/unet folder.
Step 3: Get the Supporting Files
To ensure smooth operation, you'll need to download the VAE and CLIP models that support Flux.1.
- Download the VAE:
- Save Location: Put the VAE file (ae.safetensors) into the ComfyUI/models/vae folder.
- Download the CLIP Models:
- For Flux Dev: If your system has 32GB RAM or more, download the t5xxl_fp16.safetensors file. For lower-end systems, choose the t5xxl_fp8_e4m3fn.safetensors.
- Save Location: Store these files in the ComfyUI/models/clip folder.
If you've used Stable Diffusion 3 Medium before, you may already have some of these files, saving you a download.
Step 4: Load the Flux.1 Workflow
Now, let's set up the workflow in ComfyUI. This is where everything comes together.
- Download the Workflow:
- Text-to-Image Workflow: Get the JSON file for the text-to-image workflow from the Flux repository.
- Image-to-Image Workflow: Download the respective workflow if you want to work from an initial image instead.
- Load the Workflow in ComfyUI:
- Drag and drop the downloaded JSON file into ComfyUI. If you run into errors like “unable to find load diffusion model nodes,” make sure your ComfyUI is updated.
- Configure the Workflow:
- In the Load Diffusion Model node, select the Flux model you downloaded. Opt for the fp16 setting if your GPU can handle it; otherwise, go with fp8.
- In the Dual Clip Loader node, select the appropriate CLIP model (fp16 for better quality or fp8 for resource-limited systems).
Step 5: Generate Your First Image
Now comes the fun part — creating your first image with Flux.1.
- Set Your Prompts:
- For FLUX.1 [dev]: Use a prompt like a tiny astronaut hatching from an egg on the moon. Set sampling to Euler, steps to 50, dimensions to 1024x1024, and CFG to 3.5.
- For FLUX.1 [schnell]: Try a prompt like a beautiful Asian model, teal colored short hair, wearing transparent glasses, red lipstick, professional makeup, nightlife, professional photoshoot, 32k. Set sampling to Euler, steps to 1-4, dimensions to 1024x1024, and CFG to 1-2.
- Run the Workflow:
- Hit Queue Prompt and watch as Flux.1 brings your prompts to life. The generation time will depend on your hardware — for example, an RTX 4060 Ti might take around 1 minute and 31 seconds with the Flux Dev model and just 50 seconds with Flux Schnell.
Tips for Getting the Best Results with Flux.1
- Experiment with Prompts: Flux.1's advanced prompt adherence is one of its strengths. Don't be afraid to try complex or abstract concepts — the model can handle it.
- Optimize for Your Hardware: If you're dealing with limited VRAM, use the FP8 models and lower the image resolution to avoid out-of-memory errors.
- Leverage Image-to-Image: If text prompts alone aren't getting you the results you want, use the Image-to-Image workflow to refine your creations.
Conclusion
Congratulations! You've successfully installed Flux.1 on ComfyUI and are now ready to start creating stunning AI-generated images. Whether you're a hobbyist exploring creative prompts or working on commercial projects, Flux.1's advanced architecture and versatile model options give you the power to push your creativity to new heights.
For those who prefer a more streamlined experience, you can also check out the Flux AI Image Generator Online interface. It offers a simple, user-friendly way to explore Flux.1's capabilities without the setup hassle.
To get the most out of your image generation, check out our Flux.1 Prompt Guide for tips on crafting effective prompts. This guide will help you create more precise and creative outputs with Flux.1.