Skip to content

Commit

Permalink
fix(gui): send upscale params
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jan 16, 2023
1 parent 4dafda7 commit 5e5d748
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
8 changes: 4 additions & 4 deletions gui/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ export interface ApiClient {
platforms(): Promise<Array<string>>;
schedulers(): Promise<Array<string>>;

img2img(params: Img2ImgParams): Promise<ApiResponse>;
txt2img(params: Txt2ImgParams): Promise<ApiResponse>;
inpaint(params: InpaintParams): Promise<ApiResponse>;
outpaint(params: OutpaintParams): Promise<ApiResponse>;
img2img(params: Img2ImgParams, upscale?: UpscaleParams): Promise<ApiResponse>;
txt2img(params: Txt2ImgParams, upscale?: UpscaleParams): Promise<ApiResponse>;
inpaint(params: InpaintParams, upscale?: UpscaleParams): Promise<ApiResponse>;
outpaint(params: OutpaintParams, upscale?: UpscaleParams): Promise<ApiResponse>;

ready(params: ApiResponse): Promise<ApiReady>;
}
Expand Down
4 changes: 3 additions & 1 deletion gui/src/components/Img2Img.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ export function Img2Img(props: Img2ImgProps) {
const { config, model, platform } = props;

async function uploadSource() {
const upscale = state.getState().upscale;

const output = await client.img2img({
...params,
model,
platform,
source: mustExist(params.source), // TODO: show an error if this doesn't exist
});
}, upscale);

setLoading(output);
}
Expand Down
8 changes: 5 additions & 3 deletions gui/src/components/Inpaint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ export function Inpaint(props: InpaintProps) {
});

async function uploadSource(): Promise<void> {
const outpaint = state.getState().outpaint; // TODO: seems shady
// these are not watched by the component, only sent by the mutation
const outpaint = state.getState().outpaint;
const upscale = state.getState().upscale;

if (outpaint.enabled) {
const output = await client.outpaint({
Expand All @@ -44,7 +46,7 @@ export function Inpaint(props: InpaintProps) {
platform,
mask: mustExist(params.mask),
source: mustExist(params.source),
});
}, upscale);

setLoading(output);
} else {
Expand All @@ -54,7 +56,7 @@ export function Inpaint(props: InpaintProps) {
platform,
mask: mustExist(params.mask),
source: mustExist(params.source),
});
}, upscale);

setLoading(output);
}
Expand Down
3 changes: 2 additions & 1 deletion gui/src/components/Txt2Img.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ export function Txt2Img(props: Txt2ImgProps) {
const { config, model, platform } = props;

async function generateImage() {
const upscale = state.getState().upscale;
const output = await client.txt2img({
...params,
model,
platform,
});
}, upscale);

setLoading(output);
}
Expand Down
1 change: 1 addition & 0 deletions gui/src/components/UpscaleControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export function UpscaleControl(props: UpscaleControlProps) {
/>
<NumericField
label='Denoise'
decimal
disabled={params.enabled === false}
min={config.denoise.min}
max={config.denoise.max}
Expand Down

0 comments on commit 5e5d748

Please sign in to comment.