-Half-implemented output context, need to support folders -Switched createImageElementFromImgSrc over to jnodes_view_image api call -Added decodeReadableStream -python image/video validation functions -strip text when setting png info / metadata value
55 lines
1.1 KiB
Python
55 lines
1.1 KiB
Python
import os
|
|
|
|
import folder_paths
|
|
from .logger import logger
|
|
from .utils import any, AnyType
|
|
|
|
|
|
class GetTempDirectory:
|
|
RETURN_TYPES = ("STRING",)
|
|
RETURN_NAMES = ("temp_dir",)
|
|
FUNCTION = "get_dir"
|
|
|
|
@classmethod
|
|
def INPUT_TYPES(cls):
|
|
return {}
|
|
|
|
def get_dir(self):
|
|
return (folder_paths.get_temp_directory(),)
|
|
|
|
|
|
class GetOutputDirectory:
|
|
RETURN_TYPES = ("STRING",)
|
|
RETURN_NAMES = ("output_dir",)
|
|
FUNCTION = "get_dir"
|
|
|
|
@classmethod
|
|
def INPUT_TYPES(cls):
|
|
return {}
|
|
|
|
def get_dir(self):
|
|
return (folder_paths.get_output_directory(),)
|
|
|
|
|
|
class StringLiteral:
|
|
RETURN_TYPES = ("STRING",)
|
|
FUNCTION = "get_string"
|
|
|
|
@classmethod
|
|
def INPUT_TYPES(cls):
|
|
return {"required": {"string": ("STRING", {"default": "", "multiline": True})}}
|
|
|
|
def get_string(self, string):
|
|
return (string,)
|
|
|
|
|
|
class AnyToString:
|
|
RETURN_TYPES = ("STRING",)
|
|
FUNCTION = "get_string"
|
|
|
|
@classmethod
|
|
def INPUT_TYPES(cls):
|
|
return {"required": {"anything": (any,)}}
|
|
|
|
def get_string(self, anything):
|
|
return (str(anything),) |