Nodes/ComfyUI-Games/Checkers Game
ComfyUI Node

Checkers Game

Checkers vs a CPU that lives in your ComfyUI — the one game here with a brain

By GraftingRayman·Created 8 months ago·Updated 2 months ago· 0
Checkers Game
  • image
  • IMAGE

Most of ComfyUI-Games is pure reflex - twitch, dodge, don't die. The CheckersNode is the odd one out: it's a turn-based strategy game you play against an actual AI opponent, right on a canvas embedded in the node. No time pressure, no twitch, just you, red pieces, and a CPU that picks from three difficulty levels. It's the pack's thinking-man's entry, and the one you'll reach for when the render queue is long and you want something that doesn't punish blinking.

How it works: same pass-through trick, smarter game

The Python side is the pack's usual magician's act:

def play_checkers(self, image):
    return (image,)

The node takes an image tensor and returns it untouched. All the actual checkers - the board, the forced captures, the AI - lives in web/js/checkers.js, which extends ComfyUI so a canvas widget appears inside the node. The AI is real: three move-picker functions for easy, medium, and hard difficulties, wired to a difficulty setting you click through in the widget. The backend's only job, besides the pass-through, is the high-score route: /checkers/highscores reads and writes checkers_highscores.json in the pack folder.

And yes, the same two caveats apply. The game exists only in your browser - run the node headless and it's a no-op. And your input image does not become the board. If you were picturing your last great render as a checkerboard, let it go now; the node draws its own board and ignores the tensor entirely. The image input is a placeholder so the node has something to hang on in a graph.

Inputs and outputs

From the info_schema, it's the familiar two-fields shape:

  • Input: image (IMAGE, required) - passed through unchanged.
  • Output: IMAGE - identical tensor out.

Gameplay is pure click-to-move: click a piece, click a valid square, the CPU replies. Difficulty and any new-game options are handled inside the canvas widget, not in the node's ports. The only persistence is the win/loss high-score table written to checkers_highscores.json.

Installing ComfyUI-Games

One pack, six games, one install. In ComfyUI Manager search for ComfyUI-Games, or:

cd ComfyUI/custom_nodes
git clone https://github.com/GraftingRayman/ComfyUI-Games

Restart ComfyUI. There's no requirements.txt, no model downloads, and no extra Python beyond aiohttp, which ComfyUI already ships. For a custom node that's about as clean as it gets - nothing to break your environment.

Common issues

  • The output never changes. Right - it's a pass-through. The checkers game is in the widget, not the tensor.
  • High scores reset after an update. They're a plain JSON file inside custom_nodes/ComfyUI-Games/; a git pull can wipe them.
  • "The CPU is cheating." It's not - it's the hard difficulty. Play easy first.
  • Red "Node Loaded" lines at startup. One per game in the pack. Cosmetic noise.

If you've ever wanted to play a genuinely complete game while your GPU does the real work, this is the classiest entry in the pack - and the only one where you can blame a bad move on the model.

Categorygames

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE