Skip to content
Sign upGet access
MicrointeractionsPrompt weightMenu

Prompt weight (Pro)

ProIncluded in $99

Weight words in an image prompt by feel: the word itself grows heavier and takes on colour.

ProPick a word and scroll, drag or use the arrows: it grows heavier and takes on colour as it gains weight, or thins and fades as it loses it, with its weight above it.

Pick a word and scroll, drag up or down, or use the arrow keys. The word grows heavier and takes on colour as it gains weight, or thins and fades as it loses it, pushing the words around it aside, with its weight above it. You can read the emphasis of the whole prompt at a glance, before you generate anything. Punctuation never takes weight.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/prompt-weight

Needs chatcn Pro

This command works with a Pro license, along with every Pro component.

Or start free: sign up and get three Pro components on us, with a new one every month.

Usage

tsx
import { PromptWeight, weightedPrompt } from "@/components/ui/chatcn/pro/prompt-weight"

<PromptWeight prompt={prompt} weights={weights} onWeightsChange={setWeights} />
generate(weightedPrompt(prompt, weights)) // "a (misty:1.4) cliff"

Props

PropTypeNotes
promptstring
weights / onWeightsChangeRecord<number, number>By word index; missing is 1
min / maxnumberDefault 0.5 and 1.6

Keyboard

KeyAction
Arrow Up / Arrow DownWeight the focused word by 0.1
Home / 0Back to 1

Accessibility

  • Each word is a slider with its weight as the value.

Motion

  • Size, weight and colour transition 200 ms. Reduced motion: they change at once.