diff --git a/ui/frontend/build_src/src/components/organisms/creationPanel/advancedSettings/improvementSettings/index.tsx b/ui/frontend/build_src/src/components/organisms/creationPanel/advancedSettings/improvementSettings/index.tsx index 35779e3d..64ccdd7d 100644 --- a/ui/frontend/build_src/src/components/organisms/creationPanel/advancedSettings/improvementSettings/index.tsx +++ b/ui/frontend/build_src/src/components/organisms/creationPanel/advancedSettings/improvementSettings/index.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import React, { useEffect, useState } from "react"; import { useImageCreate } from "../../../../../stores/imageCreateStore"; import { useCreateUI } from "../../creationPanelUIStore"; @@ -13,6 +13,8 @@ export default function ImprovementSettings() { state.isUsingFaceCorrection() ); + const isUsingUpscaling = useImageCreate((state) => state.isUsingUpscaling()); + const use_upscale = useImageCreate((state) => state.getValueForRequestKey("use_upscale") ); @@ -30,10 +32,25 @@ export default function ImprovementSettings() { const improvementOpen = useCreateUI( (state) => state.isOpenAdvImprovementSettings ); + const toggleImprovementOpen = useCreateUI( (state) => state.toggleAdvImprovementSettings ); + const [isFilteringDisabled, setIsFilteringDisabled] = useState(false); + // should probably be a store selector + useEffect(() => { + console.log("isUsingUpscaling", isUsingUpscaling); + console.log("isUsingFaceCorrection", isUsingFaceCorrection); + + // if either are true we arent disabled + if (isUsingFaceCorrection || use_upscale) { + setIsFilteringDisabled(false); + } else { + setIsFilteringDisabled(true); + } + }, [isUsingFaceCorrection, isUsingUpscaling, setIsFilteringDisabled]); + return (