@@ -113,10 +113,12 @@ struct SDParams {
113113 bool chroma_use_dit_mask = true ;
114114 bool chroma_use_t5_mask = false ;
115115 int chroma_t5_mask_pad = 1 ;
116+ float boundary = 0.875 ;
116117
117118 SDParams () {
118119 sd_sample_params_init (&sample_params);
119120 sd_sample_params_init (&high_noise_sample_params);
121+ high_noise_sample_params.sample_steps = -1 ;
120122 }
121123};
122124
@@ -243,7 +245,7 @@ void print_usage(int argc, const char* argv[]) {
243245 printf (" --high-noise-scheduler {discrete, karras, exponential, ays, gits} Denoiser sigma scheduler (default: discrete)\n " );
244246 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 " );
245247 printf (" (high noise) sampling method (default: \" euler_a\" )\n " );
246- printf (" --high-noise-steps STEPS (high noise) number of sample steps (default: 20 )\n " );
248+ printf (" --high-noise-steps STEPS (high noise) number of sample steps (default: -1 = auto )\n " );
247249 printf (" SLG will be enabled at step int([STEPS]*[START]) and disabled at int([STEPS]*[END])\n " );
248250 printf (" --strength STRENGTH strength for noising/unnoising (default: 0.75)\n " );
249251 printf (" --style-ratio STYLE-RATIO strength for keeping input identity (default: 20)\n " );
@@ -274,6 +276,8 @@ void print_usage(int argc, const char* argv[]) {
274276 printf (" --chroma-t5-mask-pad PAD_SIZE t5 mask pad size of chroma\n " );
275277 printf (" --video-frames video frames (default: 1)\n " );
276278 printf (" --fps fps (default: 24)\n " );
279+ printf (" --moe-boundary BOUNDARY Timestep boundary for Wan2.2 MoE model. (default: 0.875)" );
280+ printf (" Only enabled if `--high-noise-steps` is set to -1" );
277281 printf (" -v, --verbose print extra info\n " );
278282}
279283
@@ -507,6 +511,7 @@ void parse_args(int argc, const char** argv, SDParams& params) {
507511 {" " , " --strength" , " " , ¶ms.strength },
508512 {" " , " --style-ratio" , " " , ¶ms.style_ratio },
509513 {" " , " --control-strength" , " " , ¶ms.control_strength },
514+ {" " , " --moe-boundary" , " " , ¶ms.boundary },
510515 };
511516
512517 options.bool_options = {
@@ -767,8 +772,7 @@ void parse_args(int argc, const char** argv, SDParams& params) {
767772 }
768773
769774 if (params.high_noise_sample_params .sample_steps <= 0 ) {
770- fprintf (stderr, " error: the high_noise_sample_steps must be greater than 0\n " );
771- exit (1 );
775+ params.high_noise_sample_params .sample_steps = -1 ;
772776 }
773777
774778 if (params.strength < 0 .f || params.strength > 1 .f ) {
@@ -1225,6 +1229,7 @@ int main(int argc, const char* argv[]) {
12251229 params.strength ,
12261230 params.seed ,
12271231 params.video_frames ,
1232+ params.boundary
12281233 };
12291234
12301235 results = generate_video (sd_ctx, &vid_gen_params, &num_results);
0 commit comments