Add TSC_LivePreview node for live preview with pass-through

Co-authored-by: jags111 <5968619+jags111@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-03 23:11:21 +00:00
parent a075f2b7f9
commit b80d754d1f
2 changed files with 29 additions and 0 deletions

Binary file not shown.

View File

@@ -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,