Skip to content
代码片段 群组 项目

比较版本

更改显示为版本正在合并到目标版本。了解更多关于比较版本的信息。

来源

选择目标项目
No results found

目标

选择目标项目
  • hunter0726/stable-diffusion-webui
1 个结果
显示更改
源代码提交(4)
...@@ -225,6 +225,18 @@ def img2img(id_task: str, mode: int, prompt: str, negative_prompt: str, prompt_s ...@@ -225,6 +225,18 @@ def img2img(id_task: str, mode: int, prompt: str, negative_prompt: str, prompt_s
if mask: if mask:
p.extra_generation_params["Mask blur"] = mask_blur p.extra_generation_params["Mask blur"] = mask_blur
if inpainting_mask_invert is not None:
p.extra_generation_params["Mask mode"] = inpainting_mask_invert
if inpainting_fill is not None:
p.extra_generation_params["Masked content"] = inpainting_fill
if inpaint_full_res is not None:
p.extra_generation_params["Inpaint area"] = inpaint_full_res
if inpaint_full_res_padding is not None:
p.extra_generation_params["Only masked padding, pixels"] = inpaint_full_res_padding
with closing(p): with closing(p):
if is_batch: if is_batch:
assert not shared.cmd_opts.hide_ui_dir_config, "Launched with --hide-ui-dir-config, batch img2img disabled" assert not shared.cmd_opts.hide_ui_dir_config, "Launched with --hide-ui-dir-config, batch img2img disabled"
......
...@@ -115,6 +115,7 @@ options_templates.update(options_section(('system', "System", "system"), { ...@@ -115,6 +115,7 @@ options_templates.update(options_section(('system', "System", "system"), {
"memmon_poll_rate": OptionInfo(8, "VRAM usage polls per second during generation.", gr.Slider, {"minimum": 0, "maximum": 40, "step": 1}).info("0 = disable"), "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"), "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."), "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."), "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 \".\""), "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"), "disable_mmap_load_safetensors": OptionInfo(False, "Disable memmapping for loading .safetensors files.").info("fixes very slow loading speed in some cases"),
......
...@@ -840,6 +840,10 @@ def create_ui(): ...@@ -840,6 +840,10 @@ def create_ui():
(toprow.ui_styles.dropdown, lambda d: d["Styles array"] if isinstance(d.get("Styles array"), list) else gr.update()), (toprow.ui_styles.dropdown, lambda d: d["Styles array"] if isinstance(d.get("Styles array"), list) else gr.update()),
(denoising_strength, "Denoising strength"), (denoising_strength, "Denoising strength"),
(mask_blur, "Mask blur"), (mask_blur, "Mask blur"),
(inpainting_mask_invert, 'Mask mode'),
(inpainting_fill, 'Masked content'),
(inpaint_full_res, 'Inpaint area'),
(inpaint_full_res_padding, 'Only masked padding, pixels'),
*scripts.scripts_img2img.infotext_fields *scripts.scripts_img2img.infotext_fields
] ]
parameters_copypaste.add_paste_fields("img2img", init_img, img2img_paste_fields, override_settings) parameters_copypaste.add_paste_fields("img2img", init_img, img2img_paste_fields, override_settings)
......
...@@ -47,7 +47,7 @@ def upscale_with_model( ...@@ -47,7 +47,7 @@ def upscale_with_model(
grid = images.split_grid(img, tile_size, tile_size, tile_overlap) grid = images.split_grid(img, tile_size, tile_size, tile_overlap)
newtiles = [] 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: for y, h, row in grid.tiles:
newrow = [] newrow = []
for x, w, tile in row: for x, w, tile in row:
...@@ -103,7 +103,7 @@ def tiled_upscale_2( ...@@ -103,7 +103,7 @@ def tiled_upscale_2(
).type_as(img) ).type_as(img)
weights = torch.zeros_like(result) weights = torch.zeros_like(result)
logger.debug("Upscaling %s to %s with tiles", img.shape, result.shape) 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: for h_idx in h_idx_list:
if shared.state.interrupted or shared.state.skipped: if shared.state.interrupted or shared.state.skipped:
break break
......