diff --git a/gui/src/api/client.ts b/gui/src/api/client.ts index 76524a448..8c15e7f56 100644 --- a/gui/src/api/client.ts +++ b/gui/src/api/client.ts @@ -26,6 +26,7 @@ export interface BaseImgParams { export interface Img2ImgParams extends BaseImgParams { source: File; + strength: number; } export type Img2ImgResponse = Required>; diff --git a/gui/src/components/Img2Img.tsx b/gui/src/components/Img2Img.tsx index 61e8297a6..09129942d 100644 --- a/gui/src/components/Img2Img.tsx +++ b/gui/src/components/Img2Img.tsx @@ -9,6 +9,7 @@ import { SCHEDULER_LABELS } from '../strings.js'; import { ImageCard } from './ImageCard.js'; import { ImageControl } from './ImageControl.js'; import { MutationHistory } from './MutationHistory.js'; +import { NumericField } from './NumericField.js'; import { QueryList } from './QueryList.js'; const { useState } = React; @@ -31,6 +32,7 @@ export function Img2Img(props: Img2ImgProps) { model, platform, scheduler, + strength, source: mustExist(source), // TODO: show an error if this doesn't exist }); } @@ -50,6 +52,7 @@ export function Img2Img(props: Img2ImgProps) { }); const [source, setSource] = useState(); + const [strength, setStrength] = useState(0.5); const [params, setParams] = useState({ cfg: 6, seed: -1, @@ -76,6 +79,16 @@ export function Img2Img(props: Img2ImgProps) { { setParams(newParams); }} /> + { + setStrength(value); + }} + /> a.output === b.output} diff --git a/gui/src/components/NumericField.tsx b/gui/src/components/NumericField.tsx index ffe13f5af..d089a499e 100644 --- a/gui/src/components/NumericField.tsx +++ b/gui/src/components/NumericField.tsx @@ -6,7 +6,7 @@ export interface ImageControlProps { label: string; min: number; max: number; - step: number; + step: number | 'any'; value: number; onChange?: (value: number) => void;