ValyroUI Русская версия

Prompt Editor

Prompt and negative prompt: weights, LoRA, autocomplete, token count. Pro · Image generation › Prompt and settings

Positive + negative prompt with weight highlighting, Ctrl+↑/↓ weights, tag autocomplete and a token counter.

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add prompt-editor
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { PromptEditor } from 'valyro-ui-pro';

Props

PropTypeDefault
valuestringPositive prompt.
defaultValuestring''Initial value when uncontrolled.
onValueChange(value: string) => voidCalled with the new value when it changes.
negativeValuestringControlled negativeValue; use with onNegativeValueChange.
defaultNegativeValuestring''Initial negativeValue when uncontrolled.
onNegativeValueChange(value: string) => voidCalled with the new negativeValue when it changes.
negativebooleantrueShow the negative prompt field. Default true.
tagsreadonly PromptTag[][]Autocomplete source: tags, LoRA names (kind: 'lora', typed as <lora:) and embeddings (embedding:).
loraWeightnumber1Strength written into completed <lora:name:w> tags. Default 1.
historyreadonly string[][]Previous prompts, most recent first; choosing one replaces the positive prompt.
onEnhance(prompt: string) => Promise<string>Rewrites the prompt (e.g. with an LLM); the editor shows a spinner while the promise is pending.
onSubmit(value: PromptValue) => voidCtrl/Cmd+Enter in either field.
weightStepnumber0.1Ctrl/Cmd+↑/↓ step for (text:w). Default 0.1.
networkStepnumber0.05Ctrl/Cmd+↑/↓ step for <lora:name:w>. Default 0.05.
chunkSizenumber75CLIP chunk length. Default 75.
countTokens(text: string) => numberExact tokenizer; the built-in count is a close heuristic.
size'sm' | 'md''md'sm is dense, e.g. inside a node of a graph editor.
minRowsnumberVisible rows of the positive field before it grows. Default 3 (2 when sm).
maxRowsnumber10Rows after which the field scrolls. Default 10.
hideLabelsbooleanfalseKeep the field labels for screen readers only.
showHintbooleanShow the weight shortcut hint. Default true for md.
disabledbooleanfalseDisables both fields, autocomplete, History and Enhance.
toolbarReactNodeExtra controls next to History and Enhance.
namestringForm field names.
negativeNamestringForm field name of the negative prompt.
autoFocusbooleanFocus the positive field on mount.
localestringBCP 47 locale for numbers and dates; defaults to the ThemeProvider's, then the browser's.
labelsPartial<PromptEditorLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Context Budget Meter · Next: Generation Settings · All Image generation