@@ -682,9 +682,12 @@ sd_generation_outputs sdtype_generate(const sd_generation_inputs inputs)
682682 sd_params->clip_skip = inputs.clip_skip ;
683683 sd_params->sample_method = sampler_from_name (inputs.sample_method );
684684
685+ auto loadedsdver = get_loaded_sd_version (sd_ctx);
685686 bool is_img2img = img2img_data != " " ;
687+ bool is_wan = (loadedsdver == SDVersion::VERSION_WAN2 || loadedsdver == SDVersion::VERSION_WAN2_2_I2V || loadedsdver == SDVersion::VERSION_WAN2_2_TI2V);
688+ bool is_qwenimg = (loadedsdver == SDVersion::VERSION_QWEN_IMAGE);
689+ bool is_kontext = (loadedsdver==SDVersion::VERSION_FLUX && !loaded_model_is_chroma (sd_ctx));
686690
687- auto loadedsdver = get_loaded_sd_version (sd_ctx);
688691 if (loadedsdver == SDVersion::VERSION_FLUX)
689692 {
690693 if (!loaded_model_is_chroma (sd_ctx) && sd_params->cfg_scale != 1 .0f ) {
@@ -703,6 +706,11 @@ sd_generation_outputs sdtype_generate(const sd_generation_inputs inputs)
703706 }
704707 }
705708
709+ if (is_wan && extra_image_data.size ()==0 && is_img2img)
710+ {
711+ extra_image_data.push_back (img2img_data);
712+ }
713+
706714 const int default_res_limit = 8192 ; // arbitrary, just to simplify the code
707715 // avoid crashes due to bugs/limitations on certain models
708716 // although it can be possible for a single side to exceed 1024, the total resolution of the image
@@ -739,9 +747,6 @@ sd_generation_outputs sdtype_generate(const sd_generation_inputs inputs)
739747 std::vector<sd_image_t > kontext_imgs;
740748 std::vector<sd_image_t > wan_imgs;
741749 std::vector<sd_image_t > photomaker_imgs;
742- bool is_wan = (loadedsdver == SDVersion::VERSION_WAN2 || loadedsdver == SDVersion::VERSION_WAN2_2_I2V || loadedsdver == SDVersion::VERSION_WAN2_2_TI2V);
743- bool is_qwenimg = (loadedsdver == SDVersion::VERSION_QWEN_IMAGE);
744- bool is_kontext = (loadedsdver==SDVersion::VERSION_FLUX && !loaded_model_is_chroma (sd_ctx));
745750
746751 if (is_qwenimg)
747752 {
0 commit comments