disable powerpaint_v2 & brushnet when lcmlora enabled

This commit is contained in:
Qing 2024-04-29 22:31:03 +08:00
parent 80ee1b9941
commit 2ab0d089f0
2 changed files with 14 additions and 1 deletions

View File

@ -62,6 +62,7 @@ const DiffusionOptions = () => {
updateEnablePowerPaintV2, updateEnablePowerPaintV2,
updateEnableBrushNet, updateEnableBrushNet,
updateEnableControlnet, updateEnableControlnet,
updateLCMLora,
] = useStore((state) => [ ] = useStore((state) => [
state.serverConfig.samplers, state.serverConfig.samplers,
state.settings, state.settings,
@ -77,6 +78,7 @@ const DiffusionOptions = () => {
state.updateEnablePowerPaintV2, state.updateEnablePowerPaintV2,
state.updateEnableBrushNet, state.updateEnableBrushNet,
state.updateEnableControlnet, state.updateEnableControlnet,
state.updateLCMLora,
]) ])
const [exampleImage, isExampleImageLoaded] = useImage(paintByExampleFile) const [exampleImage, isExampleImageLoaded] = useImage(paintByExampleFile)
const negativePromptRef = useRef(null) const negativePromptRef = useRef(null)
@ -295,7 +297,7 @@ const DiffusionOptions = () => {
id="lcm-lora" id="lcm-lora"
checked={settings.enableLCMLora} checked={settings.enableLCMLora}
onCheckedChange={(value) => { onCheckedChange={(value) => {
updateSettings({ enableLCMLora: value }) updateLCMLora(value)
}} }}
/> />
</RowContainer> </RowContainer>

View File

@ -200,6 +200,7 @@ type AppAction = {
updateEnablePowerPaintV2: (newValue: boolean) => void updateEnablePowerPaintV2: (newValue: boolean) => void
updateEnableBrushNet: (newValue: boolean) => void updateEnableBrushNet: (newValue: boolean) => void
updateEnableControlnet: (newValue: boolean) => void updateEnableControlnet: (newValue: boolean) => void
updateLCMLora: (newValue: boolean) => void
setModel: (newModel: ModelInfo) => void setModel: (newModel: ModelInfo) => void
updateFileManagerState: (newState: Partial<FileManagerState>) => void updateFileManagerState: (newState: Partial<FileManagerState>) => void
@ -840,6 +841,16 @@ export const useStore = createWithEqualityFn<AppState & AppAction>()(
} }
}, },
updateLCMLora(newValue) {
get().updateSettings({ enableLCMLora: newValue })
if (newValue) {
get().updateSettings({
enablePowerPaintV2: false,
enableBrushNet: false,
})
}
},
setModel: (newModel: ModelInfo) => { setModel: (newModel: ModelInfo) => {
set((state) => { set((state) => {
state.settings.model = newModel state.settings.model = newModel