Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

fix(images): document upload resize_to as a width/height JSON object (#10143)

GuilhermeA6014802ddfd4
diff --git a/invokeai/app/api/routers/images.py b/invokeai/app/api/routers/images.py
index 2602928854..f99a626167 100644
--- a/invokeai/app/api/routers/images.py
+++ b/invokeai/app/api/routers/images.py
@@ -114,8 +114,11 @@ async def upload_image(
crop_visible: Optional[bool] = Query(default=False, description="Whether to crop the image"),
resize_to: Optional[str] = Body(
default=None,
- description=f"Dimensions to resize the image to, must be stringified tuple of 2 integers. Max total pixel count: {ResizeToDimensions.MAX_SIZE}",
- examples=['"[1024,1024]"'],
+ description=(
+ "Dimensions to resize the image to, as a stringified JSON object with positive integer width and height."
+ f" Max total pixel count: {ResizeToDimensions.MAX_SIZE}"
+ ),
+ examples=['{"width": 1024, "height": 1024}'],
),
metadata: Optional[str] = Body(
default=None,
diff --git a/invokeai/frontend/api/openapi.json b/invokeai/frontend/api/openapi.json
index 5b47040b34..92cf3109a9 100644
--- a/invokeai/frontend/api/openapi.json
+++ b/invokeai/frontend/api/openapi.json
@@ -24052,8 +24052,8 @@
}
],
"title": "Resize To",
- "description": "Dimensions to resize the image to, must be stringified tuple of 2 integers. Max total pixel count: 16777216",
- "examples": ["\"[1024,1024]\""]
+ "description": "Dimensions to resize the image to, as a stringified JSON object with positive integer width and height. Max total pixel count: 16777216",
+ "examples": ["{\"width\": 1024, \"height\": 1024}"]
},
"metadata": {
"anyOf": [
diff --git a/invokeai/frontend/api/schema.ts b/invokeai/frontend/api/schema.ts
index 3cc23d461c..3885dcd26b 100644
--- a/invokeai/frontend/api/schema.ts
+++ b/invokeai/frontend/api/schema.ts
@@ -7092,8 +7092,8 @@ export type components = {
file: Blob;
/**
* Resize To
- * @description Dimensions to resize the image to, must be stringified tuple of 2 integers. Max total pixel count: 16777216
- * @example "[1024,1024]"
+ * @description Dimensions to resize the image to, as a stringified JSON object with positive integer width and height. Max total pixel count: 16777216
+ * @example {"width": 1024, "height": 1024}
*/
resize_to?: string | null;
/**