This repository contains two powerful applications built on FLUX.1-Kontext with GGUF quantization support for efficient memory usage:
gguf_flux_app.py)portrait_series_app.py)# Download and run the deployment script
wget https://raw.githubusercontent.com/nexusjuan12/FLUX.1-Kontext-multi-image/main/flux_deploy_enhanced.sh
chmod +x flux_deploy_enhanced.sh
./flux_deploy_enhanced.sh
# Install Miniconda (if not already installed)
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
# Create and activate environment
conda create -n flux-kontext python=3.10 -y
conda activate flux-kontext
git clone https://github.com/nexusjuan12/FLUX.1-Kontext-multi-image.git
cd FLUX.1-Kontext-multi-image
# Install PyTorch with CUDA support
conda install pytorch pytorch-cuda=12.1 -c pytorch -c nvidia -y
# Install core packages
conda install -c conda-forge numpy pillow requests opencv -y
# Install Python packages
pip install diffusers>=0.30.0 transformers>=4.44.0 accelerate>=0.33.0 \
sentencepiece>=0.2.0 gradio>=4.0.0 huggingface_hub>=0.24.0 \
safetensors>=0.4.0 protobuf>=3.19.0 spaces scipy matplotlib tqdm
# Install latest diffusers with GGUF support
pip install git+https://github.com/huggingface/diffusers.git
Multi-Image App:
conda activate flux-kontext
cd FLUX.1-Kontext-multi-image
python gguf_flux_app.py
# Access at: http://localhost:7860
Portrait Series App:
conda activate flux-kontext
cd FLUX.1-Kontext-multi-image
python portrait_series_app.py
# Access at: http://localhost:7861
conda activate flux-kontext
cd FLUX.1-Kontext-multi-image
python launch_apps.py
The applications support different GGUF quantization levels. Edit the SELECTED_MODEL variable in the app files:
SELECTED_MODEL = "Q5_K_M" # Change this to your preferred model
Both applications include automatic memory management:
Out of Memory Error:
SELECTED_MODEL to a lower quantization (Q4_K_S or Q2_K)Conda TOS Error:
conda tos accept
Model Download Issues:
Poor Quality Results:
Contributions are welcome! Please:
This project follows the licensing terms of the underlying FLUX.1-Kontext model. Please review the official FLUX.1 license for commercial usage terms.
For issues and questions:
Note: This is an unofficial implementation. For official FLUX.1 models and support, visit Black Forest Labs.
11 commits
Python
88.3%
Shell
11.7%
This repository contains two powerful applications built on FLUX.1-Kontext with GGUF quantization support for efficient memory usage:
gguf_flux_app.py)portrait_series_app.py)# Download and run the deployment script
wget https://raw.githubusercontent.com/nexusjuan12/FLUX.1-Kontext-multi-image/main/flux_deploy_enhanced.sh
chmod +x flux_deploy_enhanced.sh
./flux_deploy_enhanced.sh
# Install Miniconda (if not already installed)
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
# Create and activate environment
conda create -n flux-kontext python=3.10 -y
conda activate flux-kontext
git clone https://github.com/nexusjuan12/FLUX.1-Kontext-multi-image.git
cd FLUX.1-Kontext-multi-image
# Install PyTorch with CUDA support
conda install pytorch pytorch-cuda=12.1 -c pytorch -c nvidia -y
# Install core packages
conda install -c conda-forge numpy pillow requests opencv -y
# Install Python packages
pip install diffusers>=0.30.0 transformers>=4.44.0 accelerate>=0.33.0 \
sentencepiece>=0.2.0 gradio>=4.0.0 huggingface_hub>=0.24.0 \
safetensors>=0.4.0 protobuf>=3.19.0 spaces scipy matplotlib tqdm
# Install latest diffusers with GGUF support
pip install git+https://github.com/huggingface/diffusers.git
Multi-Image App:
conda activate flux-kontext
cd FLUX.1-Kontext-multi-image
python gguf_flux_app.py
# Access at: http://localhost:7860
Portrait Series App:
conda activate flux-kontext
cd FLUX.1-Kontext-multi-image
python portrait_series_app.py
# Access at: http://localhost:7861
conda activate flux-kontext
cd FLUX.1-Kontext-multi-image
python launch_apps.py
The applications support different GGUF quantization levels. Edit the SELECTED_MODEL variable in the app files:
SELECTED_MODEL = "Q5_K_M" # Change this to your preferred model
Both applications include automatic memory management:
Out of Memory Error:
SELECTED_MODEL to a lower quantization (Q4_K_S or Q2_K)Conda TOS Error:
conda tos accept
Model Download Issues:
Poor Quality Results:
Contributions are welcome! Please:
This project follows the licensing terms of the underlying FLUX.1-Kontext model. Please review the official FLUX.1 license for commercial usage terms.
For issues and questions:
Note: This is an unofficial implementation. For official FLUX.1 models and support, visit Black Forest Labs.
11 commits
Python
88.3%
Shell
11.7%