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

Reference Image Input

Reference image for img2img and ControlNet. Pro · Image generation › Prompt and settings

img2img / ControlNet reference: drop, paste or upload, a preprocessor preview, and strength or weight.

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add reference-image-input
npm install valyro-ui-pro

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

Props

PropTypeDefault
valueReferenceImage | nullControlled value; use with onValueChange.
defaultValueReferenceImage | nullnullInitial value when uncontrolled.
onValueChange(image: ReferenceImage | null) => voidCalled with the new value when it changes.
mode'img2img' | 'controlnet''controlnet'img2img shows denoising strength; controlnet shows a preprocessor with preview and a weight.
preprocessor'none' | 'canny' | 'depth' | 'lineart' | 'softedge' | 'openpose'Controlled preprocessor; use with onPreprocessorChange.
defaultPreprocessor'none' | 'canny' | 'depth' | 'lineart' | 'softedge' | 'openpose''canny'Initial preprocessor when uncontrolled.
onPreprocessorChange(preprocessor: Preprocessor) => voidCalled with the new preprocessor when it changes.
preprocessorsreadonly Preprocessor[]ALL_PREPROCESSORSOffered preprocessors. Default: all.
strengthnumberimg2img denoising strength, 0–1.
defaultStrengthnumber0.6Initial strength when uncontrolled.
onStrengthChange(strength: number) => voidCalled with the new strength when it changes.
weightnumberControlNet weight, 0–2.
defaultWeightnumber1Initial weight when uncontrolled.
onWeightChange(weight: number) => voidCalled with the new weight when it changes.
acceptstring'image/*'File types for the picker, paste and drop. Default image/*.
size'sm' | 'md''md'sm has a shorter drop zone and a smaller, muted title.
disabledbooleanfalseIgnores picking, paste and drop, and disables Replace, Remove, the preprocessor and the sliders.
localestringBCP 47 locale for numbers and dates; defaults to the ThemeProvider's, then the browser's.
labelsPartial<ReferenceImageInputLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Style Presets · Next: Generation Progress · All Image generation