|
13 | 13 | import modules.memmon
|
14 | 14 | import modules.styles
|
15 | 15 | import modules.devices as devices
|
16 |
| -from modules import localization, sd_vae, extensions, script_loading, errors, ui_components |
17 |
| -from modules.paths import models_path, script_path, sd_path |
| 16 | +from modules import localization, sd_vae, extensions, script_loading, errors, ui_components, shared_items |
| 17 | +from modules.paths import models_path, script_path |
18 | 18 |
|
19 | 19 |
|
20 | 20 | demo = None
|
@@ -264,12 +264,6 @@ def assign_current_image(self, image):
|
264 | 264 |
|
265 | 265 | face_restorers = []
|
266 | 266 |
|
267 |
| - |
268 |
| -def realesrgan_models_names(): |
269 |
| - import modules.realesrgan_model |
270 |
| - return [x.name for x in modules.realesrgan_model.get_realesrgan_models(None)] |
271 |
| - |
272 |
| - |
273 | 267 | class OptionInfo:
|
274 | 268 | def __init__(self, default=None, label="", component=None, component_args=None, onchange=None, section=None, refresh=None):
|
275 | 269 | self.default = default
|
@@ -360,7 +354,7 @@ def list_samplers():
|
360 | 354 | options_templates.update(options_section(('upscaling', "Upscaling"), {
|
361 | 355 | "ESRGAN_tile": OptionInfo(192, "Tile size for ESRGAN upscalers. 0 = no tiling.", gr.Slider, {"minimum": 0, "maximum": 512, "step": 16}),
|
362 | 356 | "ESRGAN_tile_overlap": OptionInfo(8, "Tile overlap, in pixels for ESRGAN upscalers. Low values = visible seam.", gr.Slider, {"minimum": 0, "maximum": 48, "step": 1}),
|
363 |
| - "realesrgan_enabled_models": OptionInfo(["R-ESRGAN 4x+", "R-ESRGAN 4x+ Anime6B"], "Select which Real-ESRGAN models to show in the web UI. (Requires restart)", gr.CheckboxGroup, lambda: {"choices": realesrgan_models_names()}), |
| 357 | + "realesrgan_enabled_models": OptionInfo(["R-ESRGAN 4x+", "R-ESRGAN 4x+ Anime6B"], "Select which Real-ESRGAN models to show in the web UI. (Requires restart)", gr.CheckboxGroup, lambda: {"choices": shared_items.realesrgan_models_names()}), |
364 | 358 | "upscaler_for_img2img": OptionInfo(None, "Upscaler for img2img", gr.Dropdown, lambda: {"choices": [x.name for x in sd_upscalers]}),
|
365 | 359 | }))
|
366 | 360 |
|
@@ -483,7 +477,8 @@ def list_samplers():
|
483 | 477 | }))
|
484 | 478 |
|
485 | 479 | options_templates.update(options_section(('postprocessing', "Postprocessing"), {
|
486 |
| - 'postprocessing_scipts_order': OptionInfo("upscale, gfpgan, codeformer", "Postprocessing operation order"), |
| 480 | + 'postprocessing_enable_in_main_ui': OptionInfo([], "Enable postprocessing operations in txt2img and img2img tabs", ui_components.DropdownMulti, lambda: {"choices": [x.name for x in shared_items.postprocessing_scripts()]}), |
| 481 | + 'postprocessing_operation_order': OptionInfo([], "Postprocessing operation order", ui_components.DropdownMulti, lambda: {"choices": [x.name for x in shared_items.postprocessing_scripts()]}), |
487 | 482 | 'upscaling_max_images_in_cache': OptionInfo(5, "Maximum number of images in upscaling cache", gr.Slider, {"minimum": 0, "maximum": 10, "step": 1}),
|
488 | 483 | }))
|
489 | 484 |
|
|
0 commit comments