license: other
base_model: black-forest-labs/FLUX.1-dev
tags:
- flux
- flux-diffusers
- text-to-image
- diffusers
- simpletuner
- safe-for-work
- lora
- template:sd-lora
- standard
inference: true
widget:
- text: unconditional (blank prompt)
parameters:
negative_prompt: blurry, cropped, ugly
output:
url: ./assets/image_0_0.png
- text: >-
In the style of a Carravagio painting, Musicians in ornate period clothing
gathered around a lute player, with scattered sheet music and a violin
nearby, bathed in dramatic side lighting against a dark background
parameters:
negative_prompt: blurry, cropped, ugly
output:
url: ./assets/image_1_0.png
- text: >-
In the style of a Carravagio painting, A scholar with a long white beard
at his desk, quill in hand, with an open book and skull illuminated by a
single strong light source
parameters:
negative_prompt: blurry, cropped, ugly
output:
url: ./assets/image_2_0.png
- text: >-
In the style of a Carravagio painting, Three figures playing cards at a
wooden table, one wearing a feathered hat and striped tunic, another
peering over shoulders in suspicious observation
parameters:
negative_prompt: blurry, cropped, ugly
output:
url: ./assets/image_3_0.png
- text: >-
In the style of a Carravagio painting, A figure in white examining their
reflection in a mirror, surrounded by objects of vanity, with stark
lighting from the left
parameters:
negative_prompt: blurry, cropped, ugly
output:
url: ./assets/image_4_0.png
- text: >-
In the style of a Carravagio painting, A street musician with an electric
guitar performing under a single street lamp, surrounded by watching
pedestrians with phones creating additional points of light
parameters:
negative_prompt: blurry, cropped, ugly
output:
url: ./assets/image_5_0.png
- text: >-
In the style of a Carravagio painting, A surgeon in scrubs illuminated by
surgical lights, bent over their patient, with attending staff in shadows
around them
parameters:
negative_prompt: blurry, cropped, ugly
output:
url: ./assets/image_6_0.png
- text: >-
In the style of a Carravagio painting, Poker players at a dimly lit table,
one in a hoodie checking their phones under the table, while security
cameras watch from above
parameters:
negative_prompt: blurry, cropped, ugly
output:
url: ./assets/image_7_0.png
- text: >-
In the style of a Carravagio painting, A food photographer in a dark
studio, dramatically lit by a single softbox, carefully arranging modern
cuisine on a rustic wooden table
parameters:
negative_prompt: blurry, cropped, ugly
output:
url: ./assets/image_8_0.png
Caravaggio-QuarterCrops-Flux-LoRA
This is a standard PEFT LoRA derived from black-forest-labs/FLUX.1-dev.
No validation prompt was used during training.
None
Validation settings
- CFG:
3.0
- CFG Rescale:
0.0
- Steps:
20
- Sampler:
FlowMatchEulerDiscreteScheduler
- Seed:
42
- Resolution:
1408x768
- Skip-layer guidance:
Note: The validation settings are not necessarily the same as the training settings.
You can find some example images in the following gallery:

- Prompt
- unconditional (blank prompt)
- Negative Prompt
- blurry, cropped, ugly

- Prompt
- In the style of a Carravagio painting, Musicians in ornate period clothing gathered around a lute player, with scattered sheet music and a violin nearby, bathed in dramatic side lighting against a dark background
- Negative Prompt
- blurry, cropped, ugly

- Prompt
- In the style of a Carravagio painting, A scholar with a long white beard at his desk, quill in hand, with an open book and skull illuminated by a single strong light source
- Negative Prompt
- blurry, cropped, ugly

- Prompt
- In the style of a Carravagio painting, Three figures playing cards at a wooden table, one wearing a feathered hat and striped tunic, another peering over shoulders in suspicious observation
- Negative Prompt
- blurry, cropped, ugly

- Prompt
- In the style of a Carravagio painting, A figure in white examining their reflection in a mirror, surrounded by objects of vanity, with stark lighting from the left
- Negative Prompt
- blurry, cropped, ugly

- Prompt
- In the style of a Carravagio painting, A street musician with an electric guitar performing under a single street lamp, surrounded by watching pedestrians with phones creating additional points of light
- Negative Prompt
- blurry, cropped, ugly

- Prompt
- In the style of a Carravagio painting, A surgeon in scrubs illuminated by surgical lights, bent over their patient, with attending staff in shadows around them
- Negative Prompt
- blurry, cropped, ugly

- Prompt
- In the style of a Carravagio painting, Poker players at a dimly lit table, one in a hoodie checking their phones under the table, while security cameras watch from above
- Negative Prompt
- blurry, cropped, ugly

- Prompt
- In the style of a Carravagio painting, A food photographer in a dark studio, dramatically lit by a single softbox, carefully arranging modern cuisine on a rustic wooden table
- Negative Prompt
- blurry, cropped, ugly
The text encoder was not trained. You may reuse the base model text encoder for inference.
Training settings
Training epochs: 2
Training steps: 5500
Learning rate: 8e-05
- Learning rate schedule: polynomial
- Warmup steps: 100
Max grad norm: 0.1
Effective batch size: 3
- Micro-batch size: 3
- Gradient accumulation steps: 1
- Number of GPUs: 1
Gradient checkpointing: True
Prediction type: flow-matching (extra parameters=['shift=3', 'flux_guidance_mode=constant', 'flux_guidance_value=1.0', 'flow_matching_loss=compatible', 'flux_lora_target=all'])
Optimizer: adamw_bf16
Trainable parameter precision: Pure BF16
Caption dropout probability: 10.0%
SageAttention: Enabled inference
LoRA Rank: 64
LoRA Alpha: None
LoRA Dropout: 0.1
LoRA initialisation style: default
Datasets
caravaggio-256
- Repeats: 10
- Total number of images: 45
- Total number of aspect buckets: 5
- Resolution: 0.065536 megapixels
- Cropped: False
- Crop style: None
- Crop aspect: None
- Used for regularisation data: No
caravaggio-crop-256
- Repeats: 10
- Total number of images: 45
- Total number of aspect buckets: 1
- Resolution: 0.065536 megapixels
- Cropped: True
- Crop style: center
- Crop aspect: square
- Used for regularisation data: No
caravaggio-512
- Repeats: 10
- Total number of images: 45
- Total number of aspect buckets: 8
- Resolution: 0.262144 megapixels
- Cropped: False
- Crop style: None
- Crop aspect: None
- Used for regularisation data: No
caravaggio-crop-512
- Repeats: 10
- Total number of images: 45
- Total number of aspect buckets: 1
- Resolution: 0.262144 megapixels
- Cropped: True
- Crop style: center
- Crop aspect: square
- Used for regularisation data: No
caravaggio-768
- Repeats: 10
- Total number of images: 45
- Total number of aspect buckets: 4
- Resolution: 0.589824 megapixels
- Cropped: False
- Crop style: None
- Crop aspect: None
- Used for regularisation data: No
caravaggio-crop-768
- Repeats: 10
- Total number of images: 45
- Total number of aspect buckets: 1
- Resolution: 0.589824 megapixels
- Cropped: True
- Crop style: center
- Crop aspect: square
- Used for regularisation data: No
caravaggio-1024
- Repeats: 10
- Total number of images: 45
- Total number of aspect buckets: 12
- Resolution: 1.048576 megapixels
- Cropped: False
- Crop style: None
- Crop aspect: None
- Used for regularisation data: No
caravaggio-crop-1024
- Repeats: 10
- Total number of images: 45
- Total number of aspect buckets: 1
- Resolution: 1.048576 megapixels
- Cropped: True
- Crop style: center
- Crop aspect: square
- Used for regularisation data: No
caravaggio-1440
- Repeats: 10
- Total number of images: 45
- Total number of aspect buckets: 7
- Resolution: 2.0736 megapixels
- Cropped: False
- Crop style: None
- Crop aspect: None
- Used for regularisation data: No
caravaggio-crop-1440
- Repeats: 10
- Total number of images: 45
- Total number of aspect buckets: 1
- Resolution: 2.0736 megapixels
- Cropped: True
- Crop style: center
- Crop aspect: square
- Used for regularisation data: No
Inference
import torch
from diffusers import DiffusionPipeline
model_id = 'black-forest-labs/FLUX.1-dev'
adapter_id = 'davidrd123/Caravaggio-QuarterCrops-Flux-LoRA'
pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) # loading directly in bf16
pipeline.load_lora_weights(adapter_id)
prompt = "An astronaut is riding a horse through the jungles of Thailand."
## Optional: quantise the model to save on vram.
## Note: The model was quantised during training, and so it is recommended to do the same during inference time.
from optimum.quanto import quantize, freeze, qint8
quantize(pipeline.transformer, weights=qint8)
freeze(pipeline.transformer)
pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu') # the pipeline is already in its target precision level
image = pipeline(
prompt=prompt,
num_inference_steps=20,
generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42),
width=1408,
height=768,
guidance_scale=3.0,
).images[0]
image.save("output.png", format="PNG")