Extensions/ComfyUI-nhknodes
ComfyUI Extension

ComfyUI-nhknodes

ComfyUI custom nodes collection with workflow utilities, image processing, and AI integration

By Enashka·Created 12 months ago·Updated 22 days ago· 23
Enashka/ComfyUI-nhknodes
Nodes39
On cloudLocal install
Categorynhk/image, nhk/utility
Stars23
Updated22 days ago

Nodes (39)

🧑 Add Headroom (nhk)

Giving Your Subject Room to Breathe — Add Headroom (nhk)

nhk/image
🔖 Bookmark (nhk)

Jump Around a Giant Workflow Instantly — Bookmark (nhk)

nhk/utility
🔀 Conditional Router (nhk)

The If/Else Your Workflow Never Had — Conditional Router (nhk)

nhk/wip
🔀 Conditional Router Dual (nhk)

Route Two Wires at Once — Conditional Router Dual (nhk)

nhk/wip
🔀 Conditional Splitter (nhk)

Send One Input Down Two Paths — Conditional Splitter (nhk)

nhk/wip
🛑 Conditional Stop (nhk)

The Quality Gate That Silently Halts a Batch — Conditional Stop (nhk)

nhk/wip
🎯 Crop To Mask (nhk)

Tight Crop From a Mask, With the Coordinates to Stitch Back — Crop To Mask (nhk)

nhk/image
🔄 Cycling Switch (nhk)

Rotate Through Prompts Automatically — Cycling Switch (nhk)

nhk/utility
🔀 Double Switch - In (nhk)

Switch Two Wires as One Unit — Double Switch - In (nhk)

nhk/utility
🔀 Double Switch - Out (nhk)

Send a Wire Pair to One of Two Destinations — Double Switch - Out (nhk)

nhk/utility
🎨 Edit with Krita (nhk)

Round-Trip a Frame Through Krita Mid-Workflow (Edit with Krita, nhk)

nhk/image
⏱️ Execution Counter (nhk)

Generate Exactly N Images, Then Stop — Execution Counter (nhk)

nhk/utility
⏹️ Extract Grid Panel (nhk)

Slice a Panel Out of a Grid Image — Extract Grid Panel (nhk)

nhk/image
🍌 Gemini API (nhk)

Gemini Inside ComfyUI — Generate, Edit, and Analyze Images Without Leaving the Graph

nhk/ai
🔍 Image Evaluator (nhk)

An AI quality gate that actually looks at your images

nhk/wip
📦 Image Grid Batch (nhk)

Stack unlimited images into one batch — despite the name, it's not a visual grid

nhk/image
🎯 Image Grid Composite (nhk)

Turn any pile of images into a clean contact sheet grid

nhk/image
🖼️ Image Loader With Previews (nhk)

The image loader that finally lets you browse, not guess filenames

nhk/image
🚪 Interval Gate (nhk)

Run a branch every 5th image — ComfyUI's 'every now and then' switch

nhk/utility
📋 List Selector (nhk)

Step through a prompt list across queue runs

nhk/utility
🤖 OpenAI API (nhk)

Chat with GPT-4o or GPT-5 inside your workflow — vision included

nhk/ai
🔲 Load 2x2 Grid Series (nhk)

Slices every image in a folder into its 2x2 grid cells — reading order, on autopilot

nhk/image
⏹️ Load 3x3 Grid Series (nhk)

Every file is a 3x3 grid — this node walks it cell by cell

nhk/image
📸 Load Image Series (nhk)

A whole folder of images, loaded one at a time, on autopilot

nhk/image
📁 Image Series With Prompts (nhk)

A folder of images where every frame drags its own prompt along

nhk/image
📂 Load Text Files (nhk)

Cycle through saved text files like a prompt jukebox

nhk/text
🦙 Ollama API (nhk)

Multi-turn conversations with a local LLM, not just one-shot generations

nhk/ai
🔊 Play Sound (nhk)

Stop Staring at the Progress Bar — Play Sound (nhk)

nhk/utility
👁️ Preview Image + (nhk)

Preview an Image Without Ending the Line — Preview Image + (nhk)

nhk/wip
🎨 RGBA Flatten (nhk)

Flatten transparent images onto a real background

nhk/image
💾 Save Image + (nhk)

Save the image AND keep it flowing — a Save that doesn't end the line

nhk/wip
📝 Simple Text Input (nhk)

The Most Honest Node in the Pack — Simple Text Input (nhk)

nhk/text
📐 Size Picker (nhk)

95 Resolution Presets You Didn't Know You Needed — Size Picker (nhk)

nhk/utility
📝 Text Combiner (nhk)

Glue as many text inputs as you want into one string — with a separator you control

nhk/text
📄 Text Display (nhk)

A bare text viewer so you can actually read what the model said

nhk/text
Text Encode Flux2 Image Edit (nhk)

One Node for Flux 2 Klein Image Editing — Text Encode Flux2 Image Edit (nhk)

nhk/conditioning
📝 Text Template (nhk)

Fill-in-the-Blanks Prompts, Done Properly — Text Template (nhk)

nhk/text
📝 Text Template Extended (nhk)

Prompt templates with up to 8 slots

nhk/text
📏 Visual Resizer (nhk)

Drop any image onto a custom canvas — resize, position, and offset with a live preview

nhk/image
Readme

NHK Nodes for ComfyUI

A comprehensive collection of utility nodes for ComfyUI workflows. Organized into logical categories for better workflow management.

🌟 Featured Node

🖼️ Image Loader With Previews

The standout feature of this collection - an advanced image loader that hopefully simplifies how you browse and select images in ComfyUI.

<p align="center"> <img src="./images/loader_1.png" width="45%" /> <img src="./images/loader_2.png" width="45%" /> </p>
  • Browse from any folder on your system
  • Live image previews - see images before selecting
  • Multiple sorting options: name, date modified, created

📦 Installation

Via ComfyUI Manager (Recommended)

  1. Open ComfyUI Manager
  2. Search for "NHK Nodes"
  3. Click Install
  4. Restart ComfyUI

Manual Installation

  1. Clone or download this repository to ComfyUI/custom_nodes/nhknodes
  2. Restart ComfyUI
  3. Nodes will appear in organized categories under nhk

🗂️ Node catalog

🔤 Text Processing (nhk/text)

  • 📝 Simple Text Input (nhk) – Minimal text entry node that just forwards its value.
  • 📄 Text Display (nhk) – Shows any incoming string inside the UI while keeping the data flowing.
  • 📂 Load Text Files (nhk) – Load text files with auto-incrementing index, repeat count, and wrap-around. Scans folders for numbered files (e.g., saved_text_001.txt).
  • 🧩 Text Combiner (nhk) – Unlimited text inputs with automatic sockets and configurable separator.
  • 🧷 Text Template (nhk) – Lightweight templating (The [a] walks in the [b]) with 4 placeholders [a]-[d].
  • 🧷 Text Template Extended (nhk) – Same as Text Template but with 8 placeholders [a]-[h].

🖼️ Image Processing (nhk/image)

  • 🖼️ Image Loader With Previews (nhk) – The featured browser with searchable folders, previews, and sorting.
  • 📸 Load Image Series (nhk) – Sequence loader with two modes (single_image/random). Use control_after_generate=increment for auto-advancing.
  • 📁 Image Series With Prompts (nhk) – Loads a folder sequence and attaches per-file prompts from a markdown lookup, with optional default fallback.
  • 📦 Image Grid Batch (nhk) – Stacks arbitrary images into a batch tensor for downstream samplers.
  • 🎯 Image Grid Composite (nhk) – Creates presentation grids with gutters, padding, and background control.
  • 📏 Visual Resizer (nhk) – Drops any image onto a custom canvas size with precise offsets.
  • 🧑 Add Headroom (nhk) – Shrinks the subject within the original canvas to create breathing room up top.
  • 🎨 Edit with Krita (nhk) – Sends a frame to Krita, waits for edits, and re-imports it into the workflow.
  • ⏹️ Extract Grid Panel (nhk) – Extracts a single panel from a grid image using spreadsheet notation (a1, b2, c3). Supports variable grid sizes and separator widths.
  • ⏹️ Load 2x2 Grid Series (nhk) – Loads images from a directory, treating each as a 2x2 grid. Extracts cells in reading order.
  • ⏹️ Load 3x3 Grid Series (nhk) – Loads images from a directory, treating each as a 3x3 grid. Extracts cells in reading order.
  • 🎨 RGBA Flatten (nhk) – Composites RGBA over solid background color, eliminating alpha artifacts and color bleed.
  • 🎯 Crop To Mask (nhk) – Crops image and mask to the mask bbox with a single padding value. Outputs bbox for stitch-back.

⚙️ Workflow Utilities (nhk/utility)

  • 📋 List Selector (nhk) – Select from a list by index, use a default input, or batch the entire list. Index 0 = default, 1+ = list item. Batch mode outputs all items as an output list.
  • 🔄 Cycling Switch (nhk) – Rotates through unlimited inputs, staying on each for a configurable number of runs.
  • 🚪 Interval Gate (nhk) – Turns a branch on/off every N executions (perfect for “every 5th image” flows).
  • 🔀 Double Switch (In/Out) (nhk) – Paired A/B switches that route image/text tuples together.
  • ⏱️ Execution Counter (nhk) – Counts queue runs, stops when a limit is reached, and shows progress.
  • 📐 Size Picker (nhk) – Flux/SDXL/Qwen/ZIT-optimized resolution presets with handy metadata.
  • 🔊 Play Sound (nhk) – Small notification node that plays an audio file when a queue finishes.
  • 🔖 Bookmark (nhk) – Frontend-only canvas bookmark with keyboard shortcut and zoom positioning.

🎛️ Conditioning (nhk/conditioning)

  • ⚡ Text Encode Flux2 Image Edit (nhk) – Simplified encoding for Flux2 Klein image editing. Combines prompt + up to 3 reference images into positive/negative conditioning with reference latents attached.

🤖 AI & Media (nhk/ai)

  • 🦙 Ollama API (nhk) – Local chat/vision models with hidden thinking output and optional image prompts.
  • 🤖 OpenAI API (nhk) – GPT‑4/GPT‑5 chat with optional vision input (requires OPENAI_API_KEY).
  • 🍌 Gemini API (nhk) – Gemini image-gen models (3.1-flash, 3-pro, 2.5-flash) and vision-text analysis (3.5-flash); up to 4 input images, aspect ratio, resolution (requires GOOGLE_API_KEY).

🚀 Key Features

  • Dynamic Inputs - Many nodes support unlimited inputs that auto-expand as you connect
  • Conditional Branching - Interval Gate enables periodic workflow paths (upscale every 5th image, etc.)
  • Configurable Cycling - Cycling Switch with stay duration control for precise input testing
  • Smart UI - Hover tooltips and emoji icons for easy identification
  • Clean Organization - Logical categories make nodes easy to find
  • Professional Quality - Consistent design and error handling throughout

📋 Requirements

For OpenAI API Node

  • OpenAI API key in .env file:
    OPENAI_API_KEY=your_api_key_here
    
  • GPT nodes support gpt-4o, gpt-4o-mini, chatgpt-4o-latest, plus gpt-5 / gpt-5-mini / gpt-5-nano.

For Gemini API Node

  • Google API key in .env file:
    GOOGLE_API_KEY=your_api_key_here
    
  • Install: pip install google-genai

For Ollama API Node

  • Ollama server running locally (ollama serve)
  • Pull at least one supported model (ollama pull qwen3-vl:8b, etc.)
  • Optional vision input works automatically when the selected model supports it

For Edit with Krita Node

  • Krita available either as AppImage, system install, or Flatpak
  • Writable directory for round-tripping frames (default /home/nhk/workspace/editing)

📄 License

MIT License - Feel free to use, modify, and distribute.

🤝 Contributing

Contributions welcome! Please follow the existing code style and add appropriate documentation.


Created by NHK | GitHub | ComfyUI Registry

🧪 Experimental (WIP)

  • Image Evaluator, Conditional Router/Dual/Splitter/Stop, Save Image +, Preview Image + — part of the in-progress Image Evaluation workflow (see IMAGE_EVALUATION.md). They load under nhk/wip; behavior may change while we resolve reverse-dependency (pull-based) execution quirks in ComfyUI.