feat(api-nodes): add GPT-Image-1.5 (#11368)

This commit is contained in:
Alexander Piskun
2025-12-17 19:43:41 +02:00
committed by GitHub
parent 3a5f239cb6
commit 887143854b
3 changed files with 168 additions and 95 deletions

View File

@@ -129,7 +129,7 @@ def pil_to_bytesio(img: Image.Image, mime_type: str = "image/png") -> BytesIO:
return img_byte_arr
def downscale_image_tensor(image, total_pixels=1536 * 1024) -> torch.Tensor:
def downscale_image_tensor(image: torch.Tensor, total_pixels: int = 1536 * 1024) -> torch.Tensor:
"""Downscale input image tensor to roughly the specified total pixels."""
samples = image.movedim(-1, 1)
total = int(total_pixels)