mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-01 09:57:10 +08:00
DisplayLinkNode
This commit is contained in:
parent
8f179a4222
commit
4b4029a28c
@ -395,10 +395,35 @@ class TestURL(ComfyNodeABC):
|
|||||||
CATEGORY = "image/video"
|
CATEGORY = "image/video"
|
||||||
DESCRIPTION = "Show a URL as plain text in the UI."
|
DESCRIPTION = "Show a URL as plain text in the UI."
|
||||||
|
|
||||||
def show_url(self, url):
|
def show_url(self):
|
||||||
return ("http://aaatesat.com",)
|
return ("http://aaatesat.com",)
|
||||||
|
|
||||||
|
|
||||||
|
class DisplayLinkNode:
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(s):
|
||||||
|
return {
|
||||||
|
"required": {
|
||||||
|
"url_string": ("STRING", {"multiline": False, "default": "https://www.example.com"}),
|
||||||
|
},
|
||||||
|
"optional": {
|
||||||
|
"link_text": ("STRING", {"multiline": False, "default": "Click Here"}),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RETURN_TYPES = ("STRING",)
|
||||||
|
FUNCTION = "display_link"
|
||||||
|
CATEGORY = "image/video"
|
||||||
|
|
||||||
|
def display_link(self, url_string, link_text):
|
||||||
|
# Create the HTML anchor tag
|
||||||
|
# The target="_blank" attribute opens the link in a new tab
|
||||||
|
html_link = f'<a href="{url_string}" target="_blank">{link_text}</a>'
|
||||||
|
return (html_link,)
|
||||||
|
|
||||||
NODE_CLASS_MAPPINGS = {
|
NODE_CLASS_MAPPINGS = {
|
||||||
"SaveWEBM": SaveWEBM,
|
"SaveWEBM": SaveWEBM,
|
||||||
"SaveVideo": SaveVideo,
|
"SaveVideo": SaveVideo,
|
||||||
@ -408,6 +433,7 @@ NODE_CLASS_MAPPINGS = {
|
|||||||
"LoadVideoEncrypted": LoadVideoEncrypted,
|
"LoadVideoEncrypted": LoadVideoEncrypted,
|
||||||
"ShowURL": ShowURL,
|
"ShowURL": ShowURL,
|
||||||
"TestURL": TestURL,
|
"TestURL": TestURL,
|
||||||
|
"DisplayLink": DisplayLinkNode
|
||||||
}
|
}
|
||||||
|
|
||||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||||
@ -418,4 +444,5 @@ NODE_DISPLAY_NAME_MAPPINGS = {
|
|||||||
"LoadVideoEncrypted": "Load Video (Encrypted)",
|
"LoadVideoEncrypted": "Load Video (Encrypted)",
|
||||||
"ShowURL": "Show URL",
|
"ShowURL": "Show URL",
|
||||||
"TestURL": "Test URL",
|
"TestURL": "Test URL",
|
||||||
|
"DisplayLink": "Display Link (Custom)"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user