From c47209cfbfd943ab0972467975d3b564ca551d76 Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Sun, 5 Feb 2023 17:23:47 -0600 Subject: [PATCH] feat(gui): add LPW flag to model settings --- gui/src/client.ts | 6 ++++++ gui/src/components/control/ModelControl.tsx | 15 +++++++++++++-- gui/src/state.ts | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/gui/src/client.ts b/gui/src/client.ts index d18b6e8e..420499f8 100644 --- a/gui/src/client.ts +++ b/gui/src/client.ts @@ -26,6 +26,11 @@ export interface ModelParams { * The correction model to use. */ correction: string; + + /** + * Use the long prompt weighting pipeline. + */ + lpw: boolean; } /** @@ -285,6 +290,7 @@ export function appendModelToURL(url: URL, params: ModelParams) { url.searchParams.append('platform', params.platform); url.searchParams.append('upscaling', params.upscaling); url.searchParams.append('correction', params.correction); + url.searchParams.append('lpw', String(params.lpw)); } /** diff --git a/gui/src/components/control/ModelControl.tsx b/gui/src/components/control/ModelControl.tsx index de4dbd3c..7e015919 100644 --- a/gui/src/components/control/ModelControl.tsx +++ b/gui/src/components/control/ModelControl.tsx @@ -1,5 +1,5 @@ import { mustExist } from '@apextoaster/js-utils'; -import { Stack } from '@mui/material'; +import { Checkbox, FormControlLabel, Stack } from '@mui/material'; import * as React from 'react'; import { useContext } from 'react'; import { useQuery } from 'react-query'; @@ -84,6 +84,17 @@ export function ModelControl() { }); }} /> - + { + setModel({ + lpw: params.lpw === false, + }); + }} + />} + /> ; } diff --git a/gui/src/state.ts b/gui/src/state.ts index 21bf4fda..33882971 100644 --- a/gui/src/state.ts +++ b/gui/src/state.ts @@ -426,6 +426,7 @@ export function createStateSlices(server: ServerParams) { platform: server.platform.default, upscaling: server.upscaling.default, correction: server.correction.default, + lpw: false, }, setModel(params) { set((prev) => ({