Skip to content

Commit

Permalink
add an option to hide upscaling progressbar
Browse files Browse the repository at this point in the history
  • Loading branch information
AUTOMATIC1111 authored and ruchej committed Sep 30, 2024
1 parent dd79440 commit 359472b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions modules/shared_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
"memmon_poll_rate": OptionInfo(8, "VRAM usage polls per second during generation.", gr.Slider, {"minimum": 0, "maximum": 40, "step": 1}).info("0 = disable"),
"samples_log_stdout": OptionInfo(False, "Always print all generation info to standard output"),
"multiple_tqdm": OptionInfo(True, "Add a second progress bar to the console that shows progress for an entire job."),
"enable_upscale_progressbar": OptionInfo(True, "Show a progress bar in the console for tiled upscaling."),
"print_hypernet_extra": OptionInfo(False, "Print extra hypernetwork information to console."),
"list_hidden_files": OptionInfo(True, "Load models/files in hidden directories").info("directory is hidden if its name starts with \".\""),
"disable_mmap_load_safetensors": OptionInfo(False, "Disable memmapping for loading .safetensors files.").info("fixes very slow loading speed in some cases"),
Expand Down
4 changes: 2 additions & 2 deletions modules/upscaler_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def upscale_with_model(
grid = images.split_grid(img, tile_size, tile_size, tile_overlap)
newtiles = []

with tqdm.tqdm(total=grid.tile_count, desc=desc) as p:
with tqdm.tqdm(total=grid.tile_count, desc=desc, disable=not shared.opts.enable_upscale_progressbar) as p:
for y, h, row in grid.tiles:
newrow = []
for x, w, tile in row:
Expand Down Expand Up @@ -103,7 +103,7 @@ def tiled_upscale_2(
).type_as(img)
weights = torch.zeros_like(result)
logger.debug("Upscaling %s to %s with tiles", img.shape, result.shape)
with tqdm.tqdm(total=len(h_idx_list) * len(w_idx_list), desc=desc) as pbar:
with tqdm.tqdm(total=len(h_idx_list) * len(w_idx_list), desc=desc, disable=not shared.opts.enable_upscale_progressbar) as pbar:
for h_idx in h_idx_list:
if shared.state.interrupted or shared.state.skipped:
break
Expand Down

0 comments on commit 359472b

Please sign in to comment.