From e74a9a60e56cdc9260f9f40ba9c2ad93f4def1ff Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Sat, 2 May 2026 09:09:06 +0200 Subject: [PATCH] fix kandinsky detection Co-authored-by: Copilot Signed-off-by: Vladimir Mandic --- CHANGELOG.md | 8 +++----- modules/processing_args.py | 9 +++------ modules/sd_detect.py | 2 +- modules/sd_models.py | 3 ++- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 370e7bd4c..89124bfc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,14 @@ # Change Log for SD.Next -## TODO - -- Tag multi-image pipes with `use_images_direct` and allow UI override - ## Update for 2026-05-02 - **Features** - **Multi-image** workflows! for models that support multiple images as inputs, you can now add multiple stages in Kanvas prompts like "*place character from first image, add background from second image, render in style from third image*" are now possible + - option *inputs -> skip processing* to force images to passed to model as-is without any pre-processing + examples of models that support multi-inputs: *qwen-image-edit, flux.2, google-gemini* - **Anima** support for *img2img* and *inpaint* workflows - - option *inputs -> skip processing* to force images to passed to model as-is without any pre-processing - **UI** - add button to manually reorient input/output panels - all ui panels can be minimized/maximized by clicking on their header @@ -29,6 +26,7 @@ - save handle already decoded images - ernie-image preview - lora false deactivate + - kandinsky-5 t2i/i2i workflows ## Update for 2026-04-28 diff --git a/modules/processing_args.py b/modules/processing_args.py index 635bb4f2a..c1d497d3a 100644 --- a/modules/processing_args.py +++ b/modules/processing_args.py @@ -129,14 +129,11 @@ def task_specific_kwargs(p, model): } # model specific args - if ('QwenImageEdit' in model_cls) and (p.init_images is None or len(p.init_images) == 0): - task_args['image'] = [Image.new('RGB', (p.width, p.height), (0, 0, 0))] # monkey-patch so qwen-image-edit pipeline does not error-out on t2i - if ('QwenImageEditPlusPipeline' in model_cls) and (p.init_control is not None) and (len(p.init_control) > 0): - task_args['image'] += p.init_control + if (('QwenImageEdit' in model_cls) or ('Kandinsky5I2IPipeline' in model_cls)) and (p.init_images is None or len(p.init_images) == 0): + log.debug(f'Model init: cls={model_cls} image=blank') + task_args['image'] = [Image.new('RGB', (p.width, p.height), (0, 0, 0))] # monkey-patch so i2i pipeline does not error-out on t2i if ('QwenImageLayeredPipeline' in model_cls) and (p.init_images is not None) and (len(p.init_images) > 0): task_args['image'] = p.init_images[0].convert('RGBA') - if ('Flux2' in model_cls) and (p.init_control is not None) and (len(p.init_control) > 0): - task_args['image'] += p.init_control if ('LatentConsistencyModelPipeline' in model_cls) and (len(p.init_images) > 0): p.ops.append('lcm') init_latents = [processing_vae.vae_encode(image, model=shared.sd_model, vae_type=p.vae_type).squeeze(dim=0) for image in p.init_images] diff --git a/modules/sd_detect.py b/modules/sd_detect.py index 6cbbc0ca4..5d8f612c6 100644 --- a/modules/sd_detect.py +++ b/modules/sd_detect.py @@ -126,7 +126,7 @@ def guess_by_name(fn, current_guess): new_guess = 'Kandinsky 2.2' elif 'kandinsky-3' in fn.lower(): new_guess = 'Kandinsky 3.0' - elif 'kandinsky-5.0' in fn.lower() and '2i' not in fn.lower(): + elif 'kandinsky-5.0' in fn.lower(): new_guess = 'Kandinsky 5.0' elif 'hunyuanimage3' in fn.lower() or 'hunyuanimage-3' in fn.lower(): new_guess = 'HunyuanImage3' diff --git a/modules/sd_models.py b/modules/sd_models.py index 5e9e847d2..108fce54c 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -51,6 +51,7 @@ pipe_switch_task_exclude = [ 'NucleusMoEImagePipeline', 'AuraFlowPipeline', 'ChronoEditPipeline', + 'Kandinsky5I2IPipeline', 'GoogleNanoBananaPipeline', ] i2i_pipes = [ @@ -482,7 +483,7 @@ def load_diffuser_force(detected_model_type, checkpoint_info, diffusers_load_con from pipelines.model_kandinsky import load_kandinsky3 sd_model = load_kandinsky3(checkpoint_info, diffusers_load_config) allow_post_quant = False - elif model_type in ['Kandinsky 5.0'] and model_type: + elif model_type in ['Kandinsky 5.0']: from pipelines.model_kandinsky import load_kandinsky5 sd_model = load_kandinsky5(checkpoint_info, diffusers_load_config) allow_post_quant = False