From 9960d7ca2ac94faf216a6ff5df82542ba90f00da Mon Sep 17 00:00:00 2001 From: Jonathan <34005131+JPPhoto@users.noreply.github.com> Date: Fri, 14 Jul 2023 12:34:13 -0500 Subject: [PATCH] Allow ImageResizeInvocation w/h to take inputs from other nodes (#3765) --- invokeai/app/invocations/image.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/invokeai/app/invocations/image.py b/invokeai/app/invocations/image.py index 1dbbff1c84..2612a58ba7 100644 --- a/invokeai/app/invocations/image.py +++ b/invokeai/app/invocations/image.py @@ -5,6 +5,7 @@ from typing import Literal, Optional import numpy from PIL import Image, ImageFilter, ImageOps, ImageChops from pydantic import BaseModel, Field +from typing import Union from ..models.image import ImageCategory, ImageField, ResourceOrigin from .baseinvocation import ( @@ -398,8 +399,8 @@ class ImageResizeInvocation(BaseInvocation, PILInvocationConfig): # Inputs image: Optional[ImageField] = Field(default=None, description="The image to resize") - width: int = Field(ge=64, multiple_of=8, description="The width to resize to (px)") - height: int = Field(ge=64, multiple_of=8, description="The height to resize to (px)") + width: Union[int, None] = Field(ge=64, multiple_of=8, description="The width to resize to (px)") + height: Union[int, None] = Field(ge=64, multiple_of=8, description="The height to resize to (px)") resample_mode: PIL_RESAMPLING_MODES = Field(default="bicubic", description="The resampling mode") # fmt: on