Views
No views yet
export MODEL_NAME="black-forest-labs/FLUX.1-dev"
export INSTANCE_DIR="/pvol/Julia Garner"
export OUTPUT_DIR="/pvol/julia_garner_lora_flux"
accelerate config default
accelerate launch train_dreambooth_lora_flux1.py \
--pretrained_model_name_or_path=$MODEL_NAME \
--mixed_precision="bf16" \
--dataset_name=$INSTANCE_DIR \
--output_dir=$OUTPUT_DIR \
--gradient_checkpointing \
--instance_prompt="Julia Garner" \
--caption_column="text" \
--resolution=1024 \
--train_batch_size=1 \
--guidance_scale=1 \
--use_8bit_adam \
--checkpointing_steps=100 \
--gradient_accumulation_steps=4 \
--optimizer="adamW" \
--learning_rate=1e-4 \
--lr_scheduler="constant" \
--lr_warmup_steps=100 \
--max_train_steps=1500 \
--rank=4 \
--seed="0" 1import torch
2from diffusers import FluxPipeline
3
4device = "cuda:0"
5
6pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
7
8pipe.load_lora_weights("je-suis-tm/julia_garner_lora_flux",
9 weight_name='pytorch_lora_weights.safetensors')
10
11
12prompt = "Julia Garner lying on a bed, almost white bedding; Bali; relax, read a BAZAAR magazine; Photo by Alexandr Tikhomirov; detailed touches; dressed beautiful pretty face with roughly skin, pretty clothes, levity; ultra realistic photo --q 2 --s 750 --v 5 --chaos 28 --v 5 --q 2"
13
14image = pipe(
15 prompt=prompt,
16 generator=torch.Generator(device=device).manual_seed(42),
17 num_inference_steps=50, # 28 is a good trade-off
18 guidance_scale=4,
19 height=1024,
20 width=1024,
21).images[0]
22
23image.save("Julia Garner.png")Julia Garner to trigger the image generation.