Nodes/ComfyUI-LexTools/ImageRankingNode
ComfyUI Node

ImageRankingNode

Keep a running leaderboard of your best images

By SOELexicon·Created 3 years ago·Updated about a year ago· 33
ImageRankingNode
      score
      prompt
      image_path
      json_file_path

      If you've ever generated a hundred variants of the same prompt and wished you'd kept a list of which ones scored best, ImageRankingNode is that list. It takes an image's score, the prompt that produced it, and a file path - and records the entry to a JSON ranking file on disk. It's the "save this to the leaderboard" node in a scoring pipeline, not a node that pipes pixels around.

      Here's the setup it's made for. You're batch-generating with varying prompts, seeds, or settings. For each output you compute a quality score - using this pack's own ImageQualityScoreNode, an aesthetic score, or anything else that produces a number. You also know the prompt you used and where the image file lives. ImageRankingNode bundles those four facts into one entry and appends it to a JSON file. After the run, you open the JSON, sort by score, and you have a ranked leaderboard of the whole batch with the prompt that made each winner. No more reconstructing "which prompt made the good one" from memory.

      How it works

      It's a bookkeeping node with no model behind it. Every input is a value you already have:

      • score (INT) - your quality number for this image.
      • prompt (STRING) - the prompt text that generated it, so the leaderboard is self-documenting.
      • image_path (STRING) - where the image file lives, so you can jump to it from the JSON.
      • json_file_path (STRING) - the JSON file to append to. Point the whole batch at one file and you build the ranking as you go.

      The notable thing in the schema: it has no output wires. This is a terminal node - it does its work on disk and stops. If you build it expecting an IMAGE or a score to come out the other side, nothing will, and that's not a bug. Everything this node knows flows into the JSON file.

      Where it fits

      This is the last node in a scoring chain: Generate → score → scale → ImageRankingNode. It pairs naturally with the rest of the LexTools scoring family. The workflow isn't glamorous, but it beats screenshotting your outputs folder and trying to remember which variant was which. Think of it as the poor man's experiment tracker - and for prompt-sweep runs, that's genuinely useful.

      The honest caveat: the ranking lives in JSON, so you're expected to read it somewhere else (a text viewer, a spreadsheet, a small script). There's no built-in "show me the top ten" panel. And because it's path-based rather than image-batch-based, it assumes your workflow is saving files with known paths - feed it an unsaved image and you'll have nothing to record.

      Install and notes

      Same install as the whole pack, once: ComfyUI Manager → search "ComfyUI-LexTools", or git clone https://github.com/SOELexicon/ComfyUI-LexTools into custom_nodes and restart. No models, no heavy dependencies - it's pure Python file I/O.

      Two things worth knowing. First, the node appends entries, so if you rerun a batch you'll get duplicate rows in the JSON unless you clear the file first. Second, the LexTools ecosystem is a niche thing with a thin community footprint - there's exactly one thread about this pack's scoring on r/comfyui, so you're mostly on your own for edge cases. The good news is the behavior is simple enough that reading the JSON after one run tells you everything about how it works.

      CategoryLexTools/ImageProcessing/Ranking

      Inputs (4)

      NameTypeDefaultDescription
      scoreINT
      promptSTRING
      image_pathSTRING
      json_file_pathSTRING

      Outputs (0)

      No outputs