Minimal FLUX image-generation apps built around GGUF-quantized transformers from Hugging Face.
This repo contains two entry points:
main.py: a Gradio UI for prompt-based image generation with saved previews.generate.py: a CLI workflow that prefetches model assets, loads a GGUF FLUX pipeline, and generates a single image.The project wraps FLUX diffusion pipelines from diffusers and downloads model weights from Hugging Face at runtime.
The Gradio app supports two model modes:
R-rated: black-forest-labs/FLUX.1-dev with city96/FLUX.1-dev-gguf/flux1-dev-Q8_0.ggufNormal: black-forest-labs/FLUX.2-klein-9B with unsloth/FLUX.2-klein-9B-GGUF/flux-2-klein-9b-Q8_0.ggufFLUX.1-dev and can optionally load the LoRA enhanceaiteam/Flux-uncensored-v2.cuda.HF_TOKEN, and your Hugging Face account must have access to the gated model repos.main.py: Gradio app with UI controls, image preview rendering, pipeline caching, and image saving to outputs/generate.py: terminal workflow for cache inspection, model prefetch, optional LoRA loading, and image generation to output.pngrequirements.txt: pip install list for running the projectpyproject.toml: project metadata and dependencies.gitignore: excludes caches, virtualenvs, generated images, and logsThe CLI script notes a setup around an RTX 4090 and logs the main GGUF file as roughly 12.7 GB.
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
Set your Hugging Face token before starting either app:
export HF_TOKEN=your_huggingface_token
You may also need to visit these repos in the browser and accept their license or gated access terms before running:
https://huggingface.co/black-forest-labs/FLUX.1-devhttps://huggingface.co/black-forest-labs/FLUX.2-klein-9Bhttps://huggingface.co/enhanceaiteam/Flux-uncensored-v2python main.py
What it does:
0.0.0.0outputs/Check cached assets only:
python generate.py --show-cache-only
Prefetch the required FLUX files and exit:
python generate.py --prefetch-only
Generate with the base model and skip LoRA loading:
python generate.py --skip-lora
Normal interactive generation:
python generate.py
The CLI script:
bfloat16output.pngDIFFUSERS_GGUF_CUDA_KERNELS is disabled by default in both scripts to avoid incompatible prebuilt kernel issues.HF_HUB_DISABLE_XET=1 is set for download stability.HF_HUB_ENABLE_HF_TRANSFER=1 is enabled, but accelerated transfer only takes effect if hf_transfer is installed in your environment.This published repo intentionally leaves out local-only artifacts such as:
.git.venv.ruff_cache__pycache__Python
100.0%
Minimal FLUX image-generation apps built around GGUF-quantized transformers from Hugging Face.
This repo contains two entry points:
main.py: a Gradio UI for prompt-based image generation with saved previews.generate.py: a CLI workflow that prefetches model assets, loads a GGUF FLUX pipeline, and generates a single image.The project wraps FLUX diffusion pipelines from diffusers and downloads model weights from Hugging Face at runtime.
The Gradio app supports two model modes:
R-rated: black-forest-labs/FLUX.1-dev with city96/FLUX.1-dev-gguf/flux1-dev-Q8_0.ggufNormal: black-forest-labs/FLUX.2-klein-9B with unsloth/FLUX.2-klein-9B-GGUF/flux-2-klein-9b-Q8_0.ggufFLUX.1-dev and can optionally load the LoRA enhanceaiteam/Flux-uncensored-v2.cuda.HF_TOKEN, and your Hugging Face account must have access to the gated model repos.main.py: Gradio app with UI controls, image preview rendering, pipeline caching, and image saving to outputs/generate.py: terminal workflow for cache inspection, model prefetch, optional LoRA loading, and image generation to output.pngrequirements.txt: pip install list for running the projectpyproject.toml: project metadata and dependencies.gitignore: excludes caches, virtualenvs, generated images, and logsThe CLI script notes a setup around an RTX 4090 and logs the main GGUF file as roughly 12.7 GB.
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
Set your Hugging Face token before starting either app:
export HF_TOKEN=your_huggingface_token
You may also need to visit these repos in the browser and accept their license or gated access terms before running:
https://huggingface.co/black-forest-labs/FLUX.1-devhttps://huggingface.co/black-forest-labs/FLUX.2-klein-9Bhttps://huggingface.co/enhanceaiteam/Flux-uncensored-v2python main.py
What it does:
0.0.0.0outputs/Check cached assets only:
python generate.py --show-cache-only
Prefetch the required FLUX files and exit:
python generate.py --prefetch-only
Generate with the base model and skip LoRA loading:
python generate.py --skip-lora
Normal interactive generation:
python generate.py
The CLI script:
bfloat16output.pngDIFFUSERS_GGUF_CUDA_KERNELS is disabled by default in both scripts to avoid incompatible prebuilt kernel issues.HF_HUB_DISABLE_XET=1 is set for download stability.HF_HUB_ENABLE_HF_TRANSFER=1 is enabled, but accelerated transfer only takes effect if hf_transfer is installed in your environment.This published repo intentionally leaves out local-only artifacts such as:
.git.venv.ruff_cache__pycache__Python
100.0%