A powerful and user-friendly web interface for MFLUX, powered by Gradio.
MFLUX WebUI is a comprehensive interface for the MFLUX image generation system. It provides an intuitive way to interact with MFLUX models, offering both simple and advanced options for image generation, as well as support for ControlNet, LoRA integration, and image-to-image transformation.
- 🖼️ Simple and advanced image generation interfaces
- 🎨 Image-to-Image Transformation for enhancing and modifying existing images
- 🎛️ ControlNet support for guided image generation
- 🧠 LoRA (Low-Rank Adaptation) integration for fine-tuned models
- ⚙️ Model quantization options for optimized performance
- 🌈 User-friendly UI suitable for both beginners and advanced users
- 🔧 Customizable settings for precise control over image generation
- 🤖 Ollama integration for prompt enhancement
- 📥 LoRA download functionality
Get started in seconds! Install and run MFLUX WebUI with just one click using Pinokio.
If you prefer to install manually, follow these steps:
-
Clone this repository:
git clone https://github.com/yourusername/mflux-webui.git cd mflux-webui
-
Create and activate a conda environment:
conda create -n mflux python=3.11 conda activate mflux
-
Install the required packages:
pip install -r requirements.txt
To run the WebUI:
python webui.py
Access the interface in your web browser at http://localhost:7860
.
The MFLUX WebUI consists of five main tabs:
- MFLUX Easy: A simplified interface for quick image generation.
- Advanced Generate: Provides full control over image generation parameters.
- ControlNet: Enables guided image generation using a control image.
- Image-to-Image: Transform existing images with new prompts.
- Models: Allows for model management, including downloading, adding, and quantizing models.
The MFLUX Easy tab provides a simplified interface for quick image generation:
- Prompt: Enter your text prompt describing the image you want to generate.
- Enhance prompt with Ollama: Option to improve the prompt using Ollama.
- Model: Choose between "schnell" (fast, lower quality) and "dev" (slow, higher quality).
- Image Format: Select common image dimensions.
- LoRA Files: Select LoRA files to use in generation (if available).
The Advanced Generate tab offers more control over the image generation process:
- All features from MFLUX Easy, plus:
- Seed: Set a specific seed for reproducible results.
- Width/Height: Set custom dimensions for the generated image.
- Inference Steps: Control the number of denoising steps.
- Guidance Scale: Adjust how closely the image follows the text prompt.
- Export Metadata: Option to export generation parameters as JSON.
The ControlNet tab allows for guided image generation:
- All features from Advanced Generate, plus:
- Control Image: Upload an image to guide the generation process.
- ControlNet Strength: Adjust the influence of the control image.
- Save Canny Edge Detection Image: Option to save the edge detection result.
Note: ControlNet requires InstantX/FLUX.1-dev-Controlnet-Canny, which was trained for the dev
model. It can work well with schnell
, but performance is not guaranteed.
The Image-to-Image tab allows you to transform existing images using new prompts:
- Prompt: Enter your text prompt describing how you want to transform the image.
- Enhance prompt with Ollama: Option to improve the prompt using Ollama.
- Initial Image: Upload the image you want to transform.
- Init Image Strength: Control how much the initial image influences the final result (0.0 - 1.0).
- Model: Choose the model to use for image transformation.
- Seed: Set a specific seed for reproducible results.
- Width/Height: Set dimensions for the generated image.
- Inference Steps: Control the number of denoising steps.
- Guidance Scale: Adjust how closely the image follows the text prompt.
- LoRA Files: Select LoRA files to use in transformation (if available).
- LoRA Scale: Adjust the influence of the LoRA files.
- Export Metadata: Option to export generation parameters as JSON.
The Models tab enables you to manage models:
- Download LoRA: Download LoRA models directly from within the interface.
- Download and Add Model: Download models from Hugging Face and add them to available models.
- Quantize Model: Create optimized versions of the models:
- Choose which model to quantize ("dev" or "schnell").
- Select the quantization level (4-bit or 8-bit).
- View the quantization output in a dedicated textbox.
LoRA (Low-Rank Adaptation) allows for fine-tuned models to be used in image generation:
- Place your LoRA files (
.safetensors
) in thelora
directory. - Select the desired LoRA file(s) from the dropdown menu in the WebUI.
- Use the LoRA download functionality in the Models tab to easily add new LoRA models.
MFLUX WebUI integrates Ollama for prompt enhancement:
- Enable the "Enhance prompt with Ollama" option to automatically improve your prompts.
- Adjust Ollama settings, including the model and system prompt, in the Ollama Settings section.
We welcome contributions to MFLUX WebUI! If you have suggestions for improvements or encounter any issues, please feel free to:
- Open an issue
- Submit a pull request
Please ensure that your code adheres to the project's coding standards and includes appropriate tests.
This project is licensed under the Apache License, Version 2.0.
The FLUX models (black-forest-labs/FLUX.1) used in this project are subject to their own license terms. Please refer to the black-forest-labs/FLUX.1 license for more information on the usage and distribution of these models.
Get started with MFLUX WebUI in seconds using Pinokio - the easiest way to install and run AI applications!