model:
  pretrained_model_name_or_path: "Qwen/Qwen-Image"
  mode: "finetune"
  cache_dir: null
  attention_backend: "flash"

optim:
  learning_rate: 1e-5

  optimizer:
    weight_decay: 0.01
    betas: [0.9, 0.999]

#adjust dp_size to the total number of GPUs
fsdp:
  dp_size: 8
  tp_size: 1
  cp_size: 1
  pp_size: 1
  activation_checkpointing: false
  cpu_offload: false

flow_matching:
  adapter_type: "qwen_image"
  adapter_kwargs:
    guidance_scale: 3.5
    use_guidance_embeds: false
  timestep_sampling: "logit_normal"
  logit_mean: 0.0
  logit_std: 1.0
  flow_shift: 2.23
  mix_uniform_ratio: 0.0
  sigma_min: 0.02
  sigma_max: 1.0
  num_train_timesteps: 1000
  i2v_prob: 0.0
  use_loss_weighting: true
  loss_weighting_scheme: "bsmntw"
  log_interval: 100
  summary_log_interval: 10

step_scheduler:
  num_epochs: 10
  local_batch_size: 1
  global_batch_size: 8
  ckpt_every_steps: 500
  save_checkpoint_every_epoch: false
  log_every: 1
  # max_steps: null  # Set to limit training to a specific number of steps

data:
  dataloader:
    _target_: nemo_automodel.components.datasets.diffusion.build_text_to_image_multiresolution_dataloader
    cache_dir: PATH_TO_YOUR_DATA
    train_text_encoder: false
    num_workers: 2
    # Supported resolutions include [256x256], [512x512], and [1024x1024].
    base_resolution: [512, 512]
    dynamic_batch_size: false
    shuffle: true
    drop_last: false

checkpoint:
  enabled: true
  checkpoint_dir: PATH_TO_YOUR_CKPT_DIR
  model_save_format: safetensors
  save_consolidated: true
  diffusers_compatible: true
  restore_from: null

wandb:
  project: qwen-image-finetuning
  mode: online
  name: qwen_image_finetune_run_1

dist_env:
  backend: "nccl"
  init_method: "env://"

seed: 42

ci:
  recipe_owner: pthombre
  time: "00:30:00"
