Run this model with HF Jobs
Run OnePunchMonk101010/dptlab-klein-dora-subject5 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/OnePunchMonk101010/dptlab-klein-dora-subject5. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/OnePunchMonk101010/dptlab-klein-dora-subject5 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use OnePunchMonk101010/dptlab-klein-dora-subject5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use OnePunchMonk101010/dptlab-klein-dora-subject5 with Diffusers:
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.2-klein-4B", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("OnePunchMonk101010/dptlab-klein-dora-subject5") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
import torch
from diffusers import DiffusionPipeline
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.2-klein-4B", dtype=torch.bfloat16, device_map="cuda")
pipe.load_lora_weights("OnePunchMonk101010/dptlab-klein-dora-subject5")
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]dptlab-klein-dora-subject5
Post-trained with dptlab
using the lora recipe with a dora adapter, on top of
black-forest-labs/FLUX.2-klein-4B.
Trainable parameters: 14.5M.
Training config
{
"model_key": "flux2-klein-4b",
"recipe": "lora",
"dataset_path": "/root/data/syncd/subject-5",
"output_dir": "/root/outputs/klein-peft/dora/subject-5",
"resolution": 512,
"learning_rate": 0.0001,
"train_batch_size": 1,
"gradient_accumulation_steps": 4,
"max_train_steps": 500,
"lora_rank": 16,
"lora_alpha": 16,
"peft_method": "dora",
"max_grad_norm": 1.0,
"use_masks": true,
"mixed_precision": "bf16",
"seed": 42,
"checkpointing_steps": 500,
"validation_prompts": [],
"validation_steps": 500,
"extra": {
"sampling_steps_for_shift": 4,
"logit_mean": 0.0,
"logit_std": 1.0
}
}
Benchmark
Split: heldout (6 prompts). Prompts describe settings no training image shows.
| CLIP-T (prompt) | DINO (subject) | CLIP-I (subject) | Avg. latency (ms) |
|---|---|---|---|
| 0.9572 | 0.4424 | 0.7167 | 2289 |
CLIP-T and DINO pull in opposite directions: an adapter that learned nothing scores well on the first, one that memorized its training shots scores well on the second. Read them together.
See RESULTS.md in the repo for all six methods and the confounds.
Usage
import torch
from diffusers import DiffusionPipeline
from huggingface_hub import snapshot_download
# `dora` is not a format `pipe.load_lora_weights()` can read -- it would
# log "no LoRA keys found" and silently serve the base model. Inject via peft.
from dptlab.training.peft_methods import load_peft_checkpoint # pip install dptlab
pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.2-klein-4B", torch_dtype=torch.bfloat16).to("cuda")
denoiser = pipe.unet if hasattr(pipe, "unet") else pipe.transformer
load_peft_checkpoint(pipe, denoiser, snapshot_download("OnePunchMonk101010/dptlab-klein-dora-subject5"), "dora", for_training=False)
image = pipe(prompt="your prompt here", num_inference_steps=4, guidance_scale=1.0).images[0]
- Downloads last month
- 129
Model tree for OnePunchMonk101010/dptlab-klein-dora-subject5
Base model
black-forest-labs/FLUX.2-klein-4B