From f30c5f2d318ecc7b72d6e17bfe94e2ee735b01b2 Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Fri, 12 Jan 2024 19:01:15 -0600 Subject: [PATCH] clean up horizontal layout styles, use constants for spacing --- gui/src/client/api.ts | 18 +---- gui/src/components/ImageHistory.tsx | 7 +- gui/src/components/LoadingScreen.tsx | 4 +- gui/src/components/OnnxError.tsx | 7 +- gui/src/components/OnnxWeb.tsx | 79 ++++++------------- gui/src/components/Profiles.tsx | 17 ++-- gui/src/components/card/ErrorCard.tsx | 5 +- gui/src/components/card/ImageCard.tsx | 4 +- gui/src/components/card/LoadingCard.tsx | 4 +- gui/src/components/control/ImageControl.tsx | 4 +- gui/src/components/control/ModelControl.tsx | 6 +- .../components/control/VariableControl.tsx | 9 ++- gui/src/components/error/ParamsVersion.tsx | 2 +- gui/src/components/input/EditableList.tsx | 5 +- gui/src/components/input/ImageInput.tsx | 4 +- gui/src/components/input/MaskCanvas.tsx | 8 +- gui/src/components/input/NumericField.tsx | 4 +- gui/src/components/input/PromptInput.tsx | 10 +-- .../input/model/CorrectionModel.tsx | 3 +- .../components/input/model/DiffusionModel.tsx | 3 +- .../components/input/model/ExtraNetwork.tsx | 3 +- .../components/input/model/ExtraSource.tsx | 3 +- .../components/input/model/UpscalingModel.tsx | 3 +- gui/src/components/main.css | 7 +- gui/src/components/tab/Blend.tsx | 5 +- gui/src/components/tab/Img2Img.tsx | 8 +- gui/src/components/tab/Inpaint.tsx | 10 +-- gui/src/components/tab/Models.tsx | 8 +- gui/src/components/tab/Settings.tsx | 9 ++- gui/src/components/tab/Txt2Img.tsx | 5 +- gui/src/components/tab/Upscale.tsx | 6 +- gui/src/config.ts | 9 +-- gui/src/constants.ts | 64 +++++++++++++++ gui/src/main.tsx | 5 +- gui/src/state/history.ts | 8 +- gui/src/types/api-v2.ts | 15 ++-- gui/src/types/api.ts | 54 +------------ 37 files changed, 205 insertions(+), 220 deletions(-) diff --git a/gui/src/client/api.ts b/gui/src/client/api.ts index 5aa929d9..ccd1a11a 100644 --- a/gui/src/client/api.ts +++ b/gui/src/client/api.ts @@ -2,6 +2,8 @@ import { doesExist, InvalidArgumentError, Maybe } from '@apextoaster/js-utils'; import { ServerParams } from '../config.js'; +import { FIXED_FLOAT, FIXED_INTEGER, STATUS_SUCCESS } from '../constants.js'; +import { JobResponse, JobResponseWithRetry, SuccessJobResponse } from '../types/api-v2.js'; import { FilterResponse, ModelResponse, @@ -24,22 +26,6 @@ import { } from '../types/params.js'; import { range } from '../utils.js'; import { ApiClient } from './base.js'; -import { JobResponse, JobResponseWithRetry, SuccessJobResponse } from '../types/api-v2.js'; - -/** - * Fixed precision for integer parameters. - */ -export const FIXED_INTEGER = 0; - -/** - * Fixed precision for float parameters. - * - * The GUI limits the input steps based on the server parameters, but this does limit - * the maximum precision that can be sent back to the server, and may have to be - * increased in the future. - */ -export const FIXED_FLOAT = 2; -export const STATUS_SUCCESS = 200; export function equalResponse(a: JobResponse, b: JobResponse): boolean { return a.name === b.name; diff --git a/gui/src/components/ImageHistory.tsx b/gui/src/components/ImageHistory.tsx index 648dffce..1793923a 100644 --- a/gui/src/components/ImageHistory.tsx +++ b/gui/src/components/ImageHistory.tsx @@ -1,16 +1,17 @@ import { mustExist } from '@apextoaster/js-utils'; import { Grid, Typography } from '@mui/material'; -import { ReactNode, useContext } from 'react'; import * as React from 'react'; +import { ReactNode, useContext } from 'react'; import { useTranslation } from 'react-i18next'; import { useStore } from 'zustand'; import { shallow } from 'zustand/shallow'; +import { STANDARD_SPACING } from '../constants.js'; import { OnnxState, StateContext } from '../state/full.js'; +import { JobStatus } from '../types/api-v2.js'; import { ErrorCard } from './card/ErrorCard.js'; import { ImageCard } from './card/ImageCard.js'; import { LoadingCard } from './card/LoadingCard.js'; -import { JobStatus } from '../types/api-v2.js'; export interface ImageHistoryProps { width: number; @@ -50,7 +51,7 @@ export function ImageHistory(props: ImageHistoryProps) { return { // eslint-disable-next-line @typescript-eslint/no-magic-numbers children.map(([key, child]) => {child}) diff --git a/gui/src/components/LoadingScreen.tsx b/gui/src/components/LoadingScreen.tsx index 8f41df30..b26a41dd 100644 --- a/gui/src/components/LoadingScreen.tsx +++ b/gui/src/components/LoadingScreen.tsx @@ -2,6 +2,8 @@ import { Box, CircularProgress, Stack, Typography } from '@mui/material'; import * as React from 'react'; import { useTranslation } from 'react-i18next'; +import { STANDARD_SPACING } from '../constants'; + export function LoadingScreen() { const { t } = useTranslation(); @@ -13,7 +15,7 @@ export function LoadingScreen() { }}> diff --git a/gui/src/components/OnnxError.tsx b/gui/src/components/OnnxError.tsx index 7e0cbe00..916c7f6b 100644 --- a/gui/src/components/OnnxError.tsx +++ b/gui/src/components/OnnxError.tsx @@ -2,6 +2,7 @@ import { Box, Button, Container, Stack, Typography } from '@mui/material'; import * as React from 'react'; import { ReactNode } from 'react'; +import { STANDARD_MARGIN, STANDARD_SPACING } from '../constants.js'; import { STATE_KEY } from '../state/full.js'; import { Logo } from './Logo.js'; @@ -20,11 +21,11 @@ export function OnnxError(props: OnnxErrorProps) { return ( - + - - + + {props.children} This is a web UI for running ONNX models with GPU acceleration or in software, running locally or on a diff --git a/gui/src/components/OnnxWeb.tsx b/gui/src/components/OnnxWeb.tsx index af108ea2..387bbc39 100644 --- a/gui/src/components/OnnxWeb.tsx +++ b/gui/src/components/OnnxWeb.tsx @@ -1,15 +1,14 @@ -/* eslint-disable @typescript-eslint/no-magic-numbers */ import { mustExist } from '@apextoaster/js-utils'; import { TabContext, TabList, TabPanel } from '@mui/lab'; import { Box, Container, CssBaseline, Divider, Stack, Tab, useMediaQuery } from '@mui/material'; -import { Breakpoint, SxProps, Theme, ThemeProvider, createTheme } from '@mui/material/styles'; +import { SxProps, Theme, ThemeProvider, createTheme } from '@mui/material/styles'; import { Allotment } from 'allotment'; import * as React from 'react'; import { useContext, useMemo } from 'react'; import { useHash } from 'react-use/lib/useHash'; import { useStore } from 'zustand'; -import { shallow } from 'zustand/shallow'; +import { LAYOUT_MIN, LAYOUT_PROPORTIONS, LAYOUT_STYLES, STANDARD_MARGIN, STANDARD_SPACING } from '../constants.js'; import { Motd } from '../Motd.js'; import { OnnxState, StateContext } from '../state/full.js'; import { Layout } from '../state/settings.js'; @@ -36,7 +35,10 @@ export function OnnxWeb(props: OnnxWebProps) { const prefersDarkMode = useMediaQuery('(prefers-color-scheme: dark)'); const store = mustExist(useContext(StateContext)); const stateTheme = useStore(store, selectTheme); - const layout = useStore(store, selectLayout, shallow); + const historyWidth = useStore(store, selectHistoryWidth); + const direction = useStore(store, selectDirection); + + const layout = LAYOUT_STYLES[direction]; const theme = useMemo( () => createTheme({ @@ -47,17 +49,17 @@ export function OnnxWeb(props: OnnxWebProps) { [prefersDarkMode, stateTheme], ); - const historyStyle: SxProps = LAYOUT_STYLES[layout.direction].history.style; + const historyStyle: SxProps = layout.history.style; return ( - - + + {props.motd && } - {renderBody(layout, historyStyle)} + {renderBody(direction, historyStyle, historyWidth)} ); @@ -67,52 +69,19 @@ export function selectTheme(state: OnnxState) { return state.theme; } -export function selectLayout(state: OnnxState) { - return { - direction: state.layout, - width: state.historyWidth, - }; +export function selectDirection(state: OnnxState) { + return state.layout; } -export const LAYOUT_STYLES = { - horizontal: { - container: false, - control: { - width: '30%', - }, - direction: 'row', - divider: 'vertical', - history: { - style: { - marginLeft: 4, - maxHeight: '85vb', - overflowY: 'auto', - }, - width: 4, - }, - }, - vertical: { - container: 'lg' as Breakpoint, - control: { - width: undefined, - }, - direction: 'column', - divider: 'horizontal', - history: { - style: { - mx: 4, - my: 4, - }, - width: 2, - }, - }, -} as const; +export function selectHistoryWidth(state: OnnxState) { + return state.historyWidth; +} -function renderBody(layout: ReturnType, historyStyle: SxProps) { - if (layout.direction === 'vertical') { - return ; +function renderBody(direction: Layout, historyStyle: SxProps, historyWidth: number) { + if (direction === 'vertical') { + return ; } else { - return ; + return ; } } @@ -126,9 +95,9 @@ export interface BodyProps { export function HorizontalBody(props: BodyProps) { const layout = LAYOUT_STYLES[props.direction]; - return + return - + ; @@ -137,10 +106,10 @@ export function HorizontalBody(props: BodyProps) { export function VerticalBody(props: BodyProps) { const layout = LAYOUT_STYLES[props.direction]; - return + return - + ; @@ -155,7 +124,7 @@ export function TabGroup(props: TabGroupProps) { const [hash, setHash] = useHash(); - return + return { diff --git a/gui/src/components/Profiles.tsx b/gui/src/components/Profiles.tsx index 0cf839c3..e3df025a 100644 --- a/gui/src/components/Profiles.tsx +++ b/gui/src/components/Profiles.tsx @@ -21,12 +21,15 @@ import { useTranslation } from 'react-i18next'; import { useStore } from 'zustand'; import { shallow } from 'zustand/shallow'; +import { STANDARD_SPACING } from '../constants.js'; import { OnnxState, StateContext } from '../state/full.js'; -import { ImageMetadata } from '../types/api.js'; +import { AnyImageMetadata } from '../types/api-v2.js'; import { DeepPartial } from '../types/model.js'; import { BaseImgParams, HighresParams, ModelParams, Txt2ImgParams, UpscaleParams } from '../types/params.js'; import { downloadAsJson } from '../utils.js'; +export type PartialImageMetadata = DeepPartial; + export const ALLOWED_EXTENSIONS = ['.json','.jpg','.jpeg','.png','.txt','.webp']; export const EXTENSION_FILTER = ALLOWED_EXTENSIONS.join(','); @@ -51,7 +54,7 @@ export function Profiles(props: ProfilesProps) { const [profileName, setProfileName] = useState(''); const { t } = useTranslation(); - return + return > { +export async function loadParamsFromFile(file: File): Promise { const parts = file.name.toLocaleLowerCase().split('.'); const ext = parts[parts.length - 1]; @@ -211,7 +214,7 @@ export async function loadParamsFromFile(file: File): Promise> { +export async function parseImageParams(file: File): Promise { const tags = await ExifReader.load(file); // some parsers expect uppercase, some use lowercase, read both @@ -251,8 +254,8 @@ export function decodeTag(tag: Maybe> { - const data = JSON.parse(json) as DeepPartial; +export async function parseJSONParams(json: string): Promise { + const data = JSON.parse(json) as PartialImageMetadata; const params: Partial = { ...data.params, }; @@ -276,7 +279,7 @@ export function isProbablyJSON(maybeJSON: unknown): boolean { export const NEGATIVE_PROMPT_TAG = 'Negative prompt:'; -export async function parseAutoComment(comment: string): Promise> { +export async function parseAutoComment(comment: string): Promise { if (isProbablyJSON(comment)) { return parseJSONParams(comment); } diff --git a/gui/src/components/card/ErrorCard.tsx b/gui/src/components/card/ErrorCard.tsx index eee27f3a..cc82d97e 100644 --- a/gui/src/components/card/ErrorCard.tsx +++ b/gui/src/components/card/ErrorCard.tsx @@ -11,6 +11,7 @@ import { shallow } from 'zustand/shallow'; import { ClientContext, ConfigContext, OnnxState, StateContext } from '../../state/full.js'; import { FailedJobResponse, JobStatus, RetryParams, UnknownJobResponse } from '../../types/api-v2.js'; +import { STANDARD_SPACING } from '../../constants.js'; export interface ErrorCardProps { image: FailedJobResponse | UnknownJobResponse; @@ -48,7 +49,7 @@ export function ErrorCard(props: ErrorCardProps) { }}> @@ -56,7 +57,7 @@ export function ErrorCard(props: ErrorCardProps) {
{t(getImageErrorReason(image))}
- + retry.mutate()}> diff --git a/gui/src/components/card/ImageCard.tsx b/gui/src/components/card/ImageCard.tsx index 249f6c6f..8a431cb2 100644 --- a/gui/src/components/card/ImageCard.tsx +++ b/gui/src/components/card/ImageCard.tsx @@ -10,7 +10,7 @@ import { shallow } from 'zustand/shallow'; import { ClientContext, ConfigContext, OnnxState, StateContext } from '../../state/full.js'; import { range, visibleIndex } from '../../utils.js'; -import { BLEND_SOURCES } from '../../constants.js'; +import { BLEND_SOURCES, STANDARD_SPACING } from '../../constants.js'; import { JobResponse, SuccessJobResponse } from '../../types/api-v2.js'; export interface ImageCardProps { @@ -120,7 +120,7 @@ export function ImageCard(props: ImageCardProps) { /> - + { diff --git a/gui/src/components/card/LoadingCard.tsx b/gui/src/components/card/LoadingCard.tsx index e3383d0c..51c512d0 100644 --- a/gui/src/components/card/LoadingCard.tsx +++ b/gui/src/components/card/LoadingCard.tsx @@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next'; import { useStore } from 'zustand'; import { shallow } from 'zustand/shallow'; -import { POLL_TIME } from '../../config.js'; +import { POLL_TIME, STANDARD_SPACING } from '../../constants.js'; import { ClientContext, ConfigContext, OnnxState, StateContext } from '../../state/full.js'; import { JobResponse, JobStatus } from '../../types/api-v2.js'; import { visibleIndex } from '../../utils.js'; @@ -71,7 +71,7 @@ export function LoadingCard(props: LoadingCardProps) { }}> {renderProgress()} diff --git a/gui/src/components/control/ImageControl.tsx b/gui/src/components/control/ImageControl.tsx index c0faa7b5..4d55cf4c 100644 --- a/gui/src/components/control/ImageControl.tsx +++ b/gui/src/components/control/ImageControl.tsx @@ -10,7 +10,7 @@ import { useTranslation } from 'react-i18next'; import { useStore } from 'zustand'; import { shallow } from 'zustand/shallow'; -import { STALE_TIME } from '../../config.js'; +import { STALE_TIME, STANDARD_SPACING } from '../../constants.js'; import { ClientContext, ConfigContext, OnnxState, StateContext } from '../../state/full.js'; import { BaseImgParams } from '../../types/params.js'; import { NumericField } from '../input/NumericField.js'; @@ -46,7 +46,7 @@ export function ImageControl(props: ImageControlProps) { staleTime: STALE_TIME, }); - return + return + return PipelineGrid; @@ -20,7 +21,7 @@ export function VariableControl(props: VariableControlProps) { const grid = useStore(store, props.selectGrid); const stack = [ - + + Columns props.setGrid({ @@ -78,7 +79,7 @@ export function VariableControl(props: VariableControlProps) { ); } - return {...stack}; + return {...stack}; } export function parameterList(exclude?: Array) { diff --git a/gui/src/components/error/ParamsVersion.tsx b/gui/src/components/error/ParamsVersion.tsx index bb141af0..bc5df7eb 100644 --- a/gui/src/components/error/ParamsVersion.tsx +++ b/gui/src/components/error/ParamsVersion.tsx @@ -1,7 +1,7 @@ import { Alert, AlertTitle, Typography } from '@mui/material'; import * as React from 'react'; -import { PARAM_VERSION } from '../../config.js'; +import { PARAM_VERSION } from '../../constants'; export interface ParamsVersionErrorProps { root: string; diff --git a/gui/src/components/input/EditableList.tsx b/gui/src/components/input/EditableList.tsx index 8c0d5026..761dbfee 100644 --- a/gui/src/components/input/EditableList.tsx +++ b/gui/src/components/input/EditableList.tsx @@ -5,6 +5,7 @@ import { memo, useContext, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useStore } from 'zustand'; +import { STANDARD_SPACING } from '../../constants.js'; import { OnnxState, StateContext } from '../../state/full.js'; export interface EditableListProps { @@ -30,7 +31,7 @@ export function EditableList(props: EditableListProps) { const [nextSource, setNextSource] = useState(''); const RenderMemo = useMemo(() => memo(renderItem), [renderItem]); - return + return {items.map((model, idx) => (props: EditableListProps) { onRemove={removeItem} /> )} - + ; @@ -35,7 +37,7 @@ export function ImageInput(props: ImageInputProps) { } } - return + return diff --git a/gui/src/components/tab/Txt2Img.tsx b/gui/src/components/tab/Txt2Img.tsx index e344e3c0..b0b04c7f 100644 --- a/gui/src/components/tab/Txt2Img.tsx +++ b/gui/src/components/tab/Txt2Img.tsx @@ -8,8 +8,10 @@ import { useStore } from 'zustand'; import { shallow } from 'zustand/shallow'; import { PipelineGrid, makeTxt2ImgGridPipeline } from '../../client/utils.js'; +import { STANDARD_SPACING } from '../../constants.js'; import { ClientContext, ConfigContext, OnnxState, StateContext } from '../../state/full.js'; import { TabState } from '../../state/types.js'; +import { JobType } from '../../types/api-v2.js'; import { HighresParams, ModelParams, Txt2ImgParams, UpscaleParams } from '../../types/params.js'; import { Profiles } from '../Profiles.js'; import { HighresControl } from '../control/HighresControl.js'; @@ -18,7 +20,6 @@ import { ModelControl } from '../control/ModelControl.js'; import { UpscaleControl } from '../control/UpscaleControl.js'; import { VariableControl } from '../control/VariableControl.js'; import { NumericField } from '../input/NumericField.js'; -import { JobType } from '../../types/api-v2.js'; export function SizeControl() { const { params } = mustExist(useContext(ConfigContext)); @@ -88,7 +89,7 @@ export function Txt2Img() { const { t } = useTranslation(); return - + - + { params: T; } -export const IMAGE_FILTER = '.bmp, .jpg, .jpeg, .png'; -export const PARAM_VERSION = '>=0.10.0'; - -export const STALE_TIME = 300_000; // 5 minutes -export const POLL_TIME = 5_000; // 5 seconds -export const SAVE_TIME = 5_000; // 5 seconds - export async function loadConfig(): Promise { const configPath = new URL('./config.json', window.location.href); const configReq = await fetch(configPath); diff --git a/gui/src/constants.ts b/gui/src/constants.ts index 74018a7a..f16d2e23 100644 --- a/gui/src/constants.ts +++ b/gui/src/constants.ts @@ -1,3 +1,4 @@ +import { Breakpoint } from '@mui/material/styles'; export const BLEND_SOURCES = 2; @@ -29,3 +30,66 @@ export const DEFAULT_HISTORY = { */ scrollback: 4, }; + +export const STANDARD_MARGIN = 4; // translated into 32px by mui +export const STANDARD_SPACING = 2; + +export const LAYOUT_MIN = 300; +// eslint-disable-next-line @typescript-eslint/no-magic-numbers +export const LAYOUT_PROPORTIONS = [100, 200]; + +export const LAYOUT_STYLES = { + horizontal: { + container: false, + control: { + width: '30%', + }, + direction: 'row', + divider: 'vertical', + history: { + style: { + ml: STANDARD_MARGIN, + }, + width: 4, + }, + }, + vertical: { + container: 'lg' as Breakpoint, + control: { + width: undefined, + }, + direction: 'column', + divider: 'horizontal', + history: { + style: { + mx: STANDARD_MARGIN, + my: STANDARD_MARGIN, + }, + width: 2, + }, + }, +} as const; + +export const INITIAL_LOAD_TIMEOUT = 5_000; + +export const STALE_TIME = 300_000; // 5 minutes +export const POLL_TIME = 5_000; // 5 seconds +export const SAVE_TIME = 5_000; // 5 seconds + +export const IMAGE_FILTER = '.bmp, .jpg, .jpeg, .png'; +export const PARAM_VERSION = '>=0.10.0'; + +/** + * Fixed precision for integer parameters. + */ +export const FIXED_INTEGER = 0; + +/** + * Fixed precision for float parameters. + * + * The GUI limits the input steps based on the server parameters, but this does limit + * the maximum precision that can be sent back to the server, and may have to be + * increased in the future. + */ +export const FIXED_FLOAT = 2; +export const STATUS_SUCCESS = 200; diff --git a/gui/src/main.tsx b/gui/src/main.tsx index 6e57fde0..00286119 100644 --- a/gui/src/main.tsx +++ b/gui/src/main.tsx @@ -18,7 +18,7 @@ import { ServerParamsError } from './components/error/ServerParams.js'; import { LoadingScreen } from './components/LoadingScreen.js'; import { OnnxError } from './components/OnnxError.js'; import { OnnxWeb } from './components/OnnxWeb.js'; -import { Config, getApiRoot, isDebug, loadConfig, mergeConfig, PARAM_VERSION, ServerParams } from './config.js'; +import { Config, getApiRoot, isDebug, loadConfig, mergeConfig, ServerParams } from './config.js'; import { ClientContext, ConfigContext, @@ -31,8 +31,7 @@ import { } from './state/full.js'; import { I18N_STRINGS } from './strings/all.js'; import { applyStateMigrations, UnknownState } from './state/migration/default.js'; - -export const INITIAL_LOAD_TIMEOUT = 5_000; +import { INITIAL_LOAD_TIMEOUT, PARAM_VERSION } from './constants.js'; export async function renderApp(config: Config, params: ServerParams, logger: Logger, client: ApiClient) { const completeConfig = mergeConfig(config, params); diff --git a/gui/src/state/history.ts b/gui/src/state/history.ts index 213e42af..025dc204 100644 --- a/gui/src/state/history.ts +++ b/gui/src/state/history.ts @@ -1,15 +1,9 @@ import { Maybe } from '@apextoaster/js-utils'; -import { ImageResponse, ReadyResponse, RetryParams } from '../types/api.js'; +import { RetryParams } from '../types/api.js'; import { Slice } from './types.js'; import { DEFAULT_HISTORY } from '../constants.js'; import { JobResponse } from '../types/api-v2.js'; -export interface HistoryItem { - image: ImageResponse; - ready: Maybe; - retry: Maybe; -} - export interface HistoryItemV2 { image: JobResponse; retry: Maybe; diff --git a/gui/src/types/api-v2.ts b/gui/src/types/api-v2.ts index 3595a7c6..4e992ba7 100644 --- a/gui/src/types/api-v2.ts +++ b/gui/src/types/api-v2.ts @@ -34,6 +34,13 @@ export interface ImageMetadata + | ImageMetadata + | ImageMetadata + | ImageMetadata + | ImageMetadata; + export enum JobStatus { PENDING = 'pending', RUNNING = 'running', @@ -143,13 +150,7 @@ export interface SuccessBlendJobResponse extends BaseJobResponse { export interface SuccessChainJobResponse extends BaseJobResponse { status: JobStatus.SUCCESS; outputs: Array; - metadata: Array< - ImageMetadata - | ImageMetadata - | ImageMetadata - | ImageMetadata - | ImageMetadata - >; + metadata: Array; } /** diff --git a/gui/src/types/api.ts b/gui/src/types/api.ts index 884e103c..ebf9e76d 100644 --- a/gui/src/types/api.ts +++ b/gui/src/types/api.ts @@ -1,38 +1,15 @@ import { - BaseImgParams, - ModelParams, - Txt2ImgParams, - UpscaleParams, + BlendParams, HighresParams, Img2ImgParams, InpaintParams, + ModelParams, OutpaintParams, + Txt2ImgParams, + UpscaleParams, UpscaleReqParams, - BlendParams, - ImageSize, } from './params.js'; -/** - * Output image data within the response. - * - * @deprecated - */ -export interface ImageOutput { - key: string; - url: string; -} - -/** - * General response for most image requests. - * - * @deprecated - */ -export interface ImageResponse { - outputs: Array; - params: Required & Required; - size: ImageSize; -} - /** * Status response from the ready endpoint. */ @@ -122,26 +99,3 @@ export type RetryParams = { params: BlendParams; upscale?: UpscaleParams; }; - -/** - * Status response from the image endpoint, with parameters to retry the job if it fails. - * - * @deprecated - */ -export interface ImageResponseWithRetry { - image: ImageResponse; - retry: RetryParams; -} - -/** - * @deprecated - */ -export interface ImageMetadata { - highres: HighresParams; - outputs: string | Array; - params: Txt2ImgParams | Img2ImgParams | InpaintParams; - upscale: UpscaleParams; - - input_size: ImageSize; - size: ImageSize; -}