Skip to content

Commit

Permalink
allow options in ui
Browse files Browse the repository at this point in the history
  • Loading branch information
light-and-ray committed Mar 4, 2024
1 parent aa8e033 commit e8a9170
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions lama_cleaner_masked_content/options.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
from modules import shared
import modules.scripts
import gradio as gr


def getUpscaler():
res = shared.opts.data.get("upscaling_upscaler_for_lama_cleaner_masked_content", "ESRGAN_4x")
return res

lama_cleaner_settings = {
'upscaling_upscaler_for_lama_cleaner_masked_content': shared.OptionInfo(
"ESRGAN_4x",
"Upscaler for lama cleaner masked content",
gr.Dropdown,
lambda: {"choices": [x.name for x in shared.sd_upscalers]},
),
}

def on_ui_settings():
section = ('upscaling', "Upscaling")
shared.options_templates.update(shared.options_section(('upscaling', 'Upscaling'), lama_cleaner_settings))

shared.opts.add_option(
"upscaling_upscaler_for_lama_cleaner_masked_content",
shared.OptionInfo(
"ESRGAN_4x",
"Upscaler for lama cleaner masked content",
gr.Dropdown,
lambda: {"choices": [x.name for x in shared.sd_upscalers]},
section=section,
),
)


modules.scripts.script_callbacks.on_ui_settings(on_ui_settings)

0 comments on commit e8a9170

Please sign in to comment.