Skip to content

Commit

Permalink
formatting pass
Browse files Browse the repository at this point in the history
  • Loading branch information
Amorano committed Jun 23, 2024
1 parent a2d3d5d commit 11cc287
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 105 deletions.
28 changes: 14 additions & 14 deletions core/calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,8 @@ def INPUT_TYPES(cls) -> dict:
Lexicon.IN_A: (WILDCARD, {"tooltip": "Custom Start Point"}),
Lexicon.IN_B: (WILDCARD, {"tooltip": "Custom End Point"}),
Lexicon.FLOAT: ("FLOAT", {"default": 0., "min": 0., "max": 1.0,
"step": 0.001, "precision": 4, "round": 0.00001,
"tooltip": "Blend Amount. 0 = full A, 1 = full B"}),
"step": 0.001, "precision": 4, "round": 0.00001,
"tooltip": "Blend Amount. 0 = full A, 1 = full B"}),
Lexicon.EASE: (["NONE"] + EnumEase._member_names_, {"default": "NONE"}),
Lexicon.TYPE: (names_convert, {"default": names_convert[2],
"tooltip":"Output type desired from resultant operation"}),
Expand Down Expand Up @@ -796,17 +796,17 @@ def INPUT_TYPES(cls) -> dict:
Lexicon.IN_A: (WILDCARD, {"default": None, "tooltip":"Passes a raw value directly, or supplies defaults for any value inputs without connections"}),
Lexicon.TYPE: (typ, {"default": EnumConvertType.BOOLEAN.name}),
Lexicon.X: (WILDCARD, {"default": 0, "min": -sys.maxsize,
"max": sys.maxsize, "step": 0.01, "precision": 6,
"forceInput": True}),
"max": sys.maxsize, "step": 0.01, "precision": 6,
"forceInput": True}),
Lexicon.Y: (WILDCARD, {"default": 0, "min": -sys.maxsize,
"max": sys.maxsize, "step": 0.01, "precision": 6,
"forceInput": True}),
"max": sys.maxsize, "step": 0.01, "precision": 6,
"forceInput": True}),
Lexicon.Z: (WILDCARD, {"default": 0, "min": -sys.maxsize,
"max": sys.maxsize, "step": 0.01, "precision": 6,
"forceInput": True}),
"max": sys.maxsize, "step": 0.01, "precision": 6,
"forceInput": True}),
Lexicon.W: (WILDCARD, {"default": 0, "min": -sys.maxsize,
"max": sys.maxsize, "step": 0.01, "precision": 6,
"forceInput": True}),
"max": sys.maxsize, "step": 0.01, "precision": 6,
"forceInput": True}),
Lexicon.IN_A+Lexicon.IN_A: ("VEC4", {"default": (0, 0, 0, 0),
#"min": -sys.maxsize, "max": sys.maxsize,
"label": [Lexicon.X, Lexicon.Y],
Expand Down Expand Up @@ -840,8 +840,8 @@ def run(self, **kw) -> Tuple[bool]:
default = [x_str]
default2 = None
if typ not in [EnumConvertType.STRING, EnumConvertType.LIST, \
EnumConvertType.DICT,\
EnumConvertType.IMAGE, EnumConvertType.LATENT, EnumConvertType.ANY, EnumConvertType.MASK]:
EnumConvertType.DICT,\
EnumConvertType.IMAGE, EnumConvertType.LATENT, EnumConvertType.ANY, EnumConvertType.MASK]:
a, b, c, d = xyzw
a2, b2, c2, d2 = yyzw
default = (a if r_x is None else r_x,
Expand All @@ -853,8 +853,8 @@ def run(self, **kw) -> Tuple[bool]:
val = parse_value(raw, typ, default)
val2 = parse_value(default2, typ, default2)
typ = EnumConvertType.VEC4 if typ in [EnumConvertType.VEC4, EnumConvertType.VEC3, \
EnumConvertType.VEC2, EnumConvertType.FLOAT] \
else EnumConvertType.VEC4INT
EnumConvertType.VEC2, EnumConvertType.FLOAT] \
else EnumConvertType.VEC4INT

# check if set to randomize....
if seed != 0:
Expand Down
20 changes: 10 additions & 10 deletions core/compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ def INPUT_TYPES(cls) -> dict:
Lexicon.PIXEL: (WILDCARD, {}),
Lexicon.MASK: (WILDCARD, {}),
Lexicon.FUNC: (EnumAdjustOP._member_names_, {"default": EnumAdjustOP.BLUR.name,
"tooltip":"Type of adjustment (e.g., blur, sharpen, invert)"}),
"tooltip":"Type of adjustment (e.g., blur, sharpen, invert)"}),
Lexicon.RADIUS: ("INT", {"default": 3, "min": 3, "step": 1}),
Lexicon.VALUE: ("FLOAT", {"default": 1, "min": 0, "step": 0.1}),
Lexicon.LOHI: ("VEC2", {"default": (0, 1), "step": 0.01, "precision": 4,
"min": 0, "max": 1, "round": 0.00001, "label": [Lexicon.LO, Lexicon.HI]}),
Lexicon.LMH: ("VEC3", {"default": (0, 0.5, 1), "step": 0.01, "precision": 4,
"min": 0, "max": 1, "round": 0.00001, "label": [Lexicon.LO, Lexicon.MID, Lexicon.HI]}),
Lexicon.HSV: ("VEC3",{"default": (0, 1, 1), "step": 0.01, "precision": 4,
"min": 0, "max": 1, "round": 0.00001, "label": [Lexicon.H, Lexicon.S, Lexicon.V]}),
"min": 0, "max": 1, "round": 0.00001, "label": [Lexicon.H, Lexicon.S, Lexicon.V]}),
Lexicon.CONTRAST: ("FLOAT", {"default": 0, "min": 0, "max": 1, "step": 0.01,
"precision": 4, "round": 0.00001}),
Lexicon.GAMMA: ("FLOAT", {"default": 1, "min": 0.00001, "max": 1, "step": 0.01,
Expand All @@ -105,7 +105,7 @@ def run(self, **kw) -> Tuple[torch.Tensor, ...]:
matte = parse_param(kw, Lexicon.MATTE, EnumConvertType.VEC4INT, (0, 0, 0, 255), 0, 255)
invert = parse_param(kw, Lexicon.INVERT, EnumConvertType.BOOLEAN, False)
params = list(zip_longest_fill(pA, mask, op, radius, amt, lohi,
lmh, hsv, contrast, gamma, matte, invert))
lmh, hsv, contrast, gamma, matte, invert))
images = []
pbar = ProgressBar(len(params))
for idx, (pA, mask, op, radius, amt, lohi, lmh, hsv, contrast, gamma, matte, invert) in enumerate(params):
Expand Down Expand Up @@ -228,7 +228,7 @@ def INPUT_TYPES(cls) -> dict:
Lexicon.INVERT: ("BOOLEAN", {"default": False, "tooltip": "Invert the mask input"}),
Lexicon.MODE: (EnumScaleMode._member_names_, {"default": EnumScaleMode.NONE.name}),
Lexicon.WH: ("VEC2", {"default": (512, 512), "min":MIN_IMAGE_SIZE,
"step": 1, "label": [Lexicon.W, Lexicon.H]}),
"step": 1, "label": [Lexicon.W, Lexicon.H]}),
Lexicon.SAMPLE: (EnumInterpolation._member_names_, {"default": EnumInterpolation.LANCZOS4.name}),
Lexicon.MATTE: ("VEC4", {"default": (0, 0, 0, 255), "step": 1, "label": [Lexicon.R, Lexicon.G, Lexicon.B, Lexicon.A], "rgb": True})
}
Expand Down Expand Up @@ -545,7 +545,7 @@ def INPUT_TYPES(cls) -> dict:
Lexicon.END: ("VEC3", {"default": (128, 128, 128), "min":0, "max":255, "step": 1, "rgb": True}),
Lexicon.FLOAT: ("VEC3", {"default": (0.5,0.5,0.5), "min":0, "max":1, "step": 0.01, "precision": 4, "tooltip": "the fuzziness use to extend the start and end range(s)"}),
Lexicon.MATTE: ("VEC4", {"default": (0, 0, 0, 255), "step": 1,
"label": [Lexicon.R, Lexicon.G, Lexicon.B, Lexicon.A], "rgb": True}),
"label": [Lexicon.R, Lexicon.G, Lexicon.B, Lexicon.A], "rgb": True}),
}
})
return Lexicon._parse(d, cls)
Expand Down Expand Up @@ -587,7 +587,7 @@ def INPUT_TYPES(cls) -> dict:

Lexicon.MODE: (EnumScaleMode._member_names_, {"default": EnumScaleMode.NONE.name}),
Lexicon.WH: ("VEC2", {"default": (512, 512), "min":MIN_IMAGE_SIZE,
"step": 1, "label": [Lexicon.W, Lexicon.H]}),
"step": 1, "label": [Lexicon.W, Lexicon.H]}),
Lexicon.SAMPLE: (EnumInterpolation._member_names_, {"default": EnumInterpolation.LANCZOS4.name}),
Lexicon.MATTE: ("VEC4", {"default": (0, 0, 0, 255), "step": 1, "label": [Lexicon.R, Lexicon.G, Lexicon.B, Lexicon.A], "rgb": True})
}
Expand Down Expand Up @@ -645,7 +645,7 @@ def INPUT_TYPES(cls) -> dict:
Lexicon.A: (WILDCARD, {}),
Lexicon.MODE: (EnumScaleMode._member_names_, {"default": EnumScaleMode.NONE.name}),
Lexicon.WH: ("VEC2", {"default": (512, 512), "min":MIN_IMAGE_SIZE,
"step": 1, "label": [Lexicon.W, Lexicon.H]}),
"step": 1, "label": [Lexicon.W, Lexicon.H]}),
Lexicon.SAMPLE: (EnumInterpolation._member_names_, {"default": EnumInterpolation.LANCZOS4.name}),
Lexicon.MATTE: ("VEC4", {"default": (0, 0, 0, 255), "step": 1, "label": [Lexicon.R, Lexicon.G, Lexicon.B, Lexicon.A], "rgb": True})
}
Expand Down Expand Up @@ -812,10 +812,10 @@ def INPUT_TYPES(cls) -> dict:
Lexicon.AXIS: (EnumOrientation._member_names_, {"default": EnumOrientation.GRID.name,
"tooltip":"Choose the direction in which to stack the images. Options include horizontal, vertical, or a grid layout"}),
Lexicon.STEP: ("INT", {"min": 1, "step": 1, "default": 1,
"tooltip":"Specify the spacing between each stacked image. This determines how far apart the images are from each other"}),
"tooltip":"Specify the spacing between each stacked image. This determines how far apart the images are from each other"}),
Lexicon.MODE: (EnumScaleMode._member_names_, {"default": EnumScaleMode.NONE.name}),
Lexicon.WH: ("VEC2", {"default": (512, 512), "min":MIN_IMAGE_SIZE,
"step": 1, "label": [Lexicon.W, Lexicon.H]}),
"step": 1, "label": [Lexicon.W, Lexicon.H]}),
Lexicon.SAMPLE: (EnumInterpolation._member_names_, {"default": EnumInterpolation.LANCZOS4.name}),
Lexicon.MATTE: ("VEC4", {"default": (0, 0, 0, 255), "step": 1, "label": [Lexicon.R, Lexicon.G, Lexicon.B, Lexicon.A], "rgb": True})
}
Expand Down Expand Up @@ -917,7 +917,7 @@ def INPUT_TYPES(cls) -> dict:
Lexicon.STRENGTH: ("FLOAT", {"default": 1, "min": 0, "precision": 4, "step": 0.005}),
Lexicon.MODE: (EnumScaleMode._member_names_, {"default": EnumScaleMode.NONE.name}),
Lexicon.WH: ("VEC2", {"default": (512, 512), "min":MIN_IMAGE_SIZE,
"step": 1, "label": [Lexicon.W, Lexicon.H]}),
"step": 1, "label": [Lexicon.W, Lexicon.H]}),
Lexicon.SAMPLE: (EnumInterpolation._member_names_, {"default": EnumInterpolation.LANCZOS4.name}),
Lexicon.MATTE: ("VEC4", {"default": (0, 0, 0, 255), "step": 1, "label": [Lexicon.R, Lexicon.G, Lexicon.B, Lexicon.A], "rgb": True})
}
Expand Down
12 changes: 6 additions & 6 deletions core/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def INPUT_TYPES(cls) -> dict:
"round": 0.00001, "label": [Lexicon.X, Lexicon.Y],
"tooltip":"Offset the position"}),
Lexicon.ANGLE: ("FLOAT", {"default": 0, "min": -180, "max": 180,
"step": 0.01, "precision": 4, "round": 0.00001}),
"step": 0.01, "precision": 4, "round": 0.00001}),
Lexicon.EDGE: (EnumEdge._member_names_, {"default": EnumEdge.CLIP.name}),
Lexicon.INVERT: ("BOOLEAN", {"default": False, "tooltip": "Invert the mask input"})
}
Expand All @@ -339,13 +339,13 @@ def run(self, **kw) -> Tuple[torch.Tensor, torch.Tensor]:
invert = parse_param(kw, Lexicon.INVERT, EnumConvertType.BOOLEAN, False)
images = []
params = list(zip_longest_fill(full_text, font_idx, autosize, letter, color,
matte, columns, font_size, align, justify, margin,
line_spacing, wihi, pos, angle, edge, invert))
matte, columns, font_size, align, justify, margin,
line_spacing, wihi, pos, angle, edge, invert))

pbar = ProgressBar(len(params))
for idx, (full_text, font_idx, autosize, letter, color, matte, columns,
font_size, align, justify, margin, line_spacing, wihi, pos,
angle, edge, invert) in enumerate(params):
font_size, align, justify, margin, line_spacing, wihi, pos,
angle, edge, invert) in enumerate(params):

width, height = wihi
font_name = self.FONTS[font_idx]
Expand Down Expand Up @@ -402,7 +402,7 @@ def INPUT_TYPES(cls) -> dict:
Lexicon.VALUE: ("INT", {"default": 100, "min": 32, "max": 8192, "step": 1,
"tooltip": "Number of Vertical bars to try to fit within the specified Width x Height"}),
Lexicon.THICK: ("FLOAT", {"default": 0.72, "min": 0, "max": 1, "step": 0.01,
"tooltip": "The percentage of fullness for each bar; currently scaled from the left only"}),
"tooltip": "The percentage of fullness for each bar; currently scaled from the left only"}),
Lexicon.WH: ("VEC2", {"default": (256, 256),
"step": 1, "min":MIN_IMAGE_SIZE, "label": [Lexicon.W, Lexicon.H],
"tooltip": "Final output size of the wave bar graph"}),
Expand Down
6 changes: 3 additions & 3 deletions core/device_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def INPUT_TYPES(cls) -> dict:
Lexicon.ZOOM: ("FLOAT", {"min": 0, "max": 1, "step": 0.005, "default": 0}),
Lexicon.MODE: (EnumScaleMode._member_names_, {"default": EnumScaleMode.NONE.name}),
Lexicon.WH: ("VEC2", {"default": (512, 512), "min":MIN_IMAGE_SIZE,
"step": 1, "label": [Lexicon.W, Lexicon.H]}),
"step": 1, "label": [Lexicon.W, Lexicon.H]}),
Lexicon.SAMPLE: (EnumInterpolation._member_names_, {"default": EnumInterpolation.LANCZOS4.name}),
Lexicon.MATTE: ("VEC4", {"default": (0, 0, 0, 255), "step": 1, "label": [Lexicon.R, Lexicon.G, Lexicon.B, Lexicon.A], "rgb": True})
}
Expand Down Expand Up @@ -277,7 +277,7 @@ def INPUT_TYPES(cls) -> dict:
Lexicon.ROUTE: ("STRING", {"default": "/stream"}),
Lexicon.MODE: (EnumScaleMode._member_names_, {"default": EnumScaleMode.NONE.name}),
Lexicon.WH: ("VEC2", {"default": (512, 512), "min":MIN_IMAGE_SIZE,
"step": 1, "label": [Lexicon.W, Lexicon.H]}),
"step": 1, "label": [Lexicon.W, Lexicon.H]}),
Lexicon.SAMPLE: (EnumInterpolation._member_names_, {"default": EnumInterpolation.LANCZOS4.name}),
Lexicon.MATTE: ("VEC4", {"default": (0, 0, 0, 0), "step": 1, "label": [Lexicon.R, Lexicon.G, Lexicon.B, Lexicon.A], "rgb": True})
}
Expand Down Expand Up @@ -350,7 +350,7 @@ def INPUT_TYPES(cls) -> dict:
Lexicon.FPS: ("INT", {"min": 0, "max": 60, "default": 30, "tooltip": "@@@ NOT USED @@@"}),
Lexicon.MODE: (EnumScaleMode._member_names_, {"default": EnumScaleMode.NONE.name}),
Lexicon.WH: ("VEC2", {"default": (512, 512), "min":MIN_IMAGE_SIZE,
"step": 1, "label": [Lexicon.W, Lexicon.H]}),
"step": 1, "label": [Lexicon.W, Lexicon.H]}),
Lexicon.SAMPLE: (EnumInterpolation._member_names_, {"default": EnumInterpolation.LANCZOS4.name}),
Lexicon.MATTE: ("VEC4", {"default": (0, 0, 0, 255), "step": 1, "label": [Lexicon.R, Lexicon.G, Lexicon.B, Lexicon.A], "rgb": True})
}
Expand Down
2 changes: 1 addition & 1 deletion core/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def INPUT_TYPES(cls) -> dict:
Lexicon.RESET: ("BOOLEAN", {"default": False}),
Lexicon.VALUE: ("INT", {"default": 60, "min": 0, "tooltip":"Number of values to graph and display"}),
Lexicon.WH: ("VEC2", {"default": (512, 512), "min":MIN_IMAGE_SIZE,
"step": 1, "label": [Lexicon.W, Lexicon.H]})
"step": 1, "label": [Lexicon.W, Lexicon.H]})
}
})
return Lexicon._parse(d, cls)
Expand Down
Loading

0 comments on commit 11cc287

Please sign in to comment.