Imgutils Check
Monochrome, Truncated, AI-Created, Complete?
- image
- label
- boolean
- json
Before you train a LoRA on a folder of images, it helps to know which ones are lineart scans, which got truncated mid-download, and which are half-cropped renders that will poison the dataset. Imgutils Check is the boolean-answer node for exactly those questions - five checks in one dropdown, each returning a real BOOLEAN you can gate on.
What it checks
The mode dropdown:
- Is AI Created - a trained classifier for "does this look AI-generated." Soft signal, more below.
- Is Monochrome - single-hue images (lineart, sketches, color-bleed extras).
- Is Greyscale - no saturation (grayscale photography, ink work).
- Is Truncated - writes a temp PNG and checks the file for truncation. This is the "was the download cut off" test, quietly useful for bulk-scraped folders.
- Anime Completeness - checks that the character in frame has its expected parts (head, torso, limbs). Half-cropped renders fail it.
How it works
The mechanical checks (monochrome, greyscale, truncation) are pixel/file analysis - instant, no model. "Is AI Created" and "Anime Completeness" are model-backed, pulled from imgutils' validate library. Every mode returns three outputs: label (STRING - the verdict in words), boolean (BOOLEAN - the same verdict as a gate), and json (STRING - a small detail dict). The boolean is the part you wire into switches, Imgutils Boolean Logic, or any conditional.
The honest take
Set expectations on "Is AI Created": it's a vibe classifier, useful as a soft signal for curating a reference folder or flagging suspicious input, not a detector you'd build policy on. The genuinely load-bearing modes for a danbooru pipeline are the practical ones - Is Monochrome / Is Greyscale (auto-drop lineart scans and sketches from a dataset before they drag the average down) and Anime Completeness (auto-reject half-cropped renders). The KB's lora-training doc is full of warnings about garbage-in; this node is a cheap automated layer of that garbage filter. Is Truncated is the sleeper - if you bulk-download references, corrupted files fail here instead of corrupting your training.
One more: because the output is a boolean, it composes. "Skip this image if it's greyscale OR truncated" is a Check → BoolLogic → switch chain, and that's a real batch-pipeline move.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/xiaden/comfyui-imgutils.git
cd comfyui-imgutils
pip install -r requirements.txt
Or via ComfyUI Manager (search "imgutils"). Needs ComfyUI >= 0.25.0 and Python >= 3.10; dependency is dghs-imgutils[gpu]. The AI-created and completeness modes download their models on first use; monochrome/greyscale/truncated are instant with nothing to fetch.
Troubleshooting
If a check returns unexpectedly across the board, verify you're not comparing a downscaled tensor - greyscale and monochrome are resolution-sensitive on tiny thumbnails. And remember the outputs: if your graph reads a number where you expected a boolean, you've grabbed the wrong socket - boolean is the BOOLEAN, label is the STRING verdict, and json is the detail dict.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Input image to analyze. | |
| mode | COMBO | Is AI Created | What to check — AI-created detection, monochrome, greyscale, truncation, or completeness. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| label | STRING | — |
| boolean | BOOLEAN | — |
| json | STRING | — |