added preview option

This commit is contained in:
AUTOMATIC
2022-09-06 19:33:51 +03:00
parent db6db585eb
commit fd66199769
7 changed files with 102 additions and 12 deletions

View File

@@ -39,6 +39,7 @@ gpu = torch.device("cuda")
device = gpu if torch.cuda.is_available() else cpu
batch_cond_uncond = cmd_opts.always_batch_cond_uncond or not (cmd_opts.lowvram or cmd_opts.medvram)
class State:
interrupted = False
job = ""
@@ -46,6 +47,8 @@ class State:
job_count = 0
sampling_step = 0
sampling_steps = 0
current_latent = None
current_image = None
def interrupt(self):
self.interrupted = True
@@ -99,6 +102,7 @@ class Options:
"random_artist_categories": OptionInfo([], "Allowed categories for random artists selection when using the Roll button", gr.CheckboxGroup, {"choices": artist_db.categories()}),
"upscale_at_full_resolution_padding": OptionInfo(16, "Inpainting at full resolution: padding, in pixels, for the masked region.", gr.Slider, {"minimum": 0, "maximum": 128, "step": 4}),
"show_progressbar": OptionInfo(True, "Show progressbar"),
"show_progress_every_n_steps": OptionInfo(0, "Show show image creation progress every N steps. Set 0 to disable.", gr.Slider, {"minimum": 0, "maximum": 32, "step": 1}),
}
def __init__(self):