paint-brush
FLUX Local & Cloud Tutorial With SwarmUI - FLUX: Open Source txt2img Model Surpassing Midjourneyby@secourses
3,623 reads
3,623 reads

FLUX Local & Cloud Tutorial With SwarmUI - FLUX: Open Source txt2img Model Surpassing Midjourney

by Furkan GözükaraAugust 6th, 2024
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

FLUX represents a groundbreaking achievement in open source txt2img technology, genuinely outperforming and producing superior quality images with enhanced prompt adherence compared to #Midjourney, Adobe Firefly, Leonardo Ai, Playground Ai, Stable Diffusion, SDXL, SD3, and Dall E3.
featured image - FLUX Local & Cloud Tutorial With SwarmUI - FLUX: Open Source txt2img Model Surpassing Midjourney
Furkan Gözükara HackerNoon profile picture

FLUX represents a groundbreaking achievement in open source txt2img technology, genuinely outperforming and producing superior quality images with enhanced prompt adherence compared to #Midjourney, Adobe Firefly, Leonardo Ai, Playground Ai, Stable Diffusion, SDXL, SD3, and Dall E3. FLUX, developed by Black Forest Labs, boasts a team primarily composed of the original StableDiffusion creators, resulting in astounding quality. This statement is not an exaggeration, as you'll discover upon viewing the tutorial.


This guide will demonstrate how to effortlessly download and utilize FLUX models on your personal computer and cloud services such as Massed Compute, RunPod, and a complimentary Kaggle account.


FLUX.1 [dev] is a 12 billion parameter rectified flow transformer capable of generating images from textual descriptions.

Key Features

  • Cutting-edge output quality, second only to our state-of-the-art model FLUX.1 [pro].


  • Competitive prompt following, matching the performance of closed source alternatives.


  • Trained using guidance distillation, enhancing FLUX.1 [dev]'s efficiency.


  • Open weights to drive new scientific research and empower artists to develop innovative workflows.


The FLUX.1 suite of text-to-image models establishes a new state-of-the-art in image detail, prompt adherence, style diversity, and scene complexity for text-to-image synthesis.


To balance accessibility and model capabilities, FLUX.1 is available in three variants: FLUX.1 [pro], FLUX.1 [dev], and FLUX.1 [schnell]:


FLUX.1 [pro]: The pinnacle of FLUX.1, offers state-of-the-art performance in image generation with superior prompt following, visual quality, image detail, and output diversity.


FLUX.1 [dev]: An open-weight, guidance-distilled model for non-commercial applications. Directly distilled from FLUX.1 [pro], it achieves similar quality and prompt adherence capabilities while being more efficient than a standard model of the same size. FLUX.1 [dev] weights are available on HuggingFace.


FLUX.1 [schnell]: Our fastest model, optimized for local development and personal use. FLUX.1 [schnell] is openly available under an Apache2.0 license. Like FLUX.1 [dev], weights are available on Hugging Face, and inference code can be found on GitHub and in HuggingFace's Diffusers.

Transformer-powered Flow Models at Scale

All public FLUX.1 models are based on a hybrid architecture of multimodal and parallel diffusion transformer blocks, scaled to 12B parameters. FLUX 1 improves upon previous state-of-the-art diffusion models by leveraging flow matching, a general and conceptually simple method for training generative models, which includes diffusion as a special case.


Additionally, FLUX 1 enhances model performance and hardware efficiency by incorporating rotary positional embeddings and parallel attention layers.

A New Benchmark for Image Synthesis

FLUX.1 sets a new standard in image synthesis. FLUX.1 [pro] and [dev] surpass popular models like Midjourney v6.0, DALL·E 3 (HD), and SD3-Ultra in Visual Quality, Prompt Following, Size/Aspect Variability, Typography, and Output Diversity.


FLUX.1 [schnell] is the most advanced few-step model to date, outperforming not only its in-class competitors but also robust non-distilled models like Midjourney v6.0 and DALL·E 3 (HD).


FLUX models are specifically fine-tuned to preserve the entire output diversity from pretraining. Compared to the current state-of-the-art, they offer significantly improved possibilities.

Tutorial Video Workflow

  1. Introduction to FLUX and SwarmUI:
    • FLUX is introduced as the current state-of-the-art AI image generation model, developed by Black Forest Labs.

    • It outperforms Midjourney according to ELO scores.

    • SwarmUI is presented as a powerful GUI that makes using FLUX as easy as Automatic1111 Web UI.

    • The tutorial aims to provide detailed instructions for various setups, including local PCs and cloud services.


  2. Installation and Setup:
    • Detailed instructions for downloading FLUX models are provided in a public Patreon post.

    • One-click model downloaders are available, supporting FP8 versions to save storage and bandwidth.

    • The tutorial covers installation on Windows PCs, Massed Compute, RunPod, and Kaggle.

    • For Windows, the process involves running the install_windows.bat file and updating SwarmUI.

    • Cloud service setup instructions are provided for Massed Compute and RunPod, including specific template selections and port configurations.


  3. Hardware Requirements and Optimization:
    • FLUX can work with GPUs having as low as 6GB VRAM, but performance improves with more powerful GPUs.

    • The tutorial explains the difference between FP8 and FP16 precision:

      • FP8 is used by default and requires less VRAM.
      • FP16 can be used on GPUs with 24GB+ VRAM for potentially better quality.
    • Instructions for switching between FP8 and FP16 in SwarmUI's advanced settings are provided.


  4. Cloud Services:
    • Massed Compute: Offers a powerful 48GB A6000 GPU for 31 cents per hour.

    • RunPod: Instructions for deploying on various GPU options, including high-end L40S.

    • Kaggle: A free notebook option is available, best used with the Turbo model for reasonable generation times.


  5. Model Versions and Performance:
    • Two main versions are discussed:

      • Development model: 20 steps, higher quality but slower.
      • Turbo model (schnell): 4 steps, faster but may have slightly lower quality.
    • Comparisons with Midjourney and other Stable Diffusion models are shown, demonstrating FLUX's superior prompt following and image quality.


  6. Advanced Features:
    • FLUX guidance scale: Explained as different from standard CFG scale in other Stable Diffusion models.

    • Precision settings: Detailed explanation of how to use FP16 precision for potentially better results on high VRAM GPUs.

    • Step count adjustments: Experiments with different step counts and their impact on image quality.


  7. Practical Examples:
    • The video demonstrates generating images with various prompts, including complex ones from Midjourney and CivitAI.

    • High-resolution image generation (up to 1536x1536) is shown, with explanations of VRAM usage (e.g., 34GB for 1536x1536 on FP16).

    • Comparisons between FLUX and other models in terms of prompt following and image quality are provided.


  8. Performance Metrics:
    • Detailed information on generation speeds is provided (e.g., 2 it/second on L40S GPU).

    • VRAM usage is monitored and explained for different settings and resolutions.


  9. Limitations and Considerations:
    • The development model is noted as for non-commercial use, while the Turbo model allows commercial use.

    • The tutorial explains how to work around VRAM limitations on lower-end GPUs.


  10. Supplementary Materials:
    • The video is accompanied by a detailed written post with instructions and links.

    • Previous tutorials on SwarmUI installation and usage are referenced for more comprehensive learning.


This tutorial provides an in-depth guide to using FLUX with SwarmUI, covering everything from basic setup to advanced usage across different platforms and hardware configurations, with practical examples and performance comparisons.