Skip to content

Commit ced3550

Browse files
authored
Merge pull request #7 from GavChap/GavChap-patch-1
Update sizes.json
2 parents 7530153 + 5741a30 commit ced3550

File tree

3 files changed

+27
-23
lines changed

3 files changed

+27
-23
lines changed

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "comfyui-sd3latentselectres"
3-
description = "You'll get a new node called SD3 Latent Select Resolution, you can pick the x and y sizes from a list."
4-
version = "1.0.1"
3+
description = "You'll get a new node called SD3/Flux Latent Select Resolution, you can pick the x and y sizes from a list."
4+
version = "2.0.0"
55
license = { file = "LICENSE" }
66

77
[project.urls]
@@ -10,5 +10,5 @@ Repository = "https://github.com/GavChap/ComfyUI-SD3LatentSelectRes"
1010

1111
[tool.comfy]
1212
PublisherId = "anymode"
13-
DisplayName = "ComfyUI-SD3LatentSelectRes"
13+
DisplayName = "SD3 and Flux Latent Select Resolution"
1414
Icon = ""

sd3latentselectres.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def INPUT_TYPES(cls):
1414
return {
1515
'required': {
1616
'size_selected': (cls.size_sizes,),
17+
'flip_ratio': ("BOOLEAN", {"default": False}),
1718
'batch_size': ("INT", {"default": 1, "min": 1, "max": 4096})
1819
}
1920
}
@@ -24,11 +25,16 @@ def INPUT_TYPES(cls):
2425
OUTPUT_NODE = True
2526
CATEGORY = "generate/sd3"
2627

27-
def return_res(self, size_selected, batch_size):
28+
def return_res(self, size_selected, flip_ratio, batch_size):
2829
# Extract resolution name and dimensions using the key
2930
selected_info = self.size_dict[size_selected]
30-
width = int(selected_info["width"])
31-
height = int(selected_info["height"])
31+
if (flip_ratio):
32+
width = int(selected_info["height"])
33+
height = int(selected_info["width"])
34+
else:
35+
width = int(selected_info["width"])
36+
height = int(selected_info["height"])
37+
3238
latent = torch.ones([batch_size, 16, height // 8, width // 8], device=self.device) * 0.0609
3339
return {"width": width}, {"height": height}, {"samples": latent},
3440

@@ -48,7 +54,7 @@ def read_sizes():
4854
}
4955

5056
NODE_DISPLAY_NAME_MAPPINGS = {
51-
"SD3LatentSelectRes": "SD3 Select Latent Resolution"
57+
"SD3LatentSelectRes": "SD3/Flux Select Latent Resolution"
5258
}
5359

5460

sizes.json

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
{
22
"sizes": {
3-
"1:1 [1024x1024 square]": {"width": 1024, "height": 1024},
4-
"8:5 [1216x768 landscape]": {"width": 1216, "height": 768},
5-
"4:3 [1152x896 landscape]": {"width": 1152, "height": 896},
6-
"3:2 [1216x832 landscape]": {"width": 1216, "height": 832},
7-
"7:5 [1176x840 landscape]": {"width": 1176, "height": 840},
8-
"16:9 [1344x768 landscape]": {"width": 1344, "height": 768},
9-
"21:9 [1536x640 landscape]": {"width": 1536, "height": 640},
10-
"19:9 [1472x704 landscape]": {"width": 1472, "height": 704},
11-
"3:4 [896x1152 portrait]": {"width": 896, "height": 1152},
12-
"2:3 [832x1216 portrait]": {"width": 832, "height": 1216},
13-
"5:7 [840x1176 portrait]": {"width": 840, "height": 1176},
14-
"9:16 [768x1344 portrait]": {"width": 768, "height": 1344},
15-
"9:21 [640x1536 portrait]": {"width": 640, "height": 1536},
16-
"5:8 [768x1216 portrait]": {"width": 768, "height": 1216},
17-
"9:19 [704x1472 portrait]": {"width": 704, "height": 1472}
3+
"1MP - 1:1 [1024x1024]": {"width": 1024, "height": 1024},
4+
"1MP - 8:5 [1216x768]": {"width": 1216, "height": 768},
5+
"1MP - 4:3 [1152x896]": {"width": 1152, "height": 896},
6+
"1MP - 3:2 [1216x832]": {"width": 1216, "height": 832},
7+
"1MP - 7:5 [1176x840]": {"width": 1176, "height": 840},
8+
"1MP - 16:9 [1344x768]": {"width": 1344, "height": 768},
9+
"1MP - 21:9 [1536x640]": {"width": 1536, "height": 640},
10+
"1MP - 19:9 [1472x704]": {"width": 1472, "height": 704},
11+
"2MP - 1:1 [1408x1408]": {"width": 1408, "height": 1408},
12+
"2MP - 3:2 [1728x1152]": {"width": 1728, "height": 1152},
13+
"2MP - 4:3 [1664x1216]": {"width": 1664, "height": 1216},
14+
"2MP - 16:9 [1920x1088]": {"width": 1920, "height": 1088},
15+
"2MP - 21:9 [2176x960]": {"width": 2176, "height": 960}
1816
}
19-
}
17+
}

0 commit comments

Comments
 (0)