Skip to content
Sign in
Image studioNode card setMenu

Node card setPro

Seven typed node cards for the node canvas (prompt, image, generate, upscale, mask, rewrite and output), each with live controls and its run state, plus the palette they are added from.

ProThe seven media node cards, all live, with the palette they are added from.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/node-card-set

Usage

tsx
import { NodeCanvas } from "@/components/ui/chatcn/pro/node-canvas"
import {
  createMediaNode,
  mediaNodeTypes,
  NodePalette,
} from "@/components/ui/chatcn/pro/node-card-set"

const nodes = [createMediaNode("prompt", { id: "p", x: 0, y: 0 })]

<NodePalette onAdd={(type) => add(type)} />
<NodeCanvas defaultNodes={nodes} nodeTypes={mediaNodeTypes} />

createMediaNode(type, { id, x, y, data }) returns a node with the type's ports and default data. mediaNodeTypes plugs the cards into NodeCanvas; NodeCard renders one card on its own, for side panels and docs. Every card writes its controls back to node.data, so your run code reads one object.

TypePortsData
promptText outtext
image-inputImage outsrc, alt, name, width, height; drop a file or choose one
modelPrompt, image and mask in; images outmodel, models, steps, guidance, seed (null for random), count
upscaleImage in and outfactor (2 or 4), incoming width and height for the result size
maskImage in, mask outmode: subject, background or brush; src for the preview
llmText in and outinstruction, model, output (streams while running)
outputImages in (several wires)images, count for placeholders, onSave

Examples

Run states

One vocabulary on every card: not run, queued, running with a percent or a step count, done with its time, cached and failed with the reason and Retry. Each state has a glyph and a word, never color alone.

ProEvery run state on one card, plus streaming text, waiting output and an empty image.

Props

PartPropsNotes
NodeCardnode, onNodeChange, selected, readOnlyOne card outside a canvas
NodePalettetypes, onAdd, disabled, labelClick or Enter adds; drag drops on a canvas
MEDIA_NODE_SPECSTitle, description, icon, ports and default data per type

Keyboard

KeyAction
TabThrough each card's controls in reading order
Arrows in a segmented controlChoose scale or mask mode
↑ ↓ in a number fieldStep the value (steps, guidance, seed, images)
Enter on a palette entryAdd that node

Accessibility

  • Every field has a visible label; segmented controls are native radio groups.
  • Run state is part of the card's name, and a failed card's reason is plain text next to its Retry button.
  • Rewrite output is announced once when it finishes, not per token. File names truncate in the middle of the name and keep their extension.

Motion

  • Cards hold still while you edit them. Results fade in over 200 ms once decoded; streamed text appends with the kit's caret and no per word effects.