@@ -112,10 +112,12 @@ struct SDParams {
112112 bool chroma_use_dit_mask = true ;
113113 bool chroma_use_t5_mask = false ;
114114 int chroma_t5_mask_pad = 1 ;
115+ float boundary = 0.875 ;
115116
116117 SDParams () {
117118 sd_sample_params_init (&sample_params);
118119 sd_sample_params_init (&high_noise_sample_params);
120+ high_noise_sample_params.sample_steps = -1 ;
119121 }
120122};
121123
@@ -240,7 +242,7 @@ void print_usage(int argc, const char* argv[]) {
240242 printf (" --high-noise-scheduler {discrete, karras, exponential, ays, gits} Denoiser sigma scheduler (default: discrete)\n " );
241243 printf (" --high-noise-sampling-method {euler, euler_a, heun, dpm2, dpm++2s_a, dpm++2m, dpm++2mv2, ipndm, ipndm_v, lcm, ddim_trailing, tcd}\n " );
242244 printf (" (high noise) sampling method (default: \" euler_a\" )\n " );
243- printf (" --high-noise-steps STEPS (high noise) number of sample steps (default: 20 )\n " );
245+ printf (" --high-noise-steps STEPS (high noise) number of sample steps (default: -1 = auto )\n " );
244246 printf (" SLG will be enabled at step int([STEPS]*[START]) and disabled at int([STEPS]*[END])\n " );
245247 printf (" --strength STRENGTH strength for noising/unnoising (default: 0.75)\n " );
246248 printf (" --style-ratio STYLE-RATIO strength for keeping input identity (default: 20)\n " );
@@ -271,6 +273,8 @@ void print_usage(int argc, const char* argv[]) {
271273 printf (" --chroma-t5-mask-pad PAD_SIZE t5 mask pad size of chroma\n " );
272274 printf (" --video-frames video frames (default: 1)\n " );
273275 printf (" --fps fps (default: 24)\n " );
276+ printf (" --moe-boundary BOUNDARY Timestep boundary for Wan2.2 MoE model. (default: 0.875)" );
277+ printf (" Only enabled if `--high-noise-steps` is set to -1" );
274278 printf (" -v, --verbose print extra info\n " );
275279}
276280
@@ -493,6 +497,7 @@ void parse_args(int argc, const char** argv, SDParams& params) {
493497 {" " , " --strength" , " " , ¶ms.strength },
494498 {" " , " --style-ratio" , " " , ¶ms.style_ratio },
495499 {" " , " --control-strength" , " " , ¶ms.control_strength },
500+ {" " , " --moe-boundary" , " " , ¶ms.boundary },
496501 };
497502
498503 options.bool_options = {
@@ -753,8 +758,7 @@ void parse_args(int argc, const char** argv, SDParams& params) {
753758 }
754759
755760 if (params.high_noise_sample_params .sample_steps <= 0 ) {
756- fprintf (stderr, " error: the high_noise_sample_steps must be greater than 0\n " );
757- exit (1 );
761+ params.high_noise_sample_params .sample_steps = -1 ;
758762 }
759763
760764 if (params.strength < 0 .f || params.strength > 1 .f ) {
@@ -1181,6 +1185,7 @@ int main(int argc, const char* argv[]) {
11811185 params.strength ,
11821186 params.seed ,
11831187 params.video_frames ,
1188+ params.boundary
11841189 };
11851190
11861191 results = generate_video (sd_ctx, &vid_gen_params, &num_results);
0 commit comments