Skip to content

Commit 1115866

Browse files
committed
Added base standard resolutions for SDXL
Signed-off-by: Tibor Dancs <[email protected]>
1 parent 46e050a commit 1115866

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
from .nodes.Json.RF_JsonStyleLoader import RF_JsonStyleLoader
2929
from .nodes.File.RF_SavePromptInfo import RF_SavePromptInfo
30+
from .nodes.File.RF_StandardResolutions import RF_StandardResolutions
3031

3132
from .nodes.Primitives.RF_FloatPrimitive import RF_FloatPrimitive
3233
from .nodes.Primitives.Array.RF_RangeInt import RF_RangeInt
@@ -78,7 +79,10 @@
7879
"RF_JsonStyleLoader": RF_JsonStyleLoader,
7980

8081
# File
81-
"RF_SavePromptInfo": RF_SavePromptInfo
82+
"RF_SavePromptInfo": RF_SavePromptInfo,
83+
84+
# Standard Resolutions
85+
"RF_StandardResolutions": RF_StandardResolutions
8286
}
8387

8488
# This magic will use a property DISPLAY_NAME on each node to get the display name of the node for the UI

nodes/File/RF_StandardResolutions.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
class RF_StandardResolutions:
2+
def __init__(self):
3+
pass
4+
5+
@classmethod
6+
def INPUT_TYPES(s):
7+
return {
8+
"required": {
9+
"value": (["Standard 1:1 (1024x1024)", "Portrait 4:5 (1024x1280)"], {
10+
"forceInput": False,
11+
"default": "Standard 1:1 (1024x1024)",
12+
})
13+
},
14+
}
15+
16+
DISPLAY_NAME = "Standard Resolutions"
17+
CATEGORY = "RF/file"
18+
19+
RETURN_TYPES = ("INT","INT",)
20+
RETURN_NAMES = ("WIDTH","HEIGHT",)
21+
22+
FUNCTION = "NodeProcess"
23+
def NodeProcess(self, value):
24+
if value == "Standard 1:1 (1024x1024)":
25+
return (1024, 1024)
26+
elif value == "Portrait 4:5 (1024x1280)":
27+
return (1024, 1280)
28+
return (1024, 1024)

0 commit comments

Comments
 (0)