From 465d7caa3a066cdc95dc99a2ed1f08d555af3fde Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Fri, 10 Jan 2025 08:00:17 -0500 Subject: [PATCH] fix pulid Signed-off-by: Vladimir Mandic --- modules/control/run.py | 4 +++- modules/processing_args.py | 4 +++- modules/processing_diffusers.py | 2 +- modules/sd_models.py | 2 ++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/control/run.py b/modules/control/run.py index 93a9c43fc..74928dc64 100644 --- a/modules/control/run.py +++ b/modules/control/run.py @@ -410,7 +410,9 @@ def control_run(state: str = '', blended_image = None # set pipeline - if pipe.__class__.__name__ != shared.sd_model.__class__.__name__: + if pipe is None: + return [], '', '', 'Pipeline not set' + elif pipe.__class__.__name__ != shared.sd_model.__class__.__name__: original_pipeline = shared.sd_model shared.sd_model = pipe sd_models.move_model(shared.sd_model, shared.device) diff --git a/modules/processing_args.py b/modules/processing_args.py index 62b0db5cf..b703a80fa 100644 --- a/modules/processing_args.py +++ b/modules/processing_args.py @@ -365,5 +365,7 @@ def set_pipeline_args(p, model, prompts:list, negative_prompts:list, prompts_2:t if debug_enabled: debug_log(f'Diffusers pipeline args: {args}') - _args = copy.deepcopy(args) # pipeline may modify underlying args + _args = {} + for k, v in args.items(): + _args[k] = copy.deepcopy(v) if not torch.is_tensor(v) else v # pipeline may modify underlying args return _args diff --git a/modules/processing_diffusers.py b/modules/processing_diffusers.py index ea2cf56ea..c20ba85a8 100644 --- a/modules/processing_diffusers.py +++ b/modules/processing_diffusers.py @@ -175,7 +175,7 @@ def process_hires(p: processing.StableDiffusionProcessing, output): if shared.opts.samples_save and not p.do_not_save_samples and shared.opts.save_images_before_highres_fix and hasattr(shared.sd_model, 'vae'): save_intermediate(p, latents=output.images, suffix="-before-hires") shared.state.update('Upscale', 0, 1) - output.images = resize_hires(p, latents=output.images) + output.images = resize_hires(p, latents=output.images) if output is not None else [] sd_hijack_hypertile.hypertile_set(p, hr=True) latent_upscale = shared.latent_upscale_modes.get(p.hr_upscaler, None) diff --git a/modules/sd_models.py b/modules/sd_models.py index ff64db644..9cbdc67dc 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -1085,6 +1085,8 @@ def get_signature(cls): def get_call(cls): + if cls is None: + return [] signature = inspect.signature(cls.__call__, follow_wrapped=True, eval_str=True) return signature.parameters