wan init image fix

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-09-18 11:40:01 -04:00
parent d2b9930d56
commit 5606519085
2 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -126,9 +126,9 @@ def task_specific_kwargs(p, model):
'target_subject_category': getattr(p, 'prompt', '').split()[-1],
'output_type': 'pil',
}
if model.__class__.__name__ == 'WanImageToVideoPipeline' and hasattr(p, 'init_images') and len(p.init_images) > 0:
if (model.__class__.__name__ == 'WanImageToVideoPipeline') and (getattr(p, 'init_images', None) is not None) and (len(p.init_images) > 0):
task_args['image'] = p.init_images[0]
if model.__class__.__name__ == 'WanVACEPipeline' and hasattr(p, 'init_images') and len(p.init_images) > 0:
if (model.__class__.__name__ == 'WanVACEPipeline') and (getattr(p, 'init_images', None) is not None) and (len(p.init_images) > 0):
task_args['reference_images'] = p.init_images
if debug_enabled:
+2 -1
View File
@@ -50,4 +50,5 @@ def set_overrides(p: processing.StableDiffusionProcessingVideo, selected: Model)
p.frames = 4 * (max(p.frames // 4, 1)) + 1
# WAN VACE
if 'WanVACEPipeline' in cls:
p.task_args['reference_images'] = 1
if (getattr(p, 'init_images', None) is not None) and (len(p.init_images) > 0):
p.task_args['reference_images'] = p.init_images