Downloads · 30 days
38
18% of all-time downloads
akba08/flux_cinematic_photography_finetuned
flux_cinematic_photography_finetuned is a text-to-image model from akba08. Use it when you need an image from a text prompt. It is set up for diffusers. The card lists the license as mit.
This repository contains a QLoRA fine-tuned adapter for black-forest-labs/FLUX.1-dev, trained to generate images in a consistent ultra-realistic cinematic photography style.
Downloads · 30 days
38
18% of all-time downloads
All-time downloads
206
Public
Repo size
201 MB
Likes
0
Public
Click a slice to open those files.
.safetensors150 MB · 68%
From the Hugging Face model README
This repository contains a QLoRA fine-tuned adapter for black-forest-labs/FLUX.1-dev, trained to generate images in a consistent ultra-realistic cinematic photography style.
The LoRA was trained on the dataset:
akba08/ultra-realistic-cinematic-photographyThis model is ideal if you want FLUX.1-dev to produce:
black-forest-labs/FLUX.1-devdiffusers + peft + bitsandbytesBitsAndBytesConfigfp16 mixed precision during trainingr = 4to_q, to_k, to_v, to_out.0)This repo contains only the LoRA weights. You must load them on top of the original FLUX.1-dev base model.
akba08/ultra-realistic-cinematic-photographyEach image is paired with a descriptive prompt ending in:
..., ultra-realistic cinematic photography
Training was performed in Google Colab on a single T4 GPU using a modified version of the official flux_lora_quantization example.
Pre-compute text embeddings
FluxPipeline + T5 encoder (text_encoder_2) from FLUX.1-dev.parquet file:
embeddings_akba08_finetune.parquetSet up QLoRA training
fp16BitsAndBytesConfigprepare_model_for_kbit_trainingLoraConfig(
r=4,
lora_alpha=4,
init_lora_weights="gaussian",
target_modules=["to_k", "to_q", "to_v", "to_out.0"],
)
Cache latents
latent_dist in RAMTraining configuration
pretrained_model_name_or_path = "black-forest-labs/FLUX.1-dev"
data_df_path = "embeddings_akba08_finetune.parquet"
output_dir = "akba08_finetune_lora_flux_nf4"
width, height = 896, 896
train_batch_size = 1
learning_rate = 1e-4
guidance_scale = 1.0
gradient_accumulation_steps = 4
gradient_checkpointing = True
rank = 4
max_train_steps = 700 # demo runs also tested with 100 steps
checkpointing_steps = 100
mixed_precision = "fp16"
weighting_scheme = "none"
report_to = "wandb"
seed = 0
bitsandbytes.optim.AdamW8bitget_schedulerFlowMatchEulerDiscreteScheduler from FLUX.1-devnoise - latents following the SD3 / FLUX training utilitiesEnvironment: Google Colab, free T4 GPU
Approx. memory usage: ~9.8 GB VRAM during training
Example run:
max_train_steps = 100 → ~30 minutes on T4max_train_steps = 700 → several hours on T4 (or ~40 min on 4090, per original blogpost reference)This LoRA is intended for:
Generating ultra-realistic, cinematic photographs of:
Fine-tuning experiments with FLUX.1-dev on consumer hardware
Demonstrating QLoRA + NF4 + LoRA + cached latents for efficient training
Not intended for:
import torch
from diffusers import FluxPipeline
base_model = "black-forest-labs/FLUX.1-dev"
lora_repo = "akba08/flux_cinematic_photography_finetuned"
pipe = FluxPipeline.from_pretrained(
base_model,
torch_dtype=torch.float16,
device_map="auto",
)
pipe.load_lora_weights(lora_repo)
pipe.to("cuda")
prompt = "tropical beach at sunset with palm trees leaning over calm waves, vibrant pink-orange sky, high-detail reflections on water, ultra-realistic cinematic photography"
image = pipe(
prompt,
num_inference_steps=28,
guidance_scale=3.5,
height=896,
width=1024,
generator=torch.manual_seed(0),
).images[0]
image.save("flux_cinematic_beach.png")
The LoRA is trained heavily on prompts that end with:
ultra-realistic cinematic photographyorultra-realistic cinematic photography style
Good prompt patterns:
"a golden retriever lying on a wooden floor with soft window light on its face, expressive eyes, shallow depth of field, ultra-realistic cinematic photography style""macro close-up of a pink lily covered in morning dew, glowing sunrise light, creamy bokeh background, ultra-realistic cinematic photography""a steaming cast-iron pan filled with roasted vegetables and herb-seasoned beef, warm rustic kitchen lighting, soft bokeh, ultra-realistic cinematic photography"Validation prompts used during testing included:
"tropical beach at sunset with palm trees leaning over calm waves, vibrant pink-orange sky, high-detail reflections on water, ultra-realistic cinematic photography""a steaming cast-iron pan filled with roasted vegetables and herb-seasoned beef, warm rustic kitchen lighting, soft bokeh, ultra-realistic cinematic photography""macro close-up of a pink lily covered in morning dew, glowing sunrise light, creamy bokeh background, ultra-realistic cinematic photography""a golden retriever lying on a wooden floor with soft window light on its face, expressive eyes, shallow depth of field, ultra-realistic cinematic photography style"Qualitatively, the LoRA:
Preserves FLUX.1-dev’s high fidelity and coherence
Strengthens:
Produces consistent high-detail photographic outputs across categories (animals, food, nature, flowers)
The training script can be extended to FP8 training with torchao on GPUs with compute capability ≥ 8.9 (e.g., NVIDIA H100).
Key ideas:
torchao.float8.convert_to_float8_training to inject FP8 layersmodule_filter_fn to choose which modules go FP8--do_fp8_training for further memory/speed efficienciesThe Colab version here focuses on NF4 + QLoRA for consumer-grade hardware (T4 / 4090 style setups).
Biases: The dataset is biased toward:
Out-of-distribution prompts:
May produce less coherent results for:
Style locking:
Users are responsible for ensuring that generated content respects local laws, platform policies, and ethical norms.
black-forest-labs/FLUX.1-devlicense: other in the metadata — please update to your chosen license such as mit, apache-2.0, etc.)Coming Soon
Base model: Black Forest Labs – FLUX.1-dev
Training framework: 🤗 diffusers, accelerate, peft, bitsandbytes
Quantization ideas & FP8 references inspired by:
flux_lora_quantization research exampleFor questions, issues, or suggestions: