$ show TTPlanetPig/Comfyui_TTP_Toolset
This is a ComfyUI custom node pack providing advanced tile-based image upscaling, inpainting, and detail enhancement via a 'Smart Tile 2.0' system. It enables variable-size, object-aware tiling using SAM3/QwenVL3 for automatic detection and per-tile prompt generation, with an interactive canvas editor in the browser for manual control. The pack also includes video generation helpers: LTX-Video first/last frame conditioning, a TeaCache sampler for HunyuanVideo acceleration, and various conditioning/coordinate nodes. The codebase is predominantly a set of ComfyUI node implementations in Python with a significant frontend JavaScript component for the interactive tile editor. While it functions as a library for ComfyUI workflows, its core tile data structures and layout algorithms could be extracted for use in other image processing pipelines. The repository is actively maintained, with example workflows demonstrating real production usage for high-resolution Flux and HunyuanVideo generation.
The LLM identified 5 files worth highlighting for reuse:
The `TTP_SMART_TILE_SET` class defines a reusable data structure for representing a collection of image tiles with metadata (core_box, sample_box, paste_box, masks, layer, priority). It also contains parsing functions like `_ttp_parse_smart_tile_layout` and `_ttp_normalize_tile_box` that convert a normalized layout JSON into tile objects. These components are decoupled from ComfyUI's node system and could be extracted as a standalone Python library for tile-based image manipulation in any project.
A large (~2000+ lines) vanilla JavaScript module providing a full interactive tile editor within ComfyUI's web interface. It implements canvas rendering of tile boxes, masks, and a brush/erase tool; drag-and-drop tile manipulation; auto-detection via SAM3/QwenVL; and loop queueing. The core canvas editor and tile layout logic are isolated from ComfyUI specifics (e.g., using a generic `addDOMWidget` pattern) and could be reused in other web-based image editing tools.
Functions `_ttp_find_pixel_alignment_offset_gpu` (with CPU fallback) and `_ttp_apply_local_mean_std_color_transfer` perform sub-pixel alignment and color normalization across tiles. These are pure image processing utilities that use numpy/torch and are not tied to ComfyUI. They could be extracted into a standalone image processing library for tiling assembly with color correction.
The `TTP_Smart_Tile_Loop_Source_Experimental` and `TTP_Smart_Tile_Loop_Collect_Experimental` nodes implement a generic loop pattern for iterative tile processing within ComfyUI. They manage session state, restart/loop requests, and event-driven re-queueing. While tied to ComfyUI's node API, the session management pattern (session_id, done events, restart triggers) is a reusable architectural design for any workflow engine that requires iterative batch processing.
The QwenVL3 loader (`TTP_Smart_Tile_QwenVL3_Loader_Experimental`) and prompt builder (`TTP_Smart_Tile_QwenVL_Prompt_Set_Builder_Experimental`) wrap local vision-language models for per-tile captioning. The caching mechanism (`_TTP_QWENVL_PROMPT_CACHE`) and robust JSON parsing (handling multiple bbox formats) are reusable patterns for integrating VLM inference into image processing pipelines. These could be extracted into a standalone Python module for model inference with caching.