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

View File

@ -200,6 +200,7 @@ type AppAction = {
updateEnablePowerPaintV2: (newValue: boolean) => void
updateEnableBrushNet: (newValue: boolean) => void
updateEnableControlnet: (newValue: boolean) => void
updateLCMLora: (newValue: boolean) => void
setModel: (newModel: ModelInfo) => 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) => {
set((state) => {
state.settings.model = newModel