fix aspect ratio issue with style API

This commit is contained in:
Mohamad-Stability
2024-11-06 01:04:03 +02:00
parent 1f2e19fa79
commit 33fffec3a6
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ class StabilityBase:
image = kwargs.get('image', None)
if image is not None:
if self.API_ENDPOINT not in ["stable-image/control/style", "stable-image/control/sketch", "stable-image/control/structure"]:
if self.API_ENDPOINT != "stable-image/control/style":
kwargs["mode"] = "image-to-image"
kwargs.pop("aspect_ratio", None)
image = ToPILImage()(image.squeeze(0).permute(2,0,1))