How to use from the
Use from the
Diffusers library
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline

# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("black-forest-labs/flux-3-image-klein", dtype=torch.bfloat16, device_map="cuda")
pipe.load_lora_weights("SimpleTuner/flux-3-klein-image-training-assistant")

prompt = "A photograph of an elderly woman wearing a blue silk scarf, soft window light, a plain gray background."
image = pipe(prompt).images[0]

SimpleTuner/flux-3-klein-image-training-assistant

This is a PEFT LoRA derived from black-forest-labs/flux-3-image-klein.

No validation prompt was used during training.

Validation settings

  • CFG: 1.0
  • CFG Rescale: 0.0
  • Steps: 16
  • Sampler: FlowMatchEulerDiscreteScheduler
  • Seed: 42
  • Resolutions: 512x512,1024x1024,1536x1536,2048x2048

Note: The validation settings are not necessarily the same as the training settings.

You can find some example images in the following gallery:

Prompt
A photograph of an elderly woman wearing a blue silk scarf, soft window light, a plain gray background.
Negative Prompt
'
Prompt
A photograph of an elderly woman wearing a blue silk scarf, soft window light, a plain gray background.
Negative Prompt
'
Prompt
A photograph of an elderly woman wearing a blue silk scarf, soft window light, a plain gray background.
Negative Prompt
'
Prompt
A photograph of an elderly woman wearing a blue silk scarf, soft window light, a plain gray background.
Negative Prompt
'
Prompt
A photograph of a woman walking down a rain-soaked city street, reflections in the pavement, natural evening light.
Negative Prompt
'
Prompt
A photograph of a woman walking down a rain-soaked city street, reflections in the pavement, natural evening light.
Negative Prompt
'
Prompt
A photograph of a woman walking down a rain-soaked city street, reflections in the pavement, natural evening light.
Negative Prompt
'
Prompt
A photograph of a woman walking down a rain-soaked city street, reflections in the pavement, natural evening light.
Negative Prompt
'
Prompt
A photograph of a sunlit kitchen with wooden cabinets, ceramic cups and fresh flowers on a table.
Negative Prompt
'
Prompt
A photograph of a sunlit kitchen with wooden cabinets, ceramic cups and fresh flowers on a table.
Negative Prompt
'
Prompt
A photograph of a sunlit kitchen with wooden cabinets, ceramic cups and fresh flowers on a table.
Negative Prompt
'
Prompt
A photograph of a sunlit kitchen with wooden cabinets, ceramic cups and fresh flowers on a table.
Negative Prompt
'
Prompt
A photograph of a mountain lake at dawn with mist over the water and pine trees along the shore.
Negative Prompt
'
Prompt
A photograph of a mountain lake at dawn with mist over the water and pine trees along the shore.
Negative Prompt
'
Prompt
A photograph of a mountain lake at dawn with mist over the water and pine trees along the shore.
Negative Prompt
'
Prompt
A photograph of a mountain lake at dawn with mist over the water and pine trees along the shore.
Negative Prompt
'
Prompt
A close-up photograph of a white cotton shirt and a folded blue silk scarf on a wooden table.
Negative Prompt
'
Prompt
A close-up photograph of a white cotton shirt and a folded blue silk scarf on a wooden table.
Negative Prompt
'
Prompt
A close-up photograph of a white cotton shirt and a folded blue silk scarf on a wooden table.
Negative Prompt
'
Prompt
A close-up photograph of a white cotton shirt and a folded blue silk scarf on a wooden table.
Negative Prompt
'
Prompt
An illustration of an anthropomorphic fox wearing a blue jacket and reading a book in a cozy library.
Negative Prompt
'
Prompt
An illustration of an anthropomorphic fox wearing a blue jacket and reading a book in a cozy library.
Negative Prompt
'
Prompt
An illustration of an anthropomorphic fox wearing a blue jacket and reading a book in a cozy library.
Negative Prompt
'
Prompt
An illustration of an anthropomorphic fox wearing a blue jacket and reading a book in a cozy library.
Negative Prompt
'

The text encoder was not trained. You may reuse the base model text encoder for inference.

Training settings

  • Training epochs: 0

  • Training steps: 30000

  • Learning rate: 0.0001

    • Learning rate schedule: constant_with_warmup
    • Warmup steps: 25
  • Max grad norm: 1.0

  • Effective batch size: 16

    • Micro-batch size: 2
    • Gradient accumulation steps: 1
    • Number of GPUs: 8
  • Gradient checkpointing: True

  • Prediction type: flow_map[]

  • Optimizer: adamw_bf16

  • Trainable parameter precision: Pure BF16

  • Base model precision: no_change

  • Caption dropout probability: 0.0%

  • LoRA Rank: 64

  • LoRA Alpha: 64.0

  • LoRA Dropout: 0.0

  • LoRA initialisation style: default

  • LoRA mode: Standard

Datasets

assistant-real-v3-cc12m-512

  • Repeats: 0
  • Total number of images: 15000
  • Total number of aspect buckets: 56
  • Resolution: 0.262144 megapixels
  • Cropped: False
  • Crop style: None
  • Crop aspect: None
  • Used for regularisation data: No

assistant-real-v3-cc12m-1024

  • Repeats: 0
  • Total number of images: 15000
  • Total number of aspect buckets: 96
  • Resolution: 1.048576 megapixels
  • Cropped: False
  • Crop style: None
  • Crop aspect: None
  • Used for regularisation data: No

assistant-real-v3-cc12m-1536

  • Repeats: 0
  • Total number of images: 15000
  • Total number of aspect buckets: 127
  • Resolution: 2.359296 megapixels
  • Cropped: False
  • Crop style: None
  • Crop aspect: None
  • Used for regularisation data: No

assistant-real-v3-cc12m-2048

  • Repeats: 0
  • Total number of images: 15000
  • Total number of aspect buckets: 153
  • Resolution: 4.194304 megapixels
  • Cropped: False
  • Crop style: None
  • Crop aspect: None
  • Used for regularisation data: No

assistant-real-v3-e621-512

  • Repeats: 0
  • Total number of images: 15000
  • Total number of aspect buckets: 86
  • Resolution: 0.262144 megapixels
  • Cropped: False
  • Crop style: None
  • Crop aspect: None
  • Used for regularisation data: No

assistant-real-v3-e621-1024

  • Repeats: 0
  • Total number of images: 15000
  • Total number of aspect buckets: 142
  • Resolution: 1.048576 megapixels
  • Cropped: False
  • Crop style: None
  • Crop aspect: None
  • Used for regularisation data: No

assistant-real-v3-e621-1536

  • Repeats: 0
  • Total number of images: 15000
  • Total number of aspect buckets: 177
  • Resolution: 2.359296 megapixels
  • Cropped: False
  • Crop style: None
  • Crop aspect: None
  • Used for regularisation data: No

assistant-real-v3-e621-2048

  • Repeats: 0
  • Total number of images: 15000
  • Total number of aspect buckets: 201
  • Resolution: 4.194304 megapixels
  • Cropped: False
  • Crop style: None
  • Crop aspect: None
  • Used for regularisation data: No

Inference

import torch
from simpletuner.helpers.models.flux3_image.pipeline import Flux3ImagePipeline as DiffusionPipeline

model_id = 'black-forest-labs/flux-3-image-klein'
adapter_id = 'SimpleTuner/flux-3-klein-image-training-assistant'
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."
negative_prompt = ''

## Optional: quantise the model to save on vram.
## Note: The model was not quantised during training, so it is not necessary to quantise it 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
model_output = pipeline(
    prompt=prompt,
    negative_prompt=negative_prompt,
    num_inference_steps=16,
    generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42),
    width=512,
    height=512,
    guidance_scale=1.0,
).images[0]

model_output.save("output.png", format="PNG")
Downloads last month
8
Inference Examples
Examples
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for SimpleTuner/flux-3-klein-image-training-assistant

Adapter
(9)
this model

Collection including SimpleTuner/flux-3-klein-image-training-assistant