ComfyUI Node

Image Type Check

Is it a depth map, a normal map, or a regular photo? A node that just looks

By GuillaumeBonvin·Created 6 months ago·Updated 5 months ago· 0
Image Type Check
  • image
  • image_type

The "wait, what am I feeding this?" node

Every now and then a workflow hands you an image and you genuinely can't tell what it is. Is this grey blob a depth map, a soft mask, or just a desaturated photo? ControlNets are picky - feed a depth-conditioned model a normal map and you get garbage with extra steps. If you're building an automated pipeline (or you inherited someone's messy graph), you want a node that answers the question instead of eyeballing pixels yourself.

ImageTypeCheck is exactly that: one input, one string output. It looks at the image, decides which of seven buckets it falls into, and hands you the answer.

How it works

The mechanism is a fast pixel heuristic, not a trained classifier. It grabs up to 512×512 pixels, counts the unique colors, and runs a cascade of checks, in order:

  • One single colorSolidColor
  • Only pure black and/or white (fewer than 3 unique colors) → Mask
  • Every pixel is grey (R == G == B)DepthMap
  • Strong blue dominance plus unit-vector length (the classic purple-blue normal map) → NormalMap
  • Mostly near-black pixels with a good chunk matching the OpenPose color paletteOpenPose
  • Any real color variationRegularImage
  • Nothing matchedUnknown

Each check also computes a confidence score - that's logged to the console on every run, which is the closest thing this pack has to diagnostics. The score doesn't come out as a node output, so if you're curious about how sure the node is, you're reading the terminal, not the graph.

The inputs and outputs that matter

There are only two things to know here:

  • image (required) - whatever tensor you want classified.
  • image_type (output) - a STRING, one of: SolidColor, Mask, DepthMap, NormalMap, OpenPose, RegularImage, Unknown.

That string is the pack's lingua franca. Wire it into the pack's ValidateTypeNode to build a boolean check, or straight into ControlNetModelSelector, which runs the exact same detection internally.

Installing it

ComfyUI Manager: search "ComfyUI-projectorz-helper". Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/GuillaumeBonvin/ComfyUI-projectorz-helper

Restart ComfyUI and it shows up under "ProjectorzHelp". No requirements.txt, no extra downloads - torch alone, which you already have. The whole pack is three small nodes with a one-line README that says "work in progress," so the source is really the only documentation; it's short and readable if you want to verify anything.

Common gotchas

The ordering of the checks does some surprising things. A soft mask - black fading to white as a gradient - isn't pure black/white, so it skips the Mask branch and lands on DepthMap because every pixel is grey. That's usually harmless for a depth-conditioned model (a soft mask is basically a depth map anyway), but it will confuse you if you're explicitly branching on the result.

Detection is also sampling-based on big images, and it's just a heuristic. An unusual normal map with low blue dominance, or a fancy colored OpenPose render, can come back RegularImage. When that matters, don't fight the detector - pass the type forward yourself and use ImageTypeCheck only as a convenience in paths where the input is well-behaved. For the common case - standard Projectorz-style depth, normal, and pose exports - it's reliably right.

CategoryProjectorzHelp

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (1)

NameTypeDescription
image_typeSTRING