-
Training epochs: 2
-
Training steps: 1750
-
Learning rate: 8e-05
- Learning rate schedule: polynomial
- Warmup steps: 100
-
Max grad value: 2.0
-
Effective batch size: 2
- Micro-batch size: 2
- 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', 'flux_lora_target=all'])
-
Optimizer: adamw_bf16
-
Trainable parameter precision: Pure BF16
-
Base model precision: no_change
-
Caption dropout probability: 0.05%
-
LoRA Rank: 64
-
LoRA Alpha: None
-
LoRA Dropout: 0.1
-
LoRA initialisation style: default
1import torch
2from diffusers import DiffusionPipeline
3
4model_id = 'black-forest-labs/FLUX.1-dev'
5adapter_id = 'quzo/iwatch2'
6pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) # loading directly in bf16
7pipeline.load_lora_weights(adapter_id)
8
9prompt = "photo of iwatch"
10
11
12## Optional: quantise the model to save on vram.
13## Note: The model was not quantised during training, so it is not necessary to quantise it during inference time.
14#from optimum.quanto import quantize, freeze, qint8
15#quantize(pipeline.transformer, weights=qint8)
16#freeze(pipeline.transformer)
17
18pipeline.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
19model_output = pipeline(
20 prompt=prompt,
21 num_inference_steps=20,
22 generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42),
23 width=1024,
24 height=1024,
25 guidance_scale=3.0,
26).images[0]
27
28model_output.save("output.png", format="PNG")
29