ValyroUI English version

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';

Пропсы

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.

Похожие компоненты

  • 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 · Весь раздел «Изображения и генерация»