ComfyUI Node

Play Snake Game

The ComfyUI Node That Plays Snake (and Does Absolutely Nothing Else)

By IIs-fanta·Created about a year ago·Updated about a year ago· 1
Play Snake Game

      Yes, this is a playable Snake game rendered inside a ComfyUI node. No tensor in, no tensor out, no model loaded, no sampler involved. SnakeGameNode is one of four arcade games shipped in the ComfyUI-FANTA-GameBox pack by IIs-fanta (alongside Flappy Bird, Brick Breaker, and Billiards). Its entire job is to give you something to do with the two or three minutes a chunky Flux or video render ties up your machine - you could alt-tab to a browser tab like a normal person, but where's the flex in that? This is the node you reach for when you want a living, breathing game sitting on your canvas as a conversation piece, or a genuinely fun time-killer for the wait.

      How it works: the Python side is a stub

      Look inside the source and the honesty is refreshing. The node's INPUT_TYPES are empty, RETURN_TYPES is an empty tuple, and the Python method is a placeholder that does nothing but return (). The class docstring says it plainly: it's a container for a JS widget. All the actual game logic - the snake, the food, the collision detection, the 150ms game loop - lives in js/snake_widget.js, which registers a ComfyUI frontend extension and injects a canvas, a score readout, and an on-screen D-pad into the node's body.

      That architecture is the reason this node is about as low-risk as a custom node gets. The ComfyUI ecosystem's dirty secret is that every custom node runs arbitrary Python on import - that's how a pack like LLMVISION shipped malware and got someone prosecuted. A game node like this one has no Python worth running, no requirements.txt, no model files, no API calls, and no keys. It's a canvas and a setInterval. If you're paranoid about what you install from GitHub, this is the safest category you could pick.

      Inputs and outputs: none, deliberately

      info_schema confirms it: required is empty, optional is empty, outputs is an empty list. You can't wire anything in, and it can't feed anything downstream. It's marked as an output node only so it can sit on the canvas on its own without dangling wires. A Snake game in a diffusion graph isn't a pipeline stage - it's a UI toy. Don't go hunting for a hidden "score to prompt" connection; there isn't one.

      Controls

      The README and the widget agree on the controls, and they're the classic ones:

      • Arrow keys (or the on-screen ↑↓←→ buttons) to steer
      • Space to pause/resume
      • Enter to restart
      • Click the canvas to start

      The score shows under the canvas, and since the canvas scales with the node, drag the node bigger if you want a bigger board.

      Installing it

      The pack installs like any custom node, and it's a light one:

      cd ComfyUI/custom_nodes
      git clone https://github.com/IIs-fanta/ComfyUI-SnakeGameNode
      

      Then restart ComfyUI and you'll find it under the "fun" (Games) category. Or use ComfyUI Manager and search "FANTA GameBox" - that's the pack's display title. One heads-up: the README's own clone command points at a stale URL (ComfyUI-aki-v1.6/ComfyUI-FANTA-GameBox.git). Use the repo above instead; the README rotted. There are no Python dependencies to install and no models to download, so if the node doesn't show up, it's almost always a stale frontend cache rather than a broken install.

      Gotchas worth knowing

      • Your score is not saved. The README claims "game state is automatically saved," but the widget is registered with serialize = false, which means the game is not part of your workflow JSON. Save the workflow, reload the page, and you're back to zero. Treat it as browser-session-only fun.
      • Frontend updates can break it. This widget hooks straight into ComfyUI's frontend, and upstream has been rewriting that frontend aggressively (the Nodes 2.0 saga broke plenty of packs). If Snake stops appearing after a ComfyUI update, that's the ecosystem-wide hazard, not just this pack.
      • You're early. This pack barely exists in the community - one self-promotion thread and that's about it. If you hit a bug, you're likely the first person to ever report it.
      Categoryfun

      Inputs (0)

      No inputs

      Outputs (0)

      No outputs