Skip to content

Commit

Permalink
fix pulid
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Mandic <[email protected]>
  • Loading branch information
vladmandic committed Jan 10, 2025
1 parent 6030e95 commit 465d7ca
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion modules/control/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion modules/processing_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion modules/processing_diffusers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions modules/sd_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 465d7ca

Please sign in to comment.