Nodes/ComfyUI-TextureAlchemy/Normal Format Brute Force Checker
ComfyUI Node

Normal Format Brute Force Checker

The dumb way to detect a normal map's format (and it works)

By amtarr·Created 9 months ago·Updated 4 months ago· 58
Normal Format Brute Force Checker
  • normal_map
  • normal_map
  • detected_format
  • conversion_info
target_formatDirectX

Every normal map format detector in this pack analyzes the green channel, but they go about it with different levels of ceremony. Normal Format Brute Force Checker is the no-ceremony version: it looks at the overall color of the map and makes a call. More green overall means DirectX. More blue/purple means OpenGL. Then it converts to whatever format you asked for, if it needs to. That's the whole algorithm, and the source is upfront about it - it's called "brute force" because that's exactly what it is.

It sits in TextureAlchemy's Texture Alchemist/Normal group as the quick-and-dirty sibling of Normal Format Auto-Converter. Same three outputs, less sophisticated reasoning.

How it works

A normal map's average color carries the format signature: in DirectX the Y axis points down, which pushes the green channel toward 0 (dark green), while in OpenGL the up-pointing Y pushes green toward 1 (bright green) - and the blue channel encodes the Z axis in both. So the node computes the balance of green versus blue across the whole image: green-heavy reads as DirectX, blue/purple-heavy as OpenGL. If that read doesn't match your target_format, it flips the green channel and calls it done.

That's genuinely it. It's faster and coarser than the Auto node's mean-threshold analysis, and it trades precision for simplicity - a strongly biased map gets the right answer almost every time, and a balanced one is a coin flip.

Outputs mirror the Auto node: normal_map (converted or untouched), detected_format STRING, and conversion_info STRING. Inputs with fewer than three channels are rejected with a warning rather than processed.

The inputs that matter

  • normal_map - the map to classify and convert.
  • target_format - DirectX or OpenGL, whatever your engine wants.

The honest take

Is this the node you should use? If you have a clear, typical normal map, yes - it'll nail it and you're done. But the mean color heuristic is strictly worse than the Auto node's green-channel distribution test, which is itself a heuristic. The Brute Force node is the right tool when you want the answer without thinking about thresholds, and the wrong tool when your map is subtle, mostly-flat, or channel-odd. For those, run Normal Format Auto or the Validator, which at least show you their reasoning.

Honestly, this node's main value might be pedagogical: it's the least confusing illustration in the pack of what "format detection" even means, because it reduces it to one visible color cue you can eyeball yourself.

Installing it

Part of ComfyUI-TextureAlchemy. ComfyUI Manager → search "TextureAlchemy" → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/amtarr/ComfyUI-TextureAlchemy

Restart, find it under Texture Alchemist → Normal. No dependencies beyond torch.

Common issues

  • "It got the format wrong on my map." Likely a balanced or unusual map where the color cue isn't decisive. Re-run with Normal Format Auto and compare - if they disagree, your map is genuinely ambiguous.
  • "Nothing happened." Your map already matched the target format. Check conversion_info.
  • "The map looks odd after conversion." If the source had unusual channel balance, the flip can look heavy-handed. Go back to the more careful Auto node.

It's a fine utility, but know what you're buying: speed and simplicity, not rigor. When a normal map really matters, use the Auto node.

CategoryTexture Alchemist/Normal

Inputs (2)

NameTypeDefaultDescription
normal_mapIMAGE
target_formatCOMBODirectXDesired output format

Outputs (3)

NameTypeDescription
normal_mapIMAGE
detected_formatSTRING
conversion_infoSTRING