Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide Copy to Clipboard input label #2562

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading