mirror of https://github.com/vladmandic/automatic
inpaint mask checks
parent
8b9d85a386
commit
c7a8d10df8
|
|
@ -139,7 +139,7 @@ def process_diffusers(p: processing.StableDiffusionProcessing):
|
|||
width, height = resize_init_images(p)
|
||||
task_args = {
|
||||
'image': p.init_images,
|
||||
'mask_image': p.image_mask,
|
||||
'mask_image': p.task_args.get('image_mask', None) or getattr(p, 'image_mask', None) or getattr(p, 'mask', None),
|
||||
'strength': p.denoising_strength,
|
||||
'height': height,
|
||||
'width': width,
|
||||
|
|
@ -269,6 +269,7 @@ def process_diffusers(p: processing.StableDiffusionProcessing):
|
|||
args[arg] = kwargs[arg]
|
||||
else:
|
||||
pass
|
||||
|
||||
task_kwargs = task_specific_kwargs(model)
|
||||
for arg in task_kwargs:
|
||||
# if arg in possible and arg not in args: # task specific args should not override args
|
||||
|
|
@ -354,6 +355,9 @@ def process_diffusers(p: processing.StableDiffusionProcessing):
|
|||
p.task_args['sag_scale'] = p.sag_scale
|
||||
else:
|
||||
shared.log.warning(f'SAG incompatible scheduler: current={sd_model.scheduler.__class__.__name__} supported={supported}')
|
||||
if sd_models.get_diffusers_task(sd_model) == sd_models.DiffusersTaskType.INPAINTING and getattr(p, 'image_mask', None) is None and p.task_args.get('image_mask', None) is None and getattr(p, 'mask', None) is None:
|
||||
shared.log.warning('Processing: mode=inpaint mask=None')
|
||||
sd_model = sd_models.set_diffuser_pipe(sd_model, sd_models.DiffusersTaskType.IMAGE_2_IMAGE)
|
||||
if shared.opts.cuda_compile_backend == "olive-ai":
|
||||
sd_model = olive_check_parameters_changed(p, is_refiner_enabled())
|
||||
if sd_model.__class__.__name__ == "OnnxRawPipeline":
|
||||
|
|
|
|||
|
|
@ -72,14 +72,14 @@ class Script(scripts.Script):
|
|||
return
|
||||
args = list(args)
|
||||
units = args.pop(0)
|
||||
if p.ip_adapter_names == []:
|
||||
if getattr(p, 'ip_adapter_names', []) == []:
|
||||
p.ip_adapter_names = args[:MAX_ADAPTERS][:units]
|
||||
if p.ip_adapter_scales == [0.0]:
|
||||
if getattr(p, 'ip_adapter_scales', [0.0]) == [0.0]:
|
||||
p.ip_adapter_scales = args[MAX_ADAPTERS:MAX_ADAPTERS*2][:units]
|
||||
if p.ip_adapter_images == []:
|
||||
if getattr(p, 'ip_adapter_images', []) == []:
|
||||
p.ip_adapter_images = args[MAX_ADAPTERS*2:MAX_ADAPTERS*3][:units]
|
||||
if p.ip_adapter_starts == [0.0]:
|
||||
if getattr(p, 'ip_adapter_starts', [0.0]) == [0.0]:
|
||||
p.ip_adapter_starts = args[MAX_ADAPTERS*3:MAX_ADAPTERS*4][:units]
|
||||
if p.ip_adapter_ends == [1.0]:
|
||||
if getattr(p, 'ip_adapter_ends', [1.0]) == [1.0]:
|
||||
p.ip_adapter_ends = args[MAX_ADAPTERS*4:MAX_ADAPTERS*5][:units]
|
||||
# ipadapter.apply(shared.sd_model, p, p.ip_adapter_names, p.ip_adapter_scales, p.ip_adapter_starts, p.ip_adapter_ends, p.ip_adapter_images) # called directly from processing.process_images_inner
|
||||
|
|
|
|||
Loading…
Reference in New Issue