@@ -80,7 +80,8 @@ struct SDParams {
8080 std::string control_image_path;
8181 std::vector<std::string> ref_image_paths;
8282 std::string control_video_path;
83- bool increase_ref_index = false ;
83+ bool auto_resize_ref_image = true ;
84+ bool increase_ref_index = false ;
8485
8586 std::string prompt;
8687 std::string negative_prompt;
@@ -175,6 +176,7 @@ void print_params(SDParams params) {
175176 printf (" %s\n " , path.c_str ());
176177 };
177178 printf (" control_video_path: %s\n " , params.control_video_path .c_str ());
179+ printf (" auto_resize_ref_image: %s\n " , params.auto_resize_ref_image ? " true" : " false" );
178180 printf (" increase_ref_index: %s\n " , params.increase_ref_index ? " true" : " false" );
179181 printf (" offload_params_to_cpu: %s\n " , params.offload_params_to_cpu ? " true" : " false" );
180182 printf (" clip_on_cpu: %s\n " , params.clip_on_cpu ? " true" : " false" );
@@ -244,9 +246,10 @@ void print_usage(int argc, const char* argv[]) {
244246 printf (" -i, --end-img [IMAGE] path to the end image, required by flf2v\n " );
245247 printf (" --control-image [IMAGE] path to image condition, control net\n " );
246248 printf (" -r, --ref-image [PATH] reference image for Flux Kontext models (can be used multiple times) \n " );
249+ printf (" --disable-auto-resize-ref-image disable auto resize of ref images\n " );
247250 printf (" --control-video [PATH] path to control video frames, It must be a directory path.\n " );
248251 printf (" The video frames inside should be stored as images in lexicographical (character) order\n " );
249- printf (" For example, if the control video path is `frames`, the directory contain images such as 00.png, 01.png, … etc.\n " );
252+ printf (" For example, if the control video path is `frames`, the directory contain images such as 00.png, 01.png, ... etc.\n " );
250253 printf (" --increase-ref-index automatically increase the indices of references images based on the order they are listed (starting with 1).\n " );
251254 printf (" -o, --output OUTPUT path to write result image to (default: ./output.png)\n " );
252255 printf (" -p, --prompt [PROMPT] the prompt to render\n " );
@@ -579,6 +582,7 @@ void parse_args(int argc, const char** argv, SDParams& params) {
579582 {" " , " --chroma-disable-dit-mask" , " " , false , ¶ms.chroma_use_dit_mask },
580583 {" " , " --chroma-enable-t5-mask" , " " , true , ¶ms.chroma_use_t5_mask },
581584 {" " , " --increase-ref-index" , " " , true , ¶ms.increase_ref_index },
585+ {" " , " --disable-auto-resize-ref-image" , " " , false , ¶ms.auto_resize_ref_image },
582586 };
583587
584588 auto on_mode_arg = [&](int argc, const char ** argv, int index) {
@@ -1428,6 +1432,7 @@ int main(int argc, const char* argv[]) {
14281432 init_image,
14291433 ref_images.data (),
14301434 (int )ref_images.size (),
1435+ params.auto_resize_ref_image ,
14311436 params.increase_ref_index ,
14321437 mask_image,
14331438 params.width ,
0 commit comments