Skip to content

Commit

Permalink
feat(gui): add LPW flag to model settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Feb 5, 2023
1 parent fb376c6 commit c47209c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
6 changes: 6 additions & 0 deletions gui/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ export interface ModelParams {
* The correction model to use.
*/
correction: string;

/**
* Use the long prompt weighting pipeline.
*/
lpw: boolean;
}

/**
Expand Down Expand Up @@ -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));
}

/**
Expand Down
15 changes: 13 additions & 2 deletions gui/src/components/control/ModelControl.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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>;
}
1 change: 1 addition & 0 deletions gui/src/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => ({
Expand Down

0 comments on commit c47209c

Please sign in to comment.