Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions lightx2v_train/configs/train/consistency/qwen_image_cm_cd_lora.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
model:
name: qwen_image
pretrained_model_name_or_path: /root/yongyang/models/Qwen/Qwen-Image-2512
# Optional overrides let CD distill a different Qwen-Image checkpoint.
# teacher:
# pretrained_model_name_or_path: /root/yongyang/models/Qwen/Qwen-Image-2512
max_sequence_length: 1024
running_dtype: bf16

data:
train:
name: image_dataset
num_workers: 8
prompt_dropout_rate: 0.0
target_area: 1048576 # 1024 * 1024
shuffle: true
data_path:
- /root/yongyang/datasets/LightX2V_train_data_examples/dataset_v1/train.jsonl
val:
name: image_dataset
num_workers: 8
shuffle: false
data_path:
- /root/yongyang/datasets/LightX2V_train_data_examples/dataset_v1/val.jsonl

scheduler:
num_train_timesteps: 1000
timestep_distribution: logitnormal
logitnormal_mean: 0.0
logitnormal_std: 1.0
min_t: 0.001
max_t: 1.0
time_shift_settings:
do_time_shift: true
shift_type: exponential
time_shift_power: 1.0
dynamic_shift: true
patch_size: [2, 2]
shift_x1: 256
shift_x2: 4096
shift_y1: 0.5
shift_y2: 1.15

training:
method: consistency
train_type: lora
max_train_iters: 3000
gradient_accumulation_iters: 1
gradient_checkpointing: true
max_grad_norm: 1.0
lr_scheduler: constant
lr_warmup_iters: 10
save_every_iters: 100
save_total_limit: 10
consistency:
algorithm: cm
mode: cd
time_pair:
mapping: ect
q: 2.0
ratio_limit: 0.999
kimg_per_stage: 1.0
min_r: 0.0
safety_epsilon: 0.000001
loss:
distance: pseudo_huber
huber_constant: 0.00000001
weighting: inverse_delta
normalize_by_numel: false
computation_dtype: float32
teacher:
guidance_scale: 4.0
negative_prompt: " "
cfg_norm: none
lora:
rank: 16
alpha: 16
target_modules:
- to_k
- to_q
- to_v
- to_out.0
optimizer:
learning_rate: 0.0001
adam_beta1: 0.9
adam_beta2: 0.999
weight_decay: 0.01
adam_epsilon: 0.00000001
output_dir: ./output_train/qwen_image_cm_cd_lora

inference:
method: image_infer
negative_prompt: " "
default_width: 1024
default_height: 1024
num_inference_steps: 4
enable_cfg: true
cfg_guidance_scale: 4.0
seed: 42
output_dir: ./output_infer/qwen_image_cm_cd_lora
infer_every_iters: ${training.save_every_iters}

logging:
rank_zero_only: true
train_log_every_iters: 10
infer_log_every_steps: 10

resume:
auto_resume: true
104 changes: 104 additions & 0 deletions lightx2v_train/configs/train/consistency/qwen_image_cm_ct_lora.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
model:
name: qwen_image
pretrained_model_name_or_path: /root/yongyang/models/Qwen/Qwen-Image-2512
max_sequence_length: 1024
running_dtype: bf16

data:
train:
name: image_dataset
num_workers: 8
prompt_dropout_rate: 0.1
target_area: 1048576 # 1024 * 1024
shuffle: true
data_path:
- /root/yongyang/datasets/LightX2V_train_data_examples/dataset_v1/train.jsonl
val:
name: image_dataset
num_workers: 8
shuffle: false
data_path:
- /root/yongyang/datasets/LightX2V_train_data_examples/dataset_v1/val.jsonl

scheduler:
num_train_timesteps: 1000
timestep_distribution: logitnormal
logitnormal_mean: 0.0
logitnormal_std: 1.0
min_t: 0.001
max_t: 1.0
time_shift_settings:
do_time_shift: true
shift_type: exponential
time_shift_power: 1.0
dynamic_shift: true
patch_size: [2, 2]
shift_x1: 256
shift_x2: 4096
shift_y1: 0.5
shift_y2: 1.15

training:
method: consistency
train_type: lora
max_train_iters: 3000
gradient_accumulation_iters: 1
gradient_checkpointing: true
max_grad_norm: 1.0
lr_scheduler: constant
lr_warmup_iters: 10
save_every_iters: 100
save_total_limit: 10
consistency:
algorithm: cm
mode: ct
time_pair:
# FastGen/ECT sigmoid mapping. With global batch 1, one stage is
# 1000 optimizer steps; scale this with the actual global batch.
mapping: ect
q: 2.0
ratio_limit: 0.999
kimg_per_stage: 1.0
min_r: 0.0
safety_epsilon: 0.000001
loss:
distance: pseudo_huber
huber_constant: 0.00000001
weighting: inverse_delta
normalize_by_numel: false
computation_dtype: float32
lora:
rank: 16
alpha: 16
target_modules:
- to_k
- to_q
- to_v
- to_out.0
optimizer:
learning_rate: 0.0001
adam_beta1: 0.9
adam_beta2: 0.999
weight_decay: 0.01
adam_epsilon: 0.00000001
output_dir: ./output_train/qwen_image_cm_ct_lora

inference:
method: image_infer
negative_prompt: " "
default_width: 1024
default_height: 1024
num_inference_steps: 4
enable_cfg: true
cfg_guidance_scale: 4.0
seed: 42
output_dir: ./output_infer/qwen_image_cm_ct_lora
infer_every_iters: ${training.save_every_iters}

logging:
rank_zero_only: true
train_log_every_iters: 10
infer_log_every_steps: 10

resume:
auto_resume: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
model:
name: qwen_image
pretrained_model_name_or_path: /root/yongyang/models/Qwen/Qwen-Image-2512
max_sequence_length: 1024
running_dtype: bf16

data:
train:
name: image_dataset
num_workers: 8
prompt_dropout_rate: 0.1
target_area: 1048576
shuffle: true
data_path:
- /root/yongyang/datasets/LightX2V_train_data_examples/dataset_v1/train.jsonl

scheduler:
num_train_timesteps: 1000
timestep_distribution: logitnormal
logitnormal_mean: -1.1
logitnormal_std: 2.0
min_t: 0.001
max_t: 1.0
time_shift_settings:
do_time_shift: true
shift_type: exponential
time_shift_power: 1.0
dynamic_shift: true
patch_size: [2, 2]
shift_x1: 256
shift_x2: 4096
shift_y1: 0.5
shift_y2: 1.15

training:
method: consistency
train_type: lora
max_train_iters: 10000
gradient_accumulation_iters: 1
gradient_checkpointing: true
max_grad_norm: 1.0
lr_scheduler: constant
lr_warmup_iters: 10
save_every_iters: 100
save_total_limit: 10
consistency:
algorithm: mean_flow
mode: ct
sampling:
# The remaining samples use r=t and retain a flow-matching anchor.
random_endpoint_probability: 0.5
jvp:
method: finite_difference
epsilon: 0.0001
loss:
type: opt_grad
norm_method: poly_1.0
norm_constant: 0.1
tangent_warmup_steps: 0
spatially_normalized_tangent: false
lora:
rank: 16
alpha: 16
target_modules: [to_k, to_q, to_v, to_out.0]
optimizer:
learning_rate: 0.0001
adam_beta1: 0.9
adam_beta2: 0.999
weight_decay: 0.0
adam_epsilon: 0.00000001
output_dir: ./output_train/qwen_image_mean_flow_ct_lora

inference:
# MeanFlow ODE sampling must pass r=t_next on every step; the standard
# Qwen pipeline cannot express that endpoint yet.
method: none

logging:
rank_zero_only: true
train_log_every_iters: 10

resume:
auto_resume: true
Loading
Loading