@@ -115,6 +115,7 @@ struct SDParams {
115115 bool chroma_use_dit_mask = true ;
116116 bool chroma_use_t5_mask = false ;
117117 int chroma_t5_mask_pad = 1 ;
118+ float flow_shift = INFINITY;
118119
119120 SDParams () {
120121 sd_sample_params_init (&sample_params);
@@ -171,6 +172,7 @@ void print_params(SDParams params) {
171172 printf (" sample_params: %s\n " , SAFE_STR (sample_params_str));
172173 printf (" high_noise_sample_params: %s\n " , SAFE_STR (high_noise_sample_params_str));
173174 printf (" moe_boundary: %.3f\n " , params.moe_boundary );
175+ printf (" flow_shift: %.2f\n " , params.flow_shift );
174176 printf (" strength(img2img): %.2f\n " , params.strength );
175177 printf (" rng: %s\n " , sd_rng_type_name (params.rng_type ));
176178 printf (" seed: %ld\n " , params.seed );
@@ -278,8 +280,9 @@ void print_usage(int argc, const char* argv[]) {
278280 printf (" --chroma-t5-mask-pad PAD_SIZE t5 mask pad size of chroma\n " );
279281 printf (" --video-frames video frames (default: 1)\n " );
280282 printf (" --fps fps (default: 24)\n " );
281- printf (" --moe-boundary BOUNDARY Timestep boundary for Wan2.2 MoE model. (default: 0.875)\n " );
282- printf (" Only enabled if `--high-noise-steps` is set to -1\n " );
283+ printf (" --moe-boundary BOUNDARY timestep boundary for Wan2.2 MoE model. (default: 0.875)\n " );
284+ printf (" only enabled if `--high-noise-steps` is set to -1\n " );
285+ printf (" --flow-shift SHIFT shift value for Flow models like SD3.x or WAN (default: auto)\n " );
283286 printf (" -v, --verbose print extra info\n " );
284287}
285288
@@ -514,6 +517,7 @@ void parse_args(int argc, const char** argv, SDParams& params) {
514517 {" " , " --style-ratio" , " " , ¶ms.style_ratio },
515518 {" " , " --control-strength" , " " , ¶ms.control_strength },
516519 {" " , " --moe-boundary" , " " , ¶ms.moe_boundary },
520+ {" " , " --flow-shift" , " " , ¶ms.flow_shift },
517521 };
518522
519523 options.bool_options = {
@@ -1181,6 +1185,7 @@ int main(int argc, const char* argv[]) {
11811185 params.chroma_use_dit_mask ,
11821186 params.chroma_use_t5_mask ,
11831187 params.chroma_t5_mask_pad ,
1188+ params.flow_shift ,
11841189 };
11851190
11861191 sd_ctx_t * sd_ctx = new_sd_ctx (&sd_ctx_params);
0 commit comments