Nodes/Chess-Manager/Chess Piece Prompt
ComfyUI Node

Chess Piece Prompt

A fun idea whose IMAGE output crashes as shipped

By owenreilly·Created 2 years ago·Updated 2 years ago· 0
Chess Piece Prompt
    • prompt
    • image
    piece
    color

    Pick a chess piece, pick a side, and this node hands you a ready-to-use prompt describing that piece as a human wearing a chess costume - plus a bundled reference image of the actual piece so you can pin the composition to something real. That's the whole pitch for a "human chess set" shoot in a single node, and it's exactly why you'd reach for it. Then you run it and it crashes. We'll get to that, because knowing what's broken is most of the value here.

    How it works

    Under the hood it's a hardcoded dictionary. Choose piece and color, and the node looks up a pre-written prompt in classic weighted syntax - things like (realistic:2), (human-like:1.4), (wearing a chess costume:1.3). Every piece gets the same skeleton with a different item swapped in: the King holds a sword, the Knight rides a horse, the Rook gets armour. There's a fun authorial quirk: white pieces get a blue cape and black pieces get a red one. That's not chess convention, it's just the author's choice, but it's consistent across all six pieces.

    The image half loads a bundled 720px PNG from the pack's whiteImages/blackImages folders through PIL → numpy → torch and returns it as an IMAGE tensor, ready to feed into a ControlNet or IPAdapter for pose and framing. The prompt even ends with (pose matching reference image:1.3), so that's clearly the intended graph: prompt into the text encoder, image into the reference stack.

    The inputs and outputs that matter

    Only two inputs, both dropdowns:

    • piece - King, Queen, Bishop, Knight, Rook, or Pawn.
    • color - white or black. This picks both the cape color in the prompt and which reference photo gets loaded.

    Outputs: prompt (STRING) and image (IMAGE). Wire the STRING into a CLIP Text Encode and the IMAGE into your ControlNet/IPAdapter prep nodes.

    The catch: the IMAGE output is broken

    As shipped, running this node throws an error every time, and it takes the prompt down with it. In load_image the author tried to overwrite the tensor's shape directly:

    image_tensor.shape = image_array.shape
    

    PyTorch doesn't allow that. I verified it against a real torch install: you get AttributeError: attribute 'shape' of 'torch._C.TensorBase' objects is not writable. And because load_image runs before the return, the STRING output never makes it either - the whole node dies on its first execution. That's the classic "single-commit repo, README empty, never actually ran it" signature, and this pack wears it proudly.

    The fix is one line. The permute(2, 0, 1).unsqueeze(0) already produces the (1, 3, H, W) layout ComfyUI expects, so just delete the shape assignment and the node works as intended.

    The other caveat: the prompt is CLIP-era

    That weighted syntax - (word:1.3) - only means anything to CLIP-encoded models: SD 1.5, SDXL, Pony, Illustrious, NoobAI. On Flux and other LLM-encoded checkpoints the weights are passed to the encoder as literal punctuation, which is worse than not having them. If you're on a 2026-era model, strip the (word:number) markers and rewrite the prompt as plain prose; the content ("human wearing a chess costume, cape, realistic") survives fine. Also note (realistic:2) sits above the practical 0.5–1.5 weighting sweet spot, so even on SDXL expect it to lean hot.

    Install

    The repo is literally named test, so in ComfyUI Manager search "test" or "Chess-Manager" (the display name). Or the old-school way:

    cd ComfyUI/custom_nodes
    git clone https://github.com/owenreilly/test
    

    Restart ComfyUI. No model downloads - the reference images ship inside the repo. One dependency gotcha: the pack's pyproject.toml declares GitPython, PyGithub, matrix-client, transformers, typer, and rich, but none of those are imported anywhere. The node only needs numpy, torch, and Pillow, all of which ComfyUI already has. If Manager offers to install the extras, let it or skip it - transformers is heavy and genuinely unused.

    Bottom line: a charming idea from an abandoned test repo. Don't expect support or updates. But if the human-chess-set workflow appeals to you, patch the one line and the prompt generator is actually pretty good.

    CategoryChess

    Inputs (2)

    NameTypeDefaultDescription
    pieceCOMBO6 options: King, Queen, Bishop, Knight, Rook, Pawn
    colorCOMBO2 options: white, black

    Outputs (2)

    NameTypeDescription
    promptSTRING
    imageIMAGE