1
0
Fork 0

feat(gui): add LPW flag to model settings

This commit is contained in:
Sean Sube 2023-02-05 17:23:47 -06:00
parent fb376c6b62
commit c47209cfbf
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
3 changed files with 20 additions and 2 deletions

View File

@ -26,6 +26,11 @@ export interface ModelParams {
* The correction model to use. * The correction model to use.
*/ */
correction: string; 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('platform', params.platform);
url.searchParams.append('upscaling', params.upscaling); url.searchParams.append('upscaling', params.upscaling);
url.searchParams.append('correction', params.correction); url.searchParams.append('correction', params.correction);
url.searchParams.append('lpw', String(params.lpw));
} }
/** /**

View File

@ -1,5 +1,5 @@
import { mustExist } from '@apextoaster/js-utils'; import { mustExist } from '@apextoaster/js-utils';
import { Stack } from '@mui/material'; import { Checkbox, FormControlLabel, Stack } from '@mui/material';
import * as React from 'react'; import * as React from 'react';
import { useContext } from 'react'; import { useContext } from 'react';
import { useQuery } from 'react-query'; import { useQuery } from 'react-query';
@ -84,6 +84,17 @@ export function ModelControl() {
}); });
}} }}
/> />
<FormControlLabel
label='Long Prompt Weighting'
control={<Checkbox
checked={params.lpw}
value='check'
onChange={(event) => {
setModel({
lpw: params.lpw === false,
});
}}
/>}
/>
</Stack>; </Stack>;
} }

View File

@ -426,6 +426,7 @@ export function createStateSlices(server: ServerParams) {
platform: server.platform.default, platform: server.platform.default,
upscaling: server.upscaling.default, upscaling: server.upscaling.default,
correction: server.correction.default, correction: server.correction.default,
lpw: false,
}, },
setModel(params) { setModel(params) {
set((prev) => ({ set((prev) => ({