Prompt Editor
Промпт и негатив: веса, LoRA, автодополнение, токены. Pro · Изображения и генерация › Промпт и параметры
Установка
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';
Пропсы
| Prop | Type | Default | |
|---|---|---|---|
value | string | Positive prompt. | |
defaultValue | string | '' | Initial value when uncontrolled. |
onValueChange | (value: string) => void | Called with the new value when it changes. | |
negativeValue | string | Controlled negativeValue; use with onNegativeValueChange. | |
defaultNegativeValue | string | '' | Initial negativeValue when uncontrolled. |
onNegativeValueChange | (value: string) => void | Called with the new negativeValue when it changes. | |
negative | boolean | true | Show the negative prompt field. Default true. |
tags | readonly PromptTag[] | [] | Autocomplete source: tags, LoRA names (kind: 'lora', typed as <lora:) and embeddings (embedding:). |
loraWeight | number | 1 | Strength written into completed <lora:name:w> tags. Default 1. |
history | readonly 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) => void | Ctrl/Cmd+Enter in either field. | |
weightStep | number | 0.1 | Ctrl/Cmd+↑/↓ step for (text:w). Default 0.1. |
networkStep | number | 0.05 | Ctrl/Cmd+↑/↓ step for <lora:name:w>. Default 0.05. |
chunkSize | number | 75 | CLIP chunk length. Default 75. |
countTokens | (text: string) => number | Exact 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. |
minRows | number | Visible rows of the positive field before it grows. Default 3 (2 when sm). | |
maxRows | number | 10 | Rows after which the field scrolls. Default 10. |
hideLabels | boolean | false | Keep the field labels for screen readers only. |
showHint | boolean | Show the weight shortcut hint. Default true for md. | |
disabled | boolean | false | Disables both fields, autocomplete, History and Enhance. |
toolbar | ReactNode | Extra controls next to History and Enhance. | |
name | string | Form field names. | |
negativeName | string | Form field name of the negative prompt. | |
autoFocus | boolean | Focus the positive field on mount. | |
locale | string | BCP 47 locale for numbers and dates; defaults to the ThemeProvider's, then the browser's. | |
labels | Partial<PromptEditorLabels> | Overrides for the built-in English text; keys left out keep their defaults. |
Похожие компоненты
- Generation Settings — Модель, сэмплер, шаги, CFG, размер, пресеты
- Aspect Ratio Picker — Соотношение сторон и точный размер
- Seed Input — Сид: случайный, фиксированный, инкремент
- LoRA Stack — Стек LoRA: силы, переключатели, порядок, триггеры
- Style Presets — Карточки стилей с превью и весами
- Reference Image Input — Референс для img2img и ControlNet
- Generation Progress — Шаги, ETA, живое латентное превью, очередь
- Image Result Grid — Галерея результатов, действия и лайтбокс
- Image Compare — Сравнение до/после: шторка, рядом, наложение
- Inpaint Canvas — Маска для инпейнтинга и расширение холста
- Generation History — История генераций по дням с фильтрами
- Image Adjustments — Цветокоррекция: загрузка, вписывание и семь ползунков с фильтром
Назад: Context Budget Meter · Далее: Generation Settings · Весь раздел «Изображения и генерация»