Skip to content

Commit

Permalink
Hide Copy to Clipboard input label (#2562)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment authored Feb 8, 2024
1 parent b13a874 commit 79a58fd
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions backend/src/nodes/properties/inputs/generic_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from ...impl.blend import BlendMode
from ...impl.color.color import Color
from ...impl.dds.format import DDSFormat
from ...impl.image_utils import FillColor, normalize
from ...impl.image_utils import FillColor
from ...impl.upscale.auto_split_tiles import TileSize
from ...utils.format import format_color_with_channels
from ...utils.seed import Seed
Expand Down Expand Up @@ -346,16 +346,24 @@ def __init__(self, label: str = "Clipboard input"):
super().__init__(["Image", "string", "number"], label, kind="text")
self.input_conversions = [InputConversion("Image", '"<Image>"')]

self.label_style: LabelStyle = "hidden"

def enforce(self, value: object):
if isinstance(value, np.ndarray):
return normalize(value)
return value

if isinstance(value, float) and int(value) == value:
# stringify integers values
return str(int(value))

return str(value)

def to_dict(self):
return {
**super().to_dict(),
"labelStyle": self.label_style,
}


class AnyInput(BaseInput):
def __init__(self, label: str):
Expand Down

0 comments on commit 79a58fd

Please sign in to comment.