diff --git a/__pycache__/efficiency_nodes.cpython-312.pyc b/__pycache__/efficiency_nodes.cpython-312.pyc new file mode 100644 index 0000000..52d2e47 Binary files /dev/null and b/__pycache__/efficiency_nodes.cpython-312.pyc differ diff --git a/efficiency_nodes.py b/efficiency_nodes.py index 286d84d..73e9804 100644 --- a/efficiency_nodes.py +++ b/efficiency_nodes.py @@ -4013,6 +4013,34 @@ class TSC_ImageOverlay: # Return the edited base image return (base_image,) +######################################################################################################################## +# TSC Live Preview Node +class TSC_LivePreview: + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "images": ("IMAGE",), + }, + "hidden": { + "prompt": "PROMPT", + "extra_pnginfo": "EXTRA_PNGINFO" + }, + } + + RETURN_TYPES = ("IMAGE",) + FUNCTION = "preview_image" + OUTPUT_NODE = True + CATEGORY = "Efficiency Nodes/Image" + + def preview_image(self, images, prompt=None, extra_pnginfo=None): + # Generate preview using ComfyUI's PreviewImage node + preview = PreviewImage().save_images(images, prompt=prompt, extra_pnginfo=extra_pnginfo)["ui"] + + # Return both the preview for UI and the original images for pass-through + return {"ui": preview, "result": (images,)} + ######################################################################################################################## # Noise Sources & Seed Variations # https://github.com/shiimizu/ComfyUI_smZNodes @@ -4288,6 +4316,7 @@ NODE_CLASS_MAPPINGS = { "Manual XY Entry Info": TSC_XYplot_Manual_XY_Entry_Info, "Join XY Inputs of Same Type": TSC_XYplot_JoinInputs, "Image Overlay": TSC_ImageOverlay, + "Live Preview (Eff.)": TSC_LivePreview, "Noise Control Script": TSC_Noise_Control_Script, "HighRes-Fix Script": TSC_HighRes_Fix, "Tiled Upscaler Script": TSC_Tiled_Upscaler,