cleanup qwen

Signed-off-by: vladmandic <mandic00@live.com>
pull/4493/head
vladmandic 2025-12-22 22:08:49 +01:00
parent 2a33d9f1a8
commit 4c43d9a1e6
2 changed files with 5 additions and 0 deletions

View File

@ -127,6 +127,8 @@ def task_specific_kwargs(p, model):
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 ('QwenImageLayeredPipeline' in model_cls) and (p.init_control is not None) and (len(p.init_images) > 0):
task_args['image'] = p.init_images[0]
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):

View File

@ -27,6 +27,9 @@ def load_qwen(checkpoint_info, diffusers_load_config=None):
diffusers.pipelines.auto_pipeline.AUTO_INPAINT_PIPELINES_MAPPING["qwen-image"] = diffusers.QwenImageEditPipeline
elif 'Layered' in repo_id:
cls_name = diffusers.QwenImageLayeredPipeline
diffusers.pipelines.auto_pipeline.AUTO_TEXT2IMAGE_PIPELINES_MAPPING["qwen-layered"] = diffusers.QwenImageEditPipeline
diffusers.pipelines.auto_pipeline.AUTO_IMAGE2IMAGE_PIPELINES_MAPPING["qwen-layered"] = diffusers.QwenImageEditPipeline
diffusers.pipelines.auto_pipeline.AUTO_INPAINT_PIPELINES_MAPPING["qwen-layered"] = diffusers.QwenImageEditPipeline
else:
cls_name = diffusers.QwenImagePipeline
diffusers.pipelines.auto_pipeline.AUTO_TEXT2IMAGE_PIPELINES_MAPPING["qwen-image"] = diffusers.QwenImagePipeline