Nodes/ComfyUI-LexTools/FoodCategoryClassifierNode
ComfyUI Node

FoodCategoryClassifierNode

The node that judges what's on your plate

By SOELexicon·Created 3 years ago·Updated about a year ago· 33
FoodCategoryClassifierNode
  • image
  • STRING

FoodCategoryClassifierNode looks at an image and tells you what kind of food is in it - the top five categories with confidence scores, returned as a string. It's the most harmless node in the LexTools pack, the one you reach for when you want to prove the whole classification pipeline works before trusting it on something serious.

The honest framing: food classification is the "hello world" of image classification. It's well-trodden, the models are decent, and the failure modes are cheap - when it mistakes a bowl of pasta for soup, nobody loses money. So this node is genuinely useful as a confidence-builder and a sanity check for how these classifier nodes behave: what the string output looks like, how fast it runs, how the model downloads. Learn the pattern here and the pack's other classifiers make more sense.

How it works

Same machinery as the rest of the pack's classifiers: a HuggingFace transformers image-classifier, loaded and run locally, with softmax probabilities on the top five food categories. Image in, string out. The README is explicit that you get "top 5 food categories with probabilities" - so expect output like pizza: 0.82, focaccia: 0.11, ... rather than a single verdict.

Inputs and outputs:

  • image - the IMAGE to classify.
  • STRING - the top five categories with probabilities.

What you'd actually do with it

Not much, and that's fine. It's a nice toy for food photos, a quick classifier to test your wiring, and a harmless way to learn how the pack's classifier family behaves before you run something with real stakes. If you're building a workflow that logs "what's in this image" annotations, food is a pleasant subset to demo it on. It does its job, it's fast after the first model download, and it will be wrong in amusing ways on anything stylized or heavily processed - a glazed render of a burger may come back as "donut", which tells you more about the model's training data than about your render.

Install and notes

Install the pack once: ComfyUI Manager → search "ComfyUI-LexTools", or

cd ComfyUI/custom_nodes
git clone https://github.com/SOELexicon/ComfyUI-LexTools

then restart. transformers is the key dependency; the model auto-downloads from HuggingFace on first run, so expect a stall on image one.

The output is a string, which is the real constraint - there's no numeric output for filtering, so it's a display/log node, not a control-flow node. And like every node in this pack's niche classification family, the community footprint is essentially zero; the README and your own tests are the full documentation. Run it on a real photo of food first, so you know what a confident answer looks like before you trust it on a generated image.

CategoryLexTools/ImageProcessing/Classification

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (1)

NameTypeDescription
STRINGSTRING