diff --git a/CHANGELOG.md b/CHANGELOG.md index 53061c564..18d277303 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -986,7 +986,7 @@ Actual changelog is: - original - fix hires secondary sampler - this now fully obsoletes `fallback_sampler` and `force_latent_sampler` + this now fully obsoletes `fallback_sampler` and `force_hr_sampler_name` ## Update for 2023-07-18 @@ -1026,7 +1026,7 @@ Trying to unify settings for both original and diffusers backend without introdu - renamed **hires fix** to **second pass** as that is what it actually is, name hires fix is misleading to start with - actual **hires fix** and **refiner** are now options inside **second pass** section -- obsoleted settings -> sampler -> **force_latent_sampler** +- obsoleted settings -> sampler -> **force_hr_sampler_name** it is now part of **second pass** options and it works the same for both original and diffusers backend which means you can use different scheduler settings for txt2img and hires if you want - sd-xl refiner will run if its loaded and if second pass is enabled diff --git a/cli/simple-txt2img.js b/cli/simple-txt2img.js index 34fb9a843..ae4d7af0c 100755 --- a/cli/simple-txt2img.js +++ b/cli/simple-txt2img.js @@ -28,7 +28,7 @@ const sd_options = { // second pass: hires hr_force: true, hr_second_pass_steps: 20, - latent_sampler: 'UniPC', + hr_sampler_name: 'UniPC', denoising_strength: 0.5, // second pass: refiner refiner_steps: 5, diff --git a/extensions-builtin/sd-webui-controlnet b/extensions-builtin/sd-webui-controlnet index ce3cb3de8..bd23a0ecb 160000 --- a/extensions-builtin/sd-webui-controlnet +++ b/extensions-builtin/sd-webui-controlnet @@ -1 +1 @@ -Subproject commit ce3cb3de8b038da53e6bed8a097c5ad0ebe8421f +Subproject commit bd23a0ecb63f3b4108e5518f24b0226a9fd5b5ac diff --git a/html/amethyst-nightfall.jpg b/html/amethyst-nightfall.jpg new file mode 100644 index 000000000..216f2f765 Binary files /dev/null and b/html/amethyst-nightfall.jpg differ diff --git a/html/invokeai.jpg b/html/invoked.jpg similarity index 100% rename from html/invokeai.jpg rename to html/invoked.jpg diff --git a/modules/control/run.py b/modules/control/run.py index cde569c41..d6d2f35d0 100644 --- a/modules/control/run.py +++ b/modules/control/run.py @@ -93,7 +93,7 @@ def control_run(units: List[unit.Unit], inputs, inits, mask, unit_type: str, is_ styles = styles, steps = steps, sampler_name = processing.get_sampler_name(sampler_index), - latent_sampler = processing.get_sampler_name(sampler_index), + hr_sampler_name = processing.get_sampler_name(sampler_index), seed = seed, subseed = subseed, subseed_strength = subseed_strength, diff --git a/modules/img2img.py b/modules/img2img.py index 66cb8d6f6..2b3e30889 100644 --- a/modules/img2img.py +++ b/modules/img2img.py @@ -114,7 +114,7 @@ def img2img(id_task: str, mode: int, init_img_inpaint, init_mask_inpaint, steps, - sampler_index, latent_index, + sampler_index, hr_sampler_index, mask_blur, mask_alpha, inpainting_fill, full_quality, restore_faces, tiling, @@ -140,7 +140,7 @@ def img2img(id_task: str, mode: int, shared.log.warning('Model not loaded') return [], '', '', 'Error: model not loaded' - debug(f'img2img: id_task={id_task}|mode={mode}|prompt={prompt}|negative_prompt={negative_prompt}|prompt_styles={prompt_styles}|init_img={init_img}|sketch={sketch}|init_img_with_mask={init_img_with_mask}|inpaint_color_sketch={inpaint_color_sketch}|inpaint_color_sketch_orig={inpaint_color_sketch_orig}|init_img_inpaint={init_img_inpaint}|init_mask_inpaint={init_mask_inpaint}|steps={steps}|sampler_index={sampler_index}|latent_index={latent_index}|mask_blur={mask_blur}|mask_alpha={mask_alpha}|inpainting_fill={inpainting_fill}|full_quality={full_quality}|restore_faces={restore_faces}|tiling={tiling}|n_iter={n_iter}|batch_size={batch_size}|cfg_scale={cfg_scale}|image_cfg_scale={image_cfg_scale}|clip_skip={clip_skip}|denoising_strength={denoising_strength}|seed={seed}|subseed{subseed}|subseed_strength={subseed_strength}|seed_resize_from_h={seed_resize_from_h}|seed_resize_from_w={seed_resize_from_w}|selected_scale_tab={selected_scale_tab}|height={height}|width={width}|scale_by={scale_by}|resize_mode={resize_mode}|resize_name={resize_name}|inpaint_full_res={inpaint_full_res}|inpaint_full_res_padding={inpaint_full_res_padding}|inpainting_mask_invert={inpainting_mask_invert}|img2img_batch_files={img2img_batch_files}|img2img_batch_input_dir={img2img_batch_input_dir}|img2img_batch_output_dir={img2img_batch_output_dir}|img2img_batch_inpaint_mask_dir={img2img_batch_inpaint_mask_dir}|override_settings_texts={override_settings_texts}') + debug(f'img2img: id_task={id_task}|mode={mode}|prompt={prompt}|negative_prompt={negative_prompt}|prompt_styles={prompt_styles}|init_img={init_img}|sketch={sketch}|init_img_with_mask={init_img_with_mask}|inpaint_color_sketch={inpaint_color_sketch}|inpaint_color_sketch_orig={inpaint_color_sketch_orig}|init_img_inpaint={init_img_inpaint}|init_mask_inpaint={init_mask_inpaint}|steps={steps}|sampler_index={sampler_index}|hr_sampler_index={hr_sampler_index}|mask_blur={mask_blur}|mask_alpha={mask_alpha}|inpainting_fill={inpainting_fill}|full_quality={full_quality}|restore_faces={restore_faces}|tiling={tiling}|n_iter={n_iter}|batch_size={batch_size}|cfg_scale={cfg_scale}|image_cfg_scale={image_cfg_scale}|clip_skip={clip_skip}|denoising_strength={denoising_strength}|seed={seed}|subseed{subseed}|subseed_strength={subseed_strength}|seed_resize_from_h={seed_resize_from_h}|seed_resize_from_w={seed_resize_from_w}|selected_scale_tab={selected_scale_tab}|height={height}|width={width}|scale_by={scale_by}|resize_mode={resize_mode}|resize_name={resize_name}|inpaint_full_res={inpaint_full_res}|inpaint_full_res_padding={inpaint_full_res_padding}|inpainting_mask_invert={inpainting_mask_invert}|img2img_batch_files={img2img_batch_files}|img2img_batch_input_dir={img2img_batch_input_dir}|img2img_batch_output_dir={img2img_batch_output_dir}|img2img_batch_inpaint_mask_dir={img2img_batch_inpaint_mask_dir}|override_settings_texts={override_settings_texts}') if mode == 5: if img2img_batch_files is None or len(img2img_batch_files) == 0: @@ -150,8 +150,8 @@ def img2img(id_task: str, mode: int, if sampler_index is None: sampler_index = 0 - if latent_index is None: - latent_index = 0 + if hr_sampler_index is None: + hr_sampler_index = 0 override_settings = create_override_settings_dict(override_settings_texts) @@ -213,7 +213,7 @@ def img2img(id_task: str, mode: int, seed_resize_from_w=seed_resize_from_w, seed_enable_extras=True, sampler_name = processing.get_sampler_name(sampler_index, img=True), - latent_sampler = processing.get_sampler_name(latent_index, img=True), + hr_sampler_name = processing.get_sampler_name(hr_sampler_index, img=True), batch_size=batch_size, n_iter=n_iter, steps=steps, diff --git a/modules/processing.py b/modules/processing.py index 53656987c..8dcef9b4f 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -135,7 +135,7 @@ class StableDiffusionProcessing: """ The first set of paramaters: sd_models -> do_not_reload_embeddings represent the minimum required to create a StableDiffusionProcessing """ - def __init__(self, sd_model=None, outpath_samples=None, outpath_grids=None, prompt: str = "", styles: List[str] = None, seed: int = -1, subseed: int = -1, subseed_strength: float = 0, seed_resize_from_h: int = -1, seed_resize_from_w: int = -1, seed_enable_extras: bool = True, sampler_name: str = None, latent_sampler: str = None, batch_size: int = 1, n_iter: int = 1, steps: int = 50, cfg_scale: float = 7.0, image_cfg_scale: float = None, clip_skip: int = 1, width: int = 512, height: int = 512, full_quality: bool = True, restore_faces: bool = False, tiling: bool = False, do_not_save_samples: bool = False, do_not_save_grid: bool = False, extra_generation_params: Dict[Any, Any] = None, overlay_images: Any = None, negative_prompt: str = None, eta: float = None, do_not_reload_embeddings: bool = False, denoising_strength: float = 0, diffusers_guidance_rescale: float = 0.7, resize_mode: int = 0, resize_name: str = 'None', scale_by: float = 0, selected_scale_tab: int = 0, hdr_clamp: bool = False, hdr_boundary: float = 4.0, hdr_threshold: float = 3.5, hdr_center: bool = False, hdr_channel_shift: float = 0.8, hdr_full_shift: float = 0.8, hdr_maximize: bool = False, hdr_max_center: float = 0.6, hdr_max_boundry: float = 1.0, override_settings: Dict[str, Any] = None, override_settings_restore_afterwards: bool = True, sampler_index: int = None, script_args: list = None): # pylint: disable=unused-argument + def __init__(self, sd_model=None, outpath_samples=None, outpath_grids=None, prompt: str = "", styles: List[str] = None, seed: int = -1, subseed: int = -1, subseed_strength: float = 0, seed_resize_from_h: int = -1, seed_resize_from_w: int = -1, seed_enable_extras: bool = True, sampler_name: str = None, hr_sampler_name: str = None, batch_size: int = 1, n_iter: int = 1, steps: int = 50, cfg_scale: float = 7.0, image_cfg_scale: float = None, clip_skip: int = 1, width: int = 512, height: int = 512, full_quality: bool = True, restore_faces: bool = False, tiling: bool = False, do_not_save_samples: bool = False, do_not_save_grid: bool = False, extra_generation_params: Dict[Any, Any] = None, overlay_images: Any = None, negative_prompt: str = None, eta: float = None, do_not_reload_embeddings: bool = False, denoising_strength: float = 0, diffusers_guidance_rescale: float = 0.7, resize_mode: int = 0, resize_name: str = 'None', scale_by: float = 0, selected_scale_tab: int = 0, hdr_clamp: bool = False, hdr_boundary: float = 4.0, hdr_threshold: float = 3.5, hdr_center: bool = False, hdr_channel_shift: float = 0.8, hdr_full_shift: float = 0.8, hdr_maximize: bool = False, hdr_max_center: float = 0.6, hdr_max_boundry: float = 1.0, override_settings: Dict[str, Any] = None, override_settings_restore_afterwards: bool = True, sampler_index: int = None, script_args: list = None): # pylint: disable=unused-argument self.outpath_samples: str = outpath_samples self.outpath_grids: str = outpath_grids self.prompt: str = prompt @@ -148,7 +148,7 @@ class StableDiffusionProcessing: self.seed_resize_from_h: int = seed_resize_from_h self.seed_resize_from_w: int = seed_resize_from_w self.sampler_name: str = sampler_name - self.latent_sampler: str = latent_sampler + self.hr_sampler_name: str = hr_sampler_name self.batch_size: int = batch_size self.n_iter: int = n_iter self.steps: int = steps @@ -633,7 +633,7 @@ def create_infotext(p: StableDiffusionProcessing, all_prompts=None, all_seeds=No args["Hires resize"] = f"{p.hr_resize_x}x{p.hr_resize_y}" args["Hires size"] = f"{p.hr_upscale_to_x}x{p.hr_upscale_to_y}" args["Denoising strength"] = p.denoising_strength - args["Latent sampler"] = p.latent_sampler + args["Hires sampler"] = p.hr_sampler_name args["Image CFG scale"] = p.image_cfg_scale args["CFG rescale"] = p.diffusers_guidance_rescale if 'refine' in p.ops: @@ -643,7 +643,7 @@ def create_infotext(p: StableDiffusionProcessing, all_prompts=None, all_seeds=No args['Refiner steps'] = p.refiner_steps args['Refiner start'] = p.refiner_start args["Hires steps"] = p.hr_second_pass_steps - args["Latent sampler"] = p.latent_sampler + args["Hires sampler"] = p.hr_sampler_name args["CFG rescale"] = p.diffusers_guidance_rescale if 'img2img' in p.ops or 'inpaint' in p.ops: args["Init image size"] = f"{getattr(p, 'init_img_width', 0)}x{getattr(p, 'init_img_height', 0)}" @@ -1129,7 +1129,7 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing): self.is_hr_pass = True hypertile_set(self, hr=True) shared.state.job_count = 2 * self.n_iter - shared.log.debug(f'Init hires: upscaler="{self.hr_upscaler}" sampler="{self.latent_sampler}" resize={self.hr_resize_x}x{self.hr_resize_y} upscale={self.hr_upscale_to_x}x{self.hr_upscale_to_y}') + shared.log.debug(f'Init hires: upscaler="{self.hr_upscaler}" sampler="{self.hr_sampler_name}" resize={self.hr_resize_x}x{self.hr_resize_y} upscale={self.hr_upscale_to_x}x{self.hr_upscale_to_y}') def sample(self, conditioning, unconditional_conditioning, seeds, subseeds, subseed_strength, prompts): @@ -1198,14 +1198,14 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing): image_conditioning = self.img2img_image_conditioning(decode_first_stage(self.sd_model, samples.to(dtype=devices.dtype_vae), self.full_quality), samples) else: image_conditioning = self.txt2img_image_conditioning(samples.to(dtype=devices.dtype_vae)) - if self.latent_sampler == "PLMS": - self.latent_sampler = 'UniPC' + if self.hr_sampler_name == "PLMS": + self.hr_sampler_name = 'UniPC' if self.hr_force or latent_scale_mode is not None: shared.state.job = 'hires' if self.denoising_strength > 0: self.ops.append('hires') devices.torch_gc() # GC now before running the next img2img to prevent running out of memory - self.sampler = modules.sd_samplers.create_sampler(self.latent_sampler or self.sampler_name, self.sd_model) + self.sampler = modules.sd_samplers.create_sampler(self.hr_sampler_name or self.sampler_name, self.sd_model) if hasattr(self.sampler, "initialize"): self.sampler.initialize(self) samples = samples[:, :, self.truncate_y//2:samples.shape[2]-(self.truncate_y+1)//2, self.truncate_x//2:samples.shape[3]-(self.truncate_x+1)//2] diff --git a/modules/processing_diffusers.py b/modules/processing_diffusers.py index fb797faff..521c710e2 100644 --- a/modules/processing_diffusers.py +++ b/modules/processing_diffusers.py @@ -357,7 +357,7 @@ def process_diffusers(p: StableDiffusionProcessing): devices.torch_gc(force=True) def update_sampler(sd_model, second_pass=False): - sampler_selection = p.latent_sampler if second_pass else p.sampler_name + sampler_selection = p.hr_sampler_name if second_pass else p.sampler_name if sd_model.__class__.__name__ in ['AmusedPipeline']: return # models with their own schedulers if hasattr(sd_model, 'scheduler') and sampler_selection != 'Default': diff --git a/modules/txt2img.py b/modules/txt2img.py index 98004c492..5f88cb74c 100644 --- a/modules/txt2img.py +++ b/modules/txt2img.py @@ -11,7 +11,7 @@ debug('Trace: PROCESS') def txt2img(id_task, prompt, negative_prompt, prompt_styles, - steps, sampler_index, latent_index, + steps, sampler_index, hr_sampler_index, full_quality, restore_faces, tiling, n_iter, batch_size, cfg_scale, image_cfg_scale, diffusers_guidance_rescale, @@ -25,7 +25,7 @@ def txt2img(id_task, override_settings_texts, *args): - debug(f'txt2img: id_task={id_task}|prompt={prompt}|negative={negative_prompt}|styles={prompt_styles}|steps={steps}|sampler_index={sampler_index}|latent_index={latent_index}|full_quality={full_quality}|restore_faces={restore_faces}|tiling={tiling}|batch_count={n_iter}|batch_size={batch_size}|cfg_scale={cfg_scale}|clip_skip={clip_skip}|seed={seed}|subseed={subseed}|subseed_strength={subseed_strength}|seed_resize_from_h={seed_resize_from_h}|seed_resize_from_w={seed_resize_from_w}|height={height}|width={width}|enable_hr={enable_hr}|denoising_strength={denoising_strength}|hr_scale={hr_scale}|hr_upscaler={hr_upscaler}|hr_force={hr_force}|hr_second_pass_steps={hr_second_pass_steps}|hr_resize_x={hr_resize_x}|hr_resize_y={hr_resize_y}|image_cfg_scale={image_cfg_scale}|diffusers_guidance_rescale={diffusers_guidance_rescale}|refiner_steps={refiner_steps}|refiner_start={refiner_start}|refiner_prompt={refiner_prompt}|refiner_negative={refiner_negative}|override_settings={override_settings_texts}') + debug(f'txt2img: id_task={id_task}|prompt={prompt}|negative={negative_prompt}|styles={prompt_styles}|steps={steps}|sampler_index={sampler_index}|hr_sampler_index={hr_sampler_index}|full_quality={full_quality}|restore_faces={restore_faces}|tiling={tiling}|batch_count={n_iter}|batch_size={batch_size}|cfg_scale={cfg_scale}|clip_skip={clip_skip}|seed={seed}|subseed={subseed}|subseed_strength={subseed_strength}|seed_resize_from_h={seed_resize_from_h}|seed_resize_from_w={seed_resize_from_w}|height={height}|width={width}|enable_hr={enable_hr}|denoising_strength={denoising_strength}|hr_scale={hr_scale}|hr_upscaler={hr_upscaler}|hr_force={hr_force}|hr_second_pass_steps={hr_second_pass_steps}|hr_resize_x={hr_resize_x}|hr_resize_y={hr_resize_y}|image_cfg_scale={image_cfg_scale}|diffusers_guidance_rescale={diffusers_guidance_rescale}|refiner_steps={refiner_steps}|refiner_start={refiner_start}|refiner_prompt={refiner_prompt}|refiner_negative={refiner_negative}|override_settings={override_settings_texts}') if shared.sd_model is None: shared.log.warning('Model not loaded') @@ -34,8 +34,8 @@ def txt2img(id_task, override_settings = create_override_settings_dict(override_settings_texts) if sampler_index is None: sampler_index = 0 - if latent_index is None: - latent_index = 0 + if hr_sampler_index is None: + hr_sampler_index = 0 p = processing.StableDiffusionProcessingTxt2Img( sd_model=shared.sd_model, @@ -51,7 +51,7 @@ def txt2img(id_task, seed_resize_from_w=seed_resize_from_w, seed_enable_extras=True, sampler_name = processing.get_sampler_name(sampler_index), - latent_sampler = processing.get_sampler_name(latent_index), + hr_sampler_name = processing.get_sampler_name(hr_sampler_index), batch_size=batch_size, n_iter=n_iter, steps=steps, diff --git a/modules/ui.py b/modules/ui.py index 12324ff4a..363387bb7 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -465,7 +465,7 @@ def create_hires_inputs(tab): with FormRow(elem_id=f"{tab}_hires_row1"): enable_hr = gr.Checkbox(label='Enable second pass', value=False, elem_id=f"{tab}_enable_hr") with FormRow(elem_id=f"{tab}_hires_row2"): - latent_index = gr.Dropdown(label='Secondary sampler', elem_id=f"{tab}_sampling_alt", choices=[x.name for x in modules.sd_samplers.samplers], value='Default', type="index") + hr_sampler_index = gr.Dropdown(label='Secondary sampler', elem_id=f"{tab}_sampling_alt", choices=[x.name for x in modules.sd_samplers.samplers], value='Default', type="index") denoising_strength = gr.Slider(minimum=0.0, maximum=0.99, step=0.01, label='Denoising strength', value=0.5, elem_id=f"{tab}_denoising_strength") with FormRow(elem_id=f"{tab}_hires_finalres", variant="compact"): hr_final_resolution = FormHTML(value="", elem_id=f"{tab}_hr_finalres", label="Upscaled resolution", interactive=False) @@ -486,7 +486,7 @@ def create_hires_inputs(tab): refiner_prompt = gr.Textbox(value='', label='Secondary prompt', elem_id=f"{tab}_refiner_prompt") with FormRow(elem_id="txt2img_refiner_row4", variant="compact"): refiner_negative = gr.Textbox(value='', label='Secondary negative prompt', elem_id=f"{tab}_refiner_neg_prompt") - return enable_hr, latent_index, denoising_strength, hr_final_resolution, hr_upscaler, hr_force, hr_second_pass_steps, hr_scale, hr_resize_x, hr_resize_y, refiner_steps, refiner_start, refiner_prompt, refiner_negative + return enable_hr, hr_sampler_index, denoising_strength, hr_final_resolution, hr_upscaler, hr_force, hr_second_pass_steps, hr_scale, hr_resize_x, hr_resize_y, refiner_steps, refiner_start, refiner_prompt, refiner_negative def get_value_for_setting(key): @@ -543,7 +543,7 @@ def create_ui(startup_timer = None): batch_count, batch_size = create_batch_inputs('txt2img') seed, reuse_seed, subseed, reuse_subseed, subseed_strength, seed_resize_from_h, seed_resize_from_w = create_seed_inputs('txt2img') cfg_scale, clip_skip, image_cfg_scale, diffusers_guidance_rescale, full_quality, restore_faces, tiling, hdr_clamp, hdr_boundary, hdr_threshold, hdr_center, hdr_channel_shift, hdr_full_shift, hdr_maximize, hdr_max_center, hdr_max_boundry = create_advanced_inputs('txt2img') - enable_hr, latent_index, denoising_strength, hr_final_resolution, hr_upscaler, hr_force, hr_second_pass_steps, hr_scale, hr_resize_x, hr_resize_y, refiner_steps, refiner_start, refiner_prompt, refiner_negative = create_hires_inputs('txt2img') + enable_hr, hr_sampler_index, denoising_strength, hr_final_resolution, hr_upscaler, hr_force, hr_second_pass_steps, hr_scale, hr_resize_x, hr_resize_y, refiner_steps, refiner_start, refiner_prompt, refiner_negative = create_hires_inputs('txt2img') override_settings = create_override_inputs('txt2img') txt2img_script_inputs = modules.scripts.scripts_txt2img.setup_ui() @@ -567,7 +567,7 @@ def create_ui(startup_timer = None): txt2img_args = [ dummy_component, txt2img_prompt, txt2img_negative_prompt, txt2img_prompt_styles, - steps, sampler_index, latent_index, + steps, sampler_index, hr_sampler_index, full_quality, restore_faces, tiling, batch_count, batch_size, cfg_scale, image_cfg_scale, diffusers_guidance_rescale, @@ -623,7 +623,7 @@ def create_ui(startup_timer = None): (tiling, "Tiling"), # second pass (enable_hr, "Second pass"), - (latent_index, "Latent sampler"), + (hr_sampler_index, "Hires sampler"), (denoising_strength, "Denoising strength"), (hr_upscaler, "Hires upscaler"), (hr_force, "Hires force"), @@ -794,7 +794,7 @@ def create_ui(startup_timer = None): init_img_inpaint, init_mask_inpaint, steps, - sampler_index, latent_index, + sampler_index, hr_sampler_index, mask_blur, mask_alpha, inpainting_fill, full_quality, restore_faces, tiling, @@ -1025,8 +1025,8 @@ def create_ui(startup_timer = None): shared.log.warning("OpenVINO: Setting backend to Diffusers") shared.opts.sd_backend = "diffusers" try: - opts.save(shared.config_filename) if len(changed) > 0: + opts.save(shared.config_filename) log.info(f'Settings: changed={len(changed)} {changed}') except RuntimeError: log.error(f'Settings failed: change={len(changed)} {changed}') diff --git a/modules/ui_control.py b/modules/ui_control.py index 42aab6457..1d547bfb5 100644 --- a/modules/ui_control.py +++ b/modules/ui_control.py @@ -355,7 +355,7 @@ def create_ui(_blocks: gr.Blocks=None): input_mode = gr.Label(value='select', visible=False) input_image = gr.Image(label="Input", show_label=False, type="pil", source="upload", interactive=True, tool="editor", height=gr_height, visible=True, image_mode='RGB', elem_id='control_input_select') input_resize = gr.Image(label="Input", show_label=False, type="pil", source="upload", interactive=True, tool="select", height=gr_height, visible=False, image_mode='RGB', elem_id='control_input_resize') - input_inpaint = gr.Image(label="Input", show_label=False, type="pil", source="upload", interactive=True, tool="sketch", height=gr_height, visible=False, image_mode='RGB', elem_id='control_input_inpaint') + input_inpaint = gr.Image(label="Input", show_label=False, type="pil", source="upload", interactive=True, tool="sketch", height=gr_height, visible=False, image_mode='RGB', elem_id='control_input_inpaint', brush_radius=64, mask_opacity=0.6) with gr.Row(): input_buttons = [gr.Button('Select', visible=True, interactive=False), gr.Button('Inpaint', visible=True, interactive=True), gr.Button('Outpaint', visible=True, interactive=True)] with gr.Tab('Video', id='in-video') as tab_video: diff --git a/scripts/xyz_grid.py b/scripts/xyz_grid.py index f6fc5d553..d51494e2a 100644 --- a/scripts/xyz_grid.py +++ b/scripts/xyz_grid.py @@ -62,12 +62,12 @@ def apply_sampler(p, x, xs): else: p.sampler_name = sampler_name -def apply_latent_sampler(p, x, xs): - latent_sampler = sd_samplers.samplers_map.get(x.lower(), None) - if latent_sampler is None: +def apply_hr_sampler_name(p, x, xs): + hr_sampler_name = sd_samplers.samplers_map.get(x.lower(), None) + if hr_sampler_name is None: shared.log.warning(f"XYZ grid: unknown sampler: {x}") else: - p.latent_sampler = latent_sampler + p.hr_sampler_name = hr_sampler_name def confirm_samplers(p, xs): for x in xs: @@ -249,7 +249,7 @@ axis_options = [ AxisOption("[Sampler] ETA", float, apply_field("eta")), AxisOption("[Sampler] Solver order", int, apply_setting("schedulers_solver_order")), AxisOption("[Second pass] Upscaler", str, apply_field("hr_upscaler"), choices=lambda: [*shared.latent_upscale_modes, *[x.name for x in shared.sd_upscalers]]), - AxisOption("[Second pass] Sampler", str, apply_latent_sampler, fmt=format_value, confirm=confirm_samplers, choices=lambda: [x.name for x in sd_samplers.samplers]), + AxisOption("[Second pass] Sampler", str, apply_hr_sampler_name, fmt=format_value, confirm=confirm_samplers, choices=lambda: [x.name for x in sd_samplers.samplers]), AxisOption("[Second pass] Denoising Strength", float, apply_field("denoising_strength")), AxisOption("[Second pass] Hires steps", int, apply_field("hr_second_pass_steps")), AxisOption("[Second pass] CFG scale", float, apply_field("image_cfg_scale")),