From f28498336846091f07d8e3a78d509b24b0eaaa2c Mon Sep 17 00:00:00 2001 From: Estelle Poulin Date: Thu, 1 Jun 2023 10:46:43 -0400 Subject: [PATCH] Pydantic does't init values in validators I guess --- stabilityai/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stabilityai/models.py b/stabilityai/models.py index a3c9ab4..695a06e 100644 --- a/stabilityai/models.py +++ b/stabilityai/models.py @@ -192,7 +192,7 @@ class ImageToImageUpscaleRequestBody(BaseModel): @validator("width", always=True) def mutually_exclusive(cls, v, values): - if values["height"] is not None and v: + if values.get("height") is not None and v: raise ValueError("You can only specify one of width and height.") return v