mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-30 00:00:26 +08:00
Fix transpose with non-square images
This commit is contained in:
parent
97c7a402d7
commit
d414157701
@ -232,6 +232,8 @@ class Transpose:
|
|||||||
def transpose(self, image: torch.Tensor, method: str):
|
def transpose(self, image: torch.Tensor, method: str):
|
||||||
batch_size, height, width, _ = image.shape
|
batch_size, height, width, _ = image.shape
|
||||||
result = torch.zeros_like(image)
|
result = torch.zeros_like(image)
|
||||||
|
if height != width and method in ("Transpose", "Transverse", "Rotate 90°", "Rotate 270°"):
|
||||||
|
result = torch.permute(result, (0, 2, 1, 3))
|
||||||
|
|
||||||
methods = {
|
methods = {
|
||||||
"Flip horizontal": Image.Transpose.FLIP_LEFT_RIGHT,
|
"Flip horizontal": Image.Transpose.FLIP_LEFT_RIGHT,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user