Erik W. 28436a0cbc Add CCW rotation and refine HUD
- add rotate_cw/rotate_ccw bindings and display updates in options/controls

- refine HUD layout/labels, borders, spacing, and correct lines_cleared output

- support customizable tetromino/background colors and background images in live UI
2026-01-02 22:29:44 -05:00
2026-01-02 18:52:01 -05:00
2026-01-02 22:29:44 -05:00
2026-01-02 17:12:55 -05:00
2026-01-02 17:27:27 -05:00
2026-01-02 19:02:53 -05:00
2026-01-02 22:29:44 -05:00
2026-01-02 22:29:44 -05:00

TetriNode

A ComfyUI custom node pack that embeds a playable Tetris game inside a node UI, with image outputs for the live board and next-piece preview.

Features

  • Live, playable Tetris inside the node UI
  • Board image output and next-piece image output
  • Score + lines-cleared tracking (not fully functional yet; current functionality is score = lines cleared)
  • Pause/Play and Reset controls
  • Seeded piece generation with a standard seed widget available
  • Optional keybinding configuration via TetriNode Options node

Nodes

TetriNode

Main gameplay node.

TetriNode node UI

Inputs

  • tetrinode_options (TETRINODE_OPTIONS): Custom keybindings for moving left/right, rotating the piece, dropping the piece, play/pause, and reset
  • seed (INT): Seed used for piece sequence
  • background_image (IMAGE, optional): Background image for the game board (scaled to cover, then center-cropped)

Outputs

  • image (IMAGE): current board
  • state (STRING): serialized game state
  • lines_cleared (INT)
  • score (INT)
  • next_piece (IMAGE): preview image

TetriNode Options

Optional node that provides keybindings.

TetriNode Options node UI

Inputs

  • move_left, move_right, rotate_cw, rotate_ccw, drop, reset, pause: Key bindings
  • color_i, color_j, color_l, color_o, color_s, color_t, color_z: Hex colors for each tetromino (e.g. #55D6FF)
  • background_color: Hex color for the board background (ignored when a background image is connected)

Outputs

  • tetrinode_options (TETRINODE_OPTIONS): Custom keybindings for moving left/right, rotating the piece, dropping the piece, play/pause, and reset

Controls (Default)

Displayed inside the node UI and reflected in the game input handler.

  • Move Left: A
  • Move Right: D
  • Rotate CW: W
  • Rotate CCW: Q
  • Drop: S
  • Reset: R
  • Pause: P

Installation

Installation (preferred)

Install via ComfyUI Manager. Search for "TetriNode" and click install. The node pack is also available on the Comfy Registry site by clicking here.

Installation (alternative)

  1. Copy this repository into ComfyUI/custom_nodes/TetriNode/.
  2. Restart ComfyUI.
  3. Add TetriNode and (optionally) TetriNode Options from the node list.

License

MIT

S
Description
No description provided
Readme MIT
10 MiB
Languages
JavaScript 82.3%
Python 17.7%