diff --git a/modules/processing_diffusers.py b/modules/processing_diffusers.py index 73c3fcc09..64eb8eebe 100644 --- a/modules/processing_diffusers.py +++ b/modules/processing_diffusers.py @@ -230,10 +230,11 @@ def process_diffusers(p: StableDiffusionProcessing, seeds, prompts, negative_pro is_img2img_model = bool('Zero123' in shared.sd_model.__class__.__name__) if sd_models.get_diffusers_task(model) == sd_models.DiffusersTaskType.TEXT_2_IMAGE and not is_img2img_model: p.ops.append('txt2img') - task_args = { - 'height': 8 * math.ceil(p.height / 8), - 'width': 8 * math.ceil(p.width / 8), - } + if hasattr(p, 'width') and hasattr(p, 'height'): + task_args = { + 'width': 8 * math.ceil(p.width / 8), + 'height': 8 * math.ceil(p.height / 8), + } elif (sd_models.get_diffusers_task(model) == sd_models.DiffusersTaskType.IMAGE_2_IMAGE or is_img2img_model) and len(getattr(p, 'init_images' ,[])) > 0: p.ops.append('img2img') task_args = { @@ -243,8 +244,8 @@ def process_diffusers(p: StableDiffusionProcessing, seeds, prompts, negative_pro elif sd_models.get_diffusers_task(model) == sd_models.DiffusersTaskType.INSTRUCT and len(getattr(p, 'init_images' ,[])) > 0: p.ops.append('instruct') task_args = { - 'height': 8 * math.ceil(p.height / 8), 'width': 8 * math.ceil(p.width / 8), + 'height': 8 * math.ceil(p.height / 8), 'image': p.init_images, 'strength': p.denoising_strength, }