ValyroUI English version

Inpaint Canvas

Маска для инпейнтинга и расширение холста. Pro · Изображения и генерация › Результаты и правка

Установка

npx valyro-cli@latest login
npx valyro-cli@latest add inpaint-canvas
npm install valyro-ui-pro

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

Пропсы

PropTypeDefault
srcstringImage URL (needs CORS for export when cross-origin). Without it a procedural image is painted from prompt + seed.
promptstring''Prompt the procedural stand-in is painted from when there is no src.
seednumber0Seed of the procedural stand-in.
width *numberWorking size of the image in pixels.
height *numberWorking height of the image in pixels; the mask is exported at this size (plus any extension).
tool'brush' | 'eraser' | 'rectangle' | 'lasso' | 'pan'Controlled tool; use with onToolChange.
defaultTool'brush' | 'eraser' | 'rectangle' | 'lasso' | 'pan''brush'Initial tool when uncontrolled.
onToolChange(tool: InpaintTool) => voidCalled with the new tool when it changes.
brushInpaintBrushControlled brush; use with onBrushChange.
defaultBrushPartial<InpaintBrush>Initial brush when uncontrolled.
onBrushChange(brush: InpaintBrush) => voidCalled with the new brush when it changes.
maskColorstringControlled maskColor; use with onMaskColorChange.
defaultMaskColorstringInitial maskColor when uncontrolled.
onMaskColorChange(color: string) => voidCalled with the new maskColor when it changes.
maskColorsreadonly InpaintMaskColor[]DEFAULT_MASK_COLORSSwatches for the mask overlay color; the first is the initial color when none is given.
overlayOpacitynumber0.55Opacity of the mask overlay. Default 0.55.
outpaintbooleantrueEdge handles that extend the canvas. Default true.
extentExtentControlled extent; use with onExtentChange.
defaultExtentExtentNO_EXTENTInitial extent when uncontrolled.
onExtentChange(extent: Extent) => voidCalled with the new extent when it changes.
extendStepnumber64Snap of the extension. Default 64.
maxExtendnumber512Largest extension per side. Default 512.
initialMaskstringMask to start from, as an image URL (a saved mask or a data URL): white is regenerated, black is kept. Painted once for each image, scaled to it; needs CORS when cross-origin. Undo doesn't go before it.
onMaskChange(info: { empty: boolean }) => voidCalled after every committed edit: whether anything is masked or extended.
apiRefRef<InpaintCanvasApi>Receives the canvas handle: export the image and mask as PNGs, undo / redo, clear, invert, fit, isEmpty.
actionsReactNodeExtra controls at the end of the toolbar, e.g. a Generate button.
stageHeightnumber | stringHeight of the drawing area. By default clamp(320px, 60vh, 620px), but never taller than the image needs at the current width (so a phone shows no empty band around it).
localestringBCP 47 locale for numbers and dates; defaults to the ThemeProvider's, then the browser's.
labelsPartial<InpaintCanvasLabels>Overrides for the built-in English text; keys left out keep their defaults.

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

  • Generation Progress — Шаги, ETA, живое латентное превью, очередь
  • Image Result Grid — Галерея результатов, действия и лайтбокс
  • Image Compare — Сравнение до/после: шторка, рядом, наложение
  • Generation History — История генераций по дням с фильтрами
  • Image Adjustments — Цветокоррекция: загрузка, вписывание и семь ползунков с фильтром
  • Prompt Editor — Промпт и негатив: веса, LoRA, автодополнение, токены
  • Generation Settings — Модель, сэмплер, шаги, CFG, размер, пресеты
  • Aspect Ratio Picker — Соотношение сторон и точный размер
  • Seed Input — Сид: случайный, фиксированный, инкремент
  • LoRA Stack — Стек LoRA: силы, переключатели, порядок, триггеры
  • Style Presets — Карточки стилей с превью и весами
  • Reference Image Input — Референс для img2img и ControlNet

Назад: Image Compare · Далее: Generation History · Весь раздел «Изображения и генерация»