create_ui and process refactor

This commit is contained in:
Vladimir Mandic
2023-12-15 18:53:03 -05:00
parent e6d95fd0a7
commit 936cf9786c
14 changed files with 319 additions and 268 deletions
+2 -2
View File
@@ -23,7 +23,7 @@ def process_diffusers(p: StableDiffusionProcessing, seeds, prompts, negative_pro
results = []
is_refiner_enabled = p.enable_hr and p.refiner_steps > 0 and p.refiner_start > 0 and p.refiner_start < 1 and shared.sd_refiner is not None
if hasattr(p, 'init_images') and len(p.init_images) > 0:
if getattr(p, 'init_images', None) is not None and len(p.init_images) > 0:
tgt_width, tgt_height = 8 * math.ceil(p.init_images[0].width / 8), 8 * math.ceil(p.init_images[0].height / 8)
if p.init_images[0].width != tgt_width or p.init_images[0].height != tgt_height:
shared.log.debug(f'Resizing init images: original={p.init_images[0].width}x{p.init_images[0].height} target={tgt_width}x{tgt_height}')
@@ -358,7 +358,7 @@ def process_diffusers(p: StableDiffusionProcessing, seeds, prompts, negative_pro
if k in possible:
args[k] = v
hypertile_set(p, hr=len(getattr(p, 'init_images', [])))
hypertile_set(p, hr=len(getattr(p, 'init_images', [])) > 0)
clean = args.copy()
clean.pop('callback', None)
clean.pop('callback_steps', None)