MCPcopy Create free account
hub / github.com/7BEII/Comfyui_PDuse / PDStringSelector

Class PDStringSelector

py/PD_string_selector.py:1–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1class PDStringSelector:
2 @classmethod
3 def INPUT_TYPES(cls):
4 return {
5 "required": {
6 "aspect_ratio": ("STRING", {"default": "2:3"}),
7 "2:3": ("STRING", {"default": "768"}),
8 "1:1": ("STRING", {"default": "680"}),
9 "3:2": ("STRING", {"default": "1024"}),
10 }
11 }
12
13 RETURN_TYPES = ("STRING", "INT")
14 RETURN_NAMES = ("string", "int")
15 FUNCTION = "select_value"
16 CATEGORY = "PDuse/Text"
17
18 def select_value(self, aspect_ratio, **values):
19 ratio = aspect_ratio.strip()
20 if ratio not in values:
21 ratio = "2:3"
22 value = str(values[ratio]).strip()
23 return (value, int(float(value)))
24
25
26NODE_CLASS_MAPPINGS = {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected