aboutsummaryrefslogtreecommitdiff
path: root/modules/shared.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2022-09-04 18:54:12 +0300
committerAUTOMATIC <16777216c@gmail.com>2022-09-04 18:54:12 +0300
commitf299645aeeb65fcddde2d136fd550b6b01ffebb3 (patch)
tree5e00d526688ce928b68f023ac91a4bf227aaf092 /modules/shared.py
parent78278ce695beffbf59c7320bb0441922d66b1c0e (diff)
ESRGAN support
Diffstat (limited to 'modules/shared.py')
-rw-r--r--modules/shared.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/shared.py b/modules/shared.py
index c8c2749a..72e92eb9 100644
--- a/modules/shared.py
+++ b/modules/shared.py
@@ -28,6 +28,7 @@ parser.add_argument("--always-batch-cond-uncond", action='store_true', help="a w
parser.add_argument("--unload-gfpgan", action='store_true', help="unload GFPGAN every time after processing images. Warning: seems to cause memory leaks")
parser.add_argument("--precision", type=str, help="evaluate at this precision", choices=["full", "autocast"], default="autocast")
parser.add_argument("--share", action='store_true', help="use share=True for gradio and make the UI accessible through their site (doesn't work for me but you might have better luck)")
+parser.add_argument("--esrgan-models-path", type=str, help="path to directory with ESRGAN models", default=os.path.join(script_path, 'ESRGAN'))
cmd_opts = parser.parse_args()
cpu = torch.device("cpu")
@@ -79,7 +80,8 @@ class Options:
"font": OptionInfo("arial.ttf", "Font for image grids that have text"),
"enable_emphasis": OptionInfo(True, "Use (text) to make model pay more attention to text text and [text] to make it pay less attention"),
"save_txt": OptionInfo(False, "Create a text file next to every image with generation parameters."),
-
+ "ESRGAN_tile": OptionInfo(192, "Tile size for ESRGAN upscaling. 0 = no tiling.", gr.Slider, {"minimum": 0, "maximum": 512, "step": 16}),
+ "ESRGAN_tile_overlap": OptionInfo(8, "Tile overlap, in pixels for ESRGAN upscaling. Low values = visible seam.", gr.Slider, {"minimum": 0, "maximum": 48, "step": 1}),
}
def __init__(self):
@@ -115,7 +117,6 @@ opts = Options()
if os.path.exists(config_filename):
opts.load(config_filename)
-
-sd_upscalers = {}
+sd_upscalers = []
sd_model = None