Extensions/comfyui-ap-tools
ComfyUI Extension

comfyui-ap-tools

A ComfyUI extension with 4 custom nodes.

By SnoopickΒ·Created 4 months agoΒ·Updated 3 months agoΒ· 0
Snoopick/comfyui-ap-tools
Nodes4
On cloudLocal install
Categoryap-tools
Stars0
Updated3 months ago
Readme

ap_tools_logo.png

ComfyUI AP Tools

A set of useful custom nodes for ComfyUI that improve convenience when working with images, file paths, and execution time.

πŸ“¦ Installation

  1. Navigate to the custom_nodes folder of your ComfyUI installation
  2. Clone the repository:
git clone https://github.com/your-username/comfyui-ap-tools.git
  1. Restart ComfyUI
  2. Use Manager for installation

✨ Features

The module contains 4 nodes with rich user interface:


πŸ”§ AP Image File Path

Category: ap-tools

image_file_path.png

Convenient file path constructor with template support. Allows saving frequently used paths and quickly switching between them.

Inputs:

  • file_name (STRING): File name without extension
  • file_path (STRING): Base path (hidden field, controlled by UI)

Outputs:

  • full_path (STRING): Full assembled path in Windows format (with backslashes)

Features:

  • βœ… Path template manager (save/delete)
  • βœ… Automatic combination of base path and file name
  • βœ… Relative paths support
  • βœ… Settings are saved in node properties
  • βœ… Minimum node size: 350x170 pixels

Usage:

  1. Enter the output file name in the file_name field
  2. In the templates section select an existing template or create a new one
  3. Enter relative path in the path field (it will be added to the selected template)
  4. Full path is automatically assembled and passed to output

πŸ–ΌοΈ AP Image Preview

Category: ap-tools

image_preview_1.png image_preview_2.png

Improved image previewer with zoom, loupe, and grid mode support.

Inputs:

  • image (IMAGE): Image or image batch for preview

Outputs:

No outputs (display only)

Features:

  • βœ… Display modes: Single and Grid
  • βœ… Batch image navigation (← β†’ arrows)
  • βœ… Scalable loupe (zoom 1.5x - 8.0x)
  • βœ… Automatic size fitting to node
  • βœ… Browser DPI scaling support
  • βœ… Minimum node size: 420x460 pixels
  • βœ… Hides standard ComfyUI output

Controls:

  • Mode: Switch between single and grid display
  • Zoom: Change loupe magnification level
  • ← β†’: Navigate through images in batch
  • Mouse hover: Shows loupe with magnified fragment

πŸ” AP Image Compare

Category: ap-tools

https://github.com/user-attachments/assets/95954dc6-0af3-4eb9-930e-3bb57473aa06

Tool for comparing two or more images with different modes.

Inputs:

  • image_1 (IMAGE): First image (required)
  • image_2 (IMAGE): Second image (required)
  • image_3 (IMAGE): Third image (optional)
  • image_4 (IMAGE): Fourth image (optional)

Outputs:

No outputs (display only)

Features:

  • βœ… Two comparison modes: Overlay and Split
  • βœ… Select any two images for comparison from 4 inputs
  • βœ… Transparency adjustment in overlay mode
  • βœ… Interactive splitter (draggable with mouse)
  • βœ… Zooming and panning
  • βœ… Center and Reset buttons for quick view reset
  • βœ… Minimum node size: 520x500 pixels
  • βœ… Mouse wheel for quick zoom

Modes:

  • Overlay: First image over second with adjustable transparency
  • Split: Vertical splitter that can be dragged to compare details

⏱️ AP Execution Timer

Category: ap-tools

timer.png

Workflow execution timer with history of recent runs.

Inputs:

No inputs

Outputs:

No outputs (display only)

Features:

  • βœ… Real-time from execution start to end
  • βœ… History of last 3 runs
  • βœ… Time format: HH:MM:SS.ms
  • βœ… Automatic start/stop when queue runs
  • βœ… Preserves state on page reload
  • βœ… Minimum node size: 440x160 pixels
  • βœ… Monospace font for easy reading

Display:

  • Main counter with millisecond precision
  • List of last 3 executions with number and time

πŸ“‚ Project Structure

comfyui-ap-tools/
β”œβ”€β”€ __init__.py                # Node registration and API endpoints
β”œβ”€β”€ templates.json             # Saved path templates storage
β”œβ”€β”€ nodes/
β”‚   β”œβ”€β”€ ap_image_file_path.py  # AP Image File Path node logic
β”‚   β”œβ”€β”€ ap_image_preview.py    # AP Image Preview node logic
β”‚   β”œβ”€β”€ ap_image_compare.py    # AP Image Compare node logic
β”‚   └── ap_execution_timer.py  # AP Execution Timer node logic
└── web/js/
    β”œβ”€β”€ ap_image_file_path.js  # Template manager frontend
    β”œβ”€β”€ ap_image_preview.js    # Previewer with loupe frontend
    β”œβ”€β”€ ap_image_compare.js    # Image comparison frontend
    └── ap_execution_timer.js  # Timer frontend

πŸ”Œ API Endpoints

Module provides following API methods for working with templates:

| Method | Path | Description |--------|-------------------------------|------------------------------------- | GET | /ap-tools/templates | Get list of all template names | GET | /ap-tools/templates/all | Get all templates with paths | POST | /ap-tools/templates | Save new template | DELETE | /ap-tools/templates/{name} | Delete template by name | GET | /ap-tools/execution-timer/uptime | Get ComfyUI uptime

πŸ’‘ Usage Tips

  1. AP Image File Path works great with image save nodes β€” use the full_path output as input for filename_prefix
  2. For comparing different generation variants use AP Image Compare β€” it's much faster than opening images in separate programs
  3. AP Execution Timer helps optimize workflows β€” notice execution time grew? Means something can be optimized
  4. All nodes automatically adapt to ComfyUI interface scale

πŸ› οΈ Technical Details

  • All nodes use native ComfyUI extension mechanisms
  • Frontend written in pure JavaScript without external dependencies
  • Path templates are stored in templates.json file in module root
  • Timer history is stored locally in browser localStorage
  • Only Windows path style is supported (backslashes \)
  • Preview and comparison images are saved in ComfyUI temp folder

πŸ“‹ Requirements

  • ComfyUI version 0.1.0 or higher
  • Python 3.8+
  • Compatible with all operating systems (Windows, Linux, macOS)

🀝 Support

If you found a bug or want to suggest an improvement, create an issue in the repository.