Skip to content

Commit

Permalink
add clear setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyberhan123 committed Feb 25, 2024
1 parent d96d5fd commit 39da1b4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func (a *App) GetOptions() sd.Options {
}

func (a *App) SetOptions(option sd.Options) {
runtime.LogDebug(a.ctx, fmt.Sprintf("%+v", *a.options))
runtime.LogDebug(a.ctx, fmt.Sprintf("%#v", *a.options))
a.options = &option
if a.modelLoaded || len(a.modelPath) > 0 {
a.sd.SetOptions(option)
Expand Down
29 changes: 28 additions & 1 deletion frontend/src/pages/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const Settings: FC<SettingsProps> = (props) => {
name="VaePath"
>
<Button
type={"link"}
onClick={async () => {
const path = await GetFilePath("Select Vae Path")
if (path?.length > 0) {
Expand All @@ -85,6 +86,14 @@ const Settings: FC<SettingsProps> = (props) => {
>
Select Vae Path
</Button>
<Button
type={"link"}
onClick={async () => {
form.setFieldValue("VaePath", "")
}}
>
Clear Vae Path
</Button>
<Input
value={VaePath}
readOnly
Expand All @@ -96,6 +105,7 @@ const Settings: FC<SettingsProps> = (props) => {
name="TaesdPath"
>
<Button
type={"link"}
onClick={async () => {
const path = await GetFilePath("Select Taesd Path")
if (path?.length > 0) {
Expand All @@ -105,6 +115,14 @@ const Settings: FC<SettingsProps> = (props) => {
>
Select Taesd Path
</Button>
<Button
type={"link"}
onClick={async () => {
form.setFieldValue("TaesdPath", "")
}}
>
Clear Taesd Path
</Button>
<Input
value={TaesdPath}
readOnly
Expand All @@ -116,14 +134,23 @@ const Settings: FC<SettingsProps> = (props) => {
name="LoraModelDir"
>
<Button
type={"link"}
onClick={async () => {
const path = await GetDirPath("Lora Model Dir")
if (path?.length > 0) {
form.setFieldValue("LoraModelDir", path)
}
}}
>
Select Lora Model Dir
Select Lora Dir
</Button>
<Button
type={"link"}
onClick={async () => {
form.setFieldValue("LoraModelDir", "")
}}
>
Clear Lora Dir
</Button>
<Input
value={LoraModelDir}
Expand Down

0 comments on commit 39da1b4

Please sign in to comment.