Skip to content

Commit b08fa55

Browse files
committed
fix: make width and height Optional inputs in predict.py
- Changed width and height parameters from required int to Optional[int] - This allows the predictor to work with aspect_ratio/image_size presets when custom dimensions are not provided - Maintains backward compatibility while fixing type hints
1 parent 42841e5 commit b08fa55

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

predict.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,13 @@ def predict(
203203
choices=["optimize_for_quality", "optimize_for_speed"],
204204
description="Image size preset (quality = larger, speed = faster). Ignored if width and height are both provided."
205205
),
206-
width: int = Input(
206+
width: Optional[int] = Input(
207207
default=None,
208208
ge=512,
209209
le=2048,
210210
description="Custom width in pixels. Provide both width and height for custom dimensions (overrides aspect_ratio/image_size)."
211211
),
212-
height: int = Input(
212+
height: Optional[int] = Input(
213213
default=None,
214214
ge=512,
215215
le=2048,

0 commit comments

Comments
 (0)