Instructions to use serbdev/another-lora-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use serbdev/another-lora-2 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.1-schnell", torch_dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("serbdev/another-lora-2") prompt = "p3rs0n a man walking his dog on a leash, holding a magnifying glass in his hand. He is wearing a blue shirt and jeans, and has a determined expression on his face. The dog is a medium-sized breed with a white and brown coat. The background of the image is a bright blue sky with white clouds. --d 40" image = pipe(prompt).images[0] - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
| accelerate launch \ | |
| --mixed_precision bf16 \ | |
| --num_cpu_threads_per_process 1 \ | |
| sd-scripts/flux_train_network.py \ | |
| --pretrained_model_name_or_path "/app/fluxgym/models/unet/flux1-schnell.safetensors" \ | |
| --clip_l "/app/fluxgym/models/clip/clip_l.safetensors" \ | |
| --t5xxl "/app/fluxgym/models/clip/t5xxl_fp16.safetensors" \ | |
| --ae "/app/fluxgym/models/vae/ae.sft" \ | |
| --cache_latents_to_disk \ | |
| --save_model_as safetensors \ | |
| --sdpa --persistent_data_loader_workers \ | |
| --max_data_loader_n_workers 2 \ | |
| --seed 42 \ | |
| --gradient_checkpointing \ | |
| --mixed_precision bf16 \ | |
| --save_precision bf16 \ | |
| --network_module networks.lora_flux \ | |
| --network_dim 4 \ | |
| --optimizer_type adamw8bit \--sample_prompts="/app/fluxgym/outputs/another-lora-2/sample_prompts.txt" --sample_every_n_steps="500" \ | |
| --learning_rate 8e-4 \ | |
| --cache_text_encoder_outputs \ | |
| --cache_text_encoder_outputs_to_disk \ | |
| --fp8_base \ | |
| --highvram \ | |
| --max_train_epochs 10 \ | |
| --save_every_n_epochs 4 \ | |
| --dataset_config "/app/fluxgym/outputs/another-lora-2/dataset.toml" \ | |
| --output_dir "/app/fluxgym/outputs/another-lora-2" \ | |
| --output_name another-lora-2 \ | |
| --timestep_sampling shift \ | |
| --discrete_flow_shift 3.1582 \ | |
| --model_prediction_type raw \ | |
| --guidance_scale 1 \ | |
| --loss_type l2 \ |