Z-Image LoRA Training Guide (40 Images)

Follow these settings exactly on your first run.
The learning rates were chosen intentionally.
Do not change them until after one clean full run.


========================
DATASET
========================

- Use ~40 clean images
- Keep source images 1024x1024 or larger
- Square format preferred
- Good lighting and centered subject
- Let AI-Toolkit resize during training


==================================================
Z-IMAGE BASE (FULL EXAMPLE SETTINGS)
==================================================

MODEL SECTION:

model:
  arch: zimage

DATASET SECTION:

datasets:
  resolution:
    - 512

TRAIN SECTION:

train:
  optimizer: adamw
  lr: 0.0004
  batch_size: 1
  gradient_accumulation: 2
  dtype: bf16
  bypass_guidance_embedding: true
  noise_scheduler: flowmatch
  cache_text_embeddings: false
  steps: 1000

SAMPLE SECTION:

sample:
  guidance_scale: 5
  sample_steps: 30


Why Base uses 512:
- Sharper identity learning
- More stable gradients
- Less PC strain
- 512 is a key reason Base LoRAs look sharper

For Base → 512 ONLY.


==================================================
Z-IMAGE TURBO (FULL EXAMPLE SETTINGS)
==================================================

MODEL SECTION:

model:
  arch: zimage:turbo
  assistant_lora_path: c:/AI-Toolkit/AI-Toolkit/models/zimage_turbo_training_adapter/zimage_turbo_training_adapter_v2.safetensors

DATASET SECTION:

datasets:
  resolution:
    - 768

TRAIN SECTION:

train:
  optimizer: adamw
  lr: 0.0002
  batch_size: 1
  gradient_accumulation: 2
  dtype: bf16
  bypass_guidance_embedding: true
  noise_scheduler: flowmatch
  cache_text_embeddings: false
  steps: 1000

SAMPLE SECTION:

sample:
  guidance_scale: 1
  sample_steps: 8


Why Turbo differs:
- Turbo handles 768 better
- Turbo requires lower LR (0.0002)
- Turbo uses guidance_scale 1 for sampling
- Turbo requires training adapter


==================================================
IMPORTANT
==================================================

These settings MUST be manually edited in the config file:

Inside train:
  bypass_guidance_embedding: true

Inside model (Turbo only):
  arch: zimage:turbo
  assistant_lora_path: (turbo adapter path)

The learning rates were chosen intentionally:
- Base → 0.0004
- Turbo → 0.0002

Run one full training first before experimenting.
