From faefd6a0f367b1070add4c9a43a9adeac83d553a Mon Sep 17 00:00:00 2001 From: TenserTensor Date: Tue, 3 Mar 2026 17:34:43 +0300 Subject: [PATCH] Improved documentation, fixed nodes counter --- README.md | 23 +++++------- node_mappings.py | 36 +++++------------- ...ghNode.md => TT_ContextPassthroughNode.md} | 2 +- web/docs/TT_GuiderImageReferenceNode.md | 31 ++++++++++++++++ web/docs/TT_ImageLoaderResizerNode.md | 32 ++++++++++++++++ web/docs/TT_ImagePreviewSaveNode.md | 31 ++++++++++++++++ web/docs/TT_ImagePreviewUpscaleSaveNode.md | 37 +++++++++++++++++++ 7 files changed, 151 insertions(+), 41 deletions(-) rename web/docs/{TT_BaseContextPassthroughNode.md => TT_ContextPassthroughNode.md} (92%) create mode 100644 web/docs/TT_GuiderImageReferenceNode.md create mode 100644 web/docs/TT_ImageLoaderResizerNode.md create mode 100644 web/docs/TT_ImagePreviewSaveNode.md create mode 100644 web/docs/TT_ImagePreviewUpscaleSaveNode.md diff --git a/README.md b/README.md index 7dcea6c..0a4f6b5 100644 --- a/README.md +++ b/README.md @@ -19,20 +19,15 @@ combining frequently used node chains into single, convenient loaders. ## Features -- **Workflow settings nodes** - configure entire workflow parameters (basic and advanced variants) -- **All-in-one model loaders** - load checkpoint, LoRAs, CLIP, and VAE in single nodes -- **Latent factory** - generate latents with aspect ratio, megapixel count, orientation, and type selection (Flux/SDXL) -- **Context nodes** - from Basic to Even Larger Context - - Basic: combines latent, model, CLIP, VAE, and workflow config into context - - Others: pass-through nodes that modify specific context values while preserving the rest -- **CLIP text encoders** - context-based and prompt-based encoding with model-specific controls -- **KSamplers** - Different implementations of KSampler for generating images. Accepts all common sampling parameters - and returns a denoised latent ready for VAE decoding. -- **VAE decoders** - basic, context-based, extended, and two-pass (draft + refinement) -- **Post-production tools** - image adjustments (brightness, contrast, saturation), color correction (apply LUT), film - grain, upscaler - - All-in-one post-production node combining all tools - - Simplified version without adjustments +- **Workflow settings** — configure global workflow parameters for FLUX and SDXL +- **Model loaders** — all-in-one loaders for checkpoint, LoRA, CLIP, and VAE +- **Context nodes** — pass pipeline state between nodes as a single context object +- **Latent factory** — create latents with aspect ratio, megapixel, and model type selection +- **CLIP text encoders** — prompt encoding with model-specific controls for FLUX and SDXL +- **Samplers** — KSampler variants including guided sampling with Guider/Sigmas support +- **Image tools** — load, resize, upscale, preview, and save images +- **VAE** — encode and decode with tiled and context-based variants +- **Post-production** — brightness, contrast, saturation, LUT, film grain, and upscaling ## Installation diff --git a/node_mappings.py b/node_mappings.py index 230f664..36e82ee 100644 --- a/node_mappings.py +++ b/node_mappings.py @@ -11,10 +11,10 @@ WHITE = "\033[37m" BRIGHT_GREEN = "\033[92m" BRIGHT_CYAN = "\033[96m" -NODES_COUNT = 0 +import inspect +import sys try: - before = set(dir()) from .nodes_context import * from .nodes.context.base_context import TT_BaseContext from .nodes.context.context import TT_Context @@ -25,41 +25,30 @@ try: from .nodes.context.even_larger_context import TT_EvenLargerContext from .nodes.context.large_context_flux import TT_LargeContextFlux from .nodes.context.large_context_sdxl import TT_LargeContextSdxl - - NODES_COUNT += len(set(dir()) - before) except ImportError: print(f"{YELLOW}TenserTensor: {RED}ERROR: Image nodes unavailable{RESET}") try: - before = set(dir()) from .nodes.image.image_preview_save import TT_ImagePreviewSave from .nodes.image.image_preview_upscale_save import TT_ImagePreviewUpscaleSave from .nodes.image.guider_image_reference import TT_GuiderImageReference from .nodes_image import * - - NODES_COUNT += len(set(dir()) - before) except ImportError: print(f"{YELLOW}TenserTensor: {RED}ERROR: Image nodes unavailable{RESET}") try: - before = set(dir()) from .nodes.latent.latent_factory import TT_LatentFactory from .nodes_latent import * - - NODES_COUNT += len(set(dir()) - before) except ImportError: print(f"{YELLOW}TenserTensor: {RED}ERROR: Latent nodes unavailable{RESET}") try: - before = set(dir()) from .nodes.loaders.flux_models_loader import TT_FluxModelsLoader from .nodes.loaders.flux_models_loader_advanced import TT_FluxModelsLoaderAdvanced from .nodes.loaders.gguf_models_loader import TT_Flux2GgufModelsLoader from .nodes.loaders.gguf_models_loader_advanced import TT_Flux2GgufModelsLoaderAdvanced from .nodes.loaders.sdxl_models_loader import TT_SdxlModelsLoader from .nodes.loaders.sdxl_models_loader_advanced import TT_SdxlModelsLoaderAdvanced - - NODES_COUNT += len(set(dir()) - before) except ImportError: print(f"{YELLOW}TenserTensor: {RED}ERROR: Loader nodes unavailable{RESET}") @@ -71,44 +60,33 @@ try: from .nodes.postproduction.postproduction import TT_Postproduction from .nodes.postproduction.postproduction_advanced import TT_PostproductionAdvanced from .nodes.postproduction.quick_image_upscaler import TT_QuickImageUpscaler - - NODES_COUNT += len(set(dir()) - before) except ImportError: print(f"{YELLOW}TenserTensor: {RED}ERROR: Postproduction nodes unavailable{RESET}") try: - before = set(dir()) from .nodes.sampling.ksampler import TT_KSampler from .nodes.sampling.ksampler_advanced import TT_KSamplerAdvanced from .nodes.sampling.ksampler_context import TT_KSamplerContext from .nodes.sampling.ksampler_two_stage import TT_KSamplerTwoStage from .nodes.sampling.ksampler_guided import TT_KSamplerGuided - - NODES_COUNT += len(set(dir()) - before) except ImportError: print("f{YELLOW}TenserTensor: {RED}ERROR: Sampler nodes unavailable{RESET}") try: - before = set(dir()) from .nodes.text_encoders.clip_text_encode_flux import TT_ClipTextEncodeFlux from .nodes.text_encoders.clip_text_encode_flux_context import TT_ClipTextEncodeFluxContext from .nodes.text_encoders.clip_text_encode_sdxl import TT_ClipTextEncodeSdxl from .nodes.text_encoders.clip_text_encode_sdxl_context import TT_ClipTextEncodeSdxlContext from .nodes.text_encoders.clip_text_encode_flux2 import TT_ClipTextEncodeFlux2 from .nodes.text_encoders.clip_text_encode_flux2_context import TT_ClipTextEncodeFlux2Context - - NODES_COUNT += len(set(dir()) - before) except ImportError: print(f"{YELLOW}TenserTensor: {RED}ERROR: Text Encoder nodes unavailable{RESET}") try: - before = set(dir()) from .nodes.vae.vae_decode_context import TT_VaeDecodeContext from .nodes.vae.vae_decode_tiled import TT_VaeDecodeTiled from .nodes.vae.vae_encode_context import TT_VaeEncodeContext from .nodes.vae.vae_encode_tiled import TT_VaeEncodeTiled - - NODES_COUNT += len(set(dir()) - before) except ImportError: print(f"{YELLOW}TenserTensor: {RED}ERROR: VAE nodes unavailable{RESET}") @@ -121,11 +99,17 @@ try: from .nodes.workflow.flux2_workflow_settings import TT_Flux2WorkflowSettings from .nodes.workflow.flux2_workflow_settings_advanced import TT_Flux2WorkflowSettingsAdvanced from .nodes_workflow import * - - NODES_COUNT += len(set(dir()) - before) except ImportError: print(f"{YELLOW}TenserTensor: {RED}ERROR: Workflow nodes unavailable{RESET}") +ADDED = { + name + for name, obj + in inspect.getmembers(sys.modules[__name__], inspect.isclass) + if name.startswith("TT_") +} +NODES_COUNT = len(ADDED) + NODE_CLASS_MAPPINGS = { # Context Deprecated "TT_BaseContext": TT_BaseContext, diff --git a/web/docs/TT_BaseContextPassthroughNode.md b/web/docs/TT_ContextPassthroughNode.md similarity index 92% rename from web/docs/TT_BaseContextPassthroughNode.md rename to web/docs/TT_ContextPassthroughNode.md index a39b10e..897b508 100644 --- a/web/docs/TT_BaseContextPassthroughNode.md +++ b/web/docs/TT_ContextPassthroughNode.md @@ -1,4 +1,4 @@ -## TT Base Context Passthrough *TT_BaseContextPassthroughNode* +## TT Context Passthrough *TT_ContextPassthroughNode* *This description was generated with AI assistance. If you spot any errors, please create an issue on GitHub.* diff --git a/web/docs/TT_GuiderImageReferenceNode.md b/web/docs/TT_GuiderImageReferenceNode.md new file mode 100644 index 0000000..cc94476 --- /dev/null +++ b/web/docs/TT_GuiderImageReferenceNode.md @@ -0,0 +1,31 @@ +## TT Guider Image Reference *TT_GuiderImageReferenceNode* + +*This description was generated with AI assistance. If you spot any errors, please create an issue on GitHub.* + +Encodes a reference image into latent space and injects it into a guider's conditioning as reference latents. Useful for image-guided sampling workflows. + +### Inputs + +| Parameter | Type | Required | Description | +|---|---|---|---| +| `vae` | VAE | Yes | VAE model for encoding the reference image | +| `guider` | GUIDER | Yes | Guider to inject reference latents into | +| `megapixels` | COMBO | Yes | Target resolution for resizing before encoding | +| `resize_method` | COMBO | No | Interpolation method for resizing (advanced) | +| `dimension_step` | INT | No | Align output dimensions to this step size, 1-256 (advanced) | +| `image` | COMBO | Yes | Reference image file to load, with upload support | + +### Outputs + +| Parameter | Type | Description | +|---|---|---| +| `VAE` | VAE | Passthrough of the input VAE | +| `GUIDER` | GUIDER | Guider with reference latents injected into conditioning | + +### Usage + +Load a reference image, resize it to the target resolution, encode it with the VAE, and inject the resulting latents into the guider's conditioning. Connect the output `GUIDER` to a sampler to use image-guided sampling. + +--- + +[View on GitHub](https://github.com/tenser-tensor/ComfyUI-TenserTensor) diff --git a/web/docs/TT_ImageLoaderResizerNode.md b/web/docs/TT_ImageLoaderResizerNode.md new file mode 100644 index 0000000..f2f08e0 --- /dev/null +++ b/web/docs/TT_ImageLoaderResizerNode.md @@ -0,0 +1,32 @@ +## TT Image Loader / Resizer *TT_ImageLoaderResizerNode* + +*This description was generated with AI assistance. If you spot any errors, please create an issue on GitHub.* + +Loads an image from the input directory with optional resizing to a target megapixel count and alpha mask extraction. + +### Inputs + +| Parameter | Type | Required | Description | +|------------------|---------|----------|-----------------------------------------------------------------------| +| `resize_image` | BOOLEAN | Yes | Scale image to target megapixels (Scale) or keep original size (Keep) | +| `resize_method` | COMBO | No | Interpolation method for resizing (advanced) | +| `dimension_step` | INT | No | Align output dimensions to this step size, 1–256 (advanced) | +| `megapixels` | COMBO | No | Target resolution in megapixels (advanced) | +| `create_mask` | BOOLEAN | Yes | Extract alpha channel as mask (Mask) or return empty mask (Empty) | +| `image` | COMBO | Yes | Image file to load, with upload support | + +### Outputs + +| Parameter | Type | Description | +|-----------|-------|----------------------------------------------------| +| `IMAGE` | IMAGE | Loaded (and optionally resized) image tensor | +| `MASK` | MASK | Alpha channel mask, or empty mask if not extracted | + +### Usage + +Load an image from the input directory and optionally resize it to a target megapixel count. When resizing is enabled, both the image and mask are +scaled together. Use `dimension_step` to snap output dimensions to a specific grid — useful for models that require dimensions divisible by 8 or 64. + +--- + +[View on GitHub](https://github.com/tenser-tensor/ComfyUI-TenserTensor) diff --git a/web/docs/TT_ImagePreviewSaveNode.md b/web/docs/TT_ImagePreviewSaveNode.md new file mode 100644 index 0000000..5548634 --- /dev/null +++ b/web/docs/TT_ImagePreviewSaveNode.md @@ -0,0 +1,31 @@ +## TT Image Preview / Save *TT_ImagePreviewSaveNode* + +*This description was generated with AI assistance. If you spot any errors, please create an issue on GitHub.* + +Previews an image in the node graph and optionally saves it to the output directory. + +### Inputs + +| Parameter | Type | Required | Description | +|---------------------|---------|----------|----------------------------------------------------------------| +| `image` | IMAGE | Yes | Image to preview and optionally save | +| `save_image` | BOOLEAN | Yes | Save image to disk (Save image) or preview only (Only preview) | +| `filename_prefix` | STRING | Yes | Prefix for the output filename (default: TT) | +| `filename_format` | COMBO | No | Filename format pattern (advanced) | +| `subfolder` | STRING | No | Subfolder within the output directory (advanced) | +| `image_format` | COMBO | No | Output file format: PNG, JPEG, WEBP (advanced) | +| `image_quality` | INT | No | JPEG quality, 1-100 (advanced) | +| `compression_level` | INT | No | PNG compression level, 0-9 (advanced) | + +### Outputs + +This node has no outputs. It is a terminal output node. + +### Usage + +Place at the end of a workflow to preview the result and optionally save it to disk. When saving is disabled, the image is still visible in the node +graph as a preview. Use `subfolder` to organize outputs into subdirectories, and `filename_format` to control how files are named. + +--- + +[View on GitHub](https://github.com/tenser-tensor/ComfyUI-TenserTensor) diff --git a/web/docs/TT_ImagePreviewUpscaleSaveNode.md b/web/docs/TT_ImagePreviewUpscaleSaveNode.md new file mode 100644 index 0000000..9a029d6 --- /dev/null +++ b/web/docs/TT_ImagePreviewUpscaleSaveNode.md @@ -0,0 +1,37 @@ +## TT Image Preview / Upscale / Save *TT_ImagePreviewUpscaleSaveNode* + +*This description was generated with AI assistance. If you spot any errors, please create an issue on GitHub.* + +Previews an image in the node graph with optional upscaling via a dedicated upscale model and optional saving to the output directory. + +### Inputs + +| Parameter | Type | Required | Description | +|---------------------|---------|----------|-------------------------------------------------------------------------------| +| `image` | IMAGE | Yes | Image to preview, upscale, and optionally save | +| `save_image` | BOOLEAN | Yes | Save image to disk (Save image) or preview only (Only preview) | +| `upscale_image` | BOOLEAN | Yes | Upscale image before saving (Upscale image) or keep original size (Keep size) | +| `filename_prefix` | STRING | Yes | Prefix for the output filename (default: TT) | +| `filename_format` | COMBO | No | Filename format pattern (advanced) | +| `subfolder` | STRING | No | Subfolder within the output directory (advanced) | +| `image_format` | COMBO | No | Output file format: PNG, JPEG, WEBP (advanced) | +| `image_quality` | INT | No | JPEG quality, 1-100 (advanced) | +| `compression_level` | INT | No | PNG compression level, 0-9 (advanced) | +| `upscaler_device` | COMBO | No | Device to run the upscale model on (advanced) | +| `upscale_model` | COMBO | No | Upscale model to use (advanced) | +| `upscale_tile` | INT | No | Tile size for tiled upscaling, 128-4096 (advanced) | +| `upscale_overlap` | INT | No | Overlap between tiles in pixels, 8-256 (advanced) | + +### Outputs + +This node has no outputs. It is a terminal output node. + +### Usage + +Place at the end of a workflow to upscale, preview, and optionally save the result. When upscaling is enabled, the image is processed through the +selected upscale model before saving. Tiled upscaling is used to handle large images with limited VRAM — reduce `upscale_tile` if you run into +out-of-memory errors. + +--- + +[View on GitHub](https://github.com/tenser-tensor/ComfyUI-TenserTensor)