fix sd3 img2img and hires

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2024-10-23 15:35:49 -04:00
parent f1cd2dfa99
commit da16080a9d
2 changed files with 8 additions and 7 deletions
+7 -6
View File
@@ -256,12 +256,13 @@ def set_pipeline_args(p, model, prompts: list, negative_prompts: list, prompts_2
# handle missing resolution
if args.get('image', None) is not None and ('width' not in args or 'height' not in args):
if isinstance(args['image'], torch.Tensor) or isinstance(args['image'], np.ndarray):
args['width'] = 8 * args['image'].shape[-1]
args['height'] = 8 * args['image'].shape[-2]
else:
args['width'] = 8 * math.ceil(args['image'][0].width / 8)
args['height'] = 8 * math.ceil(args['image'][0].height / 8)
if 'width' in possible and 'height' in possible:
if isinstance(args['image'], torch.Tensor) or isinstance(args['image'], np.ndarray):
args['width'] = 8 * args['image'].shape[-1]
args['height'] = 8 * args['image'].shape[-2]
else:
args['width'] = 8 * math.ceil(args['image'][0].width / 8)
args['height'] = 8 * math.ceil(args['image'][0].height / 8)
# handle implicit controlnet
if 'control_image' in possible and 'control_image' not in args and 'image' in args:
+1 -1
View File
@@ -77,7 +77,7 @@ def create_sampler(name, model):
if 'Lumina' in model.__class__.__name__:
shared.log.warning(f'AlphaVLLM-Lumina: sampler="{name}" unsupported')
return None
if 'StableDiffusion3Pipeline' in model.__class__.__name__:
if 'StableDiffusion3' in model.__class__.__name__:
if sampler.name != 'Heun FlowMatch':
return None
return None