Merge pull request #9 from caranicas/beta-react-creation-options

Beta react creation options
This commit is contained in:
caranicas 2022-09-14 16:50:17 -04:00 committed by GitHub
commit d3c241d283
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 7 deletions

View File

@ -29,6 +29,7 @@ function SettingsList() {
const toggleUseFaceCorrection = useImageCreate(
(state) => state.toggleUseFaceCorrection
);
const isUsingFaceCorrection = useImageCreate((state) =>
state.isUsingFaceCorrection()
);
@ -111,6 +112,9 @@ function SettingsList() {
name="upscale_model"
disabled={!isUsingUpscaling}
value={use_upscale}
onChange={(e) => {
setRequestOption("use_upscale", e.target.value);
}}
>
<option value="RealESRGAN_x4plus">RealESRGAN_x4plus</option>
<option value="RealESRGAN_x4plus_anime_6B">

View File

@ -50,10 +50,11 @@ export default function DisplayPanel() {
})
.flat()
.reverse();
setCompletedImages(temp);
setCompletedImages(temp);
} else {
setCompletedImages([]);
}
}, [setCompletedImages, queryClient, completedIds]);
return (

View File

@ -113,7 +113,7 @@ export const useImageCreate = create<ImageCreateState>(
use_cpu: false,
use_full_precision: true,
save_to_disk_path: "null",
use_face_correction: null,
use_face_correction: 'GFPGANv1.3',
use_upscale: "RealESRGAN_x4plus",
show_only_filtered_image: false,
} as ImageRequest,
@ -184,6 +184,7 @@ export const useImageCreate = create<ImageCreateState>(
if (!state.uiOptions.isCheckUseFaceCorrection) {
request.use_face_correction = null;
}
// if we arent using upscaling clear the upscaling
if (!state.uiOptions.isCheckedUseUpscaling) {
request.use_upscale = null;
@ -238,7 +239,7 @@ export const useImageCreate = create<ImageCreateState>(
state.requestOptions.use_upscale = state.uiOptions
.isCheckedUseUpscaling
? "RealESRGAN_x4plus"
: null;
: undefined;
localStorage.setItem(
"ui:isCheckedUseUpscaling",
state.uiOptions.isCheckedUseUpscaling
@ -259,10 +260,10 @@ export const useImageCreate = create<ImageCreateState>(
state.use_face_correction = state.uiOptions.isCheckUseFaceCorrection
? "GFPGANv1.3"
: null;
localStorage.setItem(
"ui:isCheckUseFaceCorrection",
state.uiOptions.isCheckUseFaceCorrection
);
// localStorage.setItem(
// "ui:isCheckUseFaceCorrection",
// state.uiOptions.isCheckUseFaceCorrection
// );
})
);
},