fix invalid config values

This commit is contained in:
Vladimir Mandic
2023-07-16 16:01:01 -04:00
parent 7a859cdb18
commit a9e2d90a47
3 changed files with 13 additions and 6 deletions
+5 -3
View File
@@ -69,14 +69,16 @@ def img2img(id_task: str, mode: int, prompt: str, negative_prompt: str, prompt_s
shared.log.warning('Model not loaded')
return [], '', '', 'Error: model not loaded'
shared.log.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}|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}|inpaint_full_res={inpaint_full_res}|inpaint_full_res_padding={inpaint_full_res_padding}|inpainting_mask_invert={inpainting_mask_invert}|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}|args={args}')
if init_img is None:
shared.log.debug('Init image not set')
shared.log.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}|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}|inpaint_full_res={inpaint_full_res}|inpaint_full_res_padding={inpaint_full_res_padding}|inpainting_mask_invert={inpainting_mask_invert}|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}|args={args}')
if sampler_index is None:
shared.log.warning('Selected sampler is not enabled')
sampler_index = 0
if latent_index is None:
latent_index = 0
override_settings = create_override_settings_dict(override_settings_texts)
is_batch = mode == 5
+5
View File
@@ -17,6 +17,11 @@ def txt2img(id_task: str, prompt: str, negative_prompt: str, prompt_styles, step
shared.log.warning('Model not loaded')
return [], '', '', 'Error: model not loaded'
if sampler_index is None:
sampler_index = 0
if latent_index is None:
latent_index = 0
p = processing.StableDiffusionProcessingTxt2Img(
sd_model=shared.sd_model,
outpath_samples=shared.opts.outdir_samples or shared.opts.outdir_txt2img_samples,
+3 -3
View File
@@ -52,14 +52,14 @@ def apply_order(p, x, xs):
def apply_sampler(p, x, xs):
sampler_name = sd_samplers.samplers_map.get(x, None)
sampler_name = sd_samplers.samplers_map.get(x.lower(), None)
if sampler_name is None:
shared.log.warning(f"XYZ grid: unknown sampler: {x}")
else:
p.sampler_name = sampler_name
def apply_latent_sampler(p, x, xs):
latent_sampler = sd_samplers.samplers_map.get(x, None)
latent_sampler = sd_samplers.samplers_map.get(x.lower(), None)
if latent_sampler is None:
shared.log.warning(f"XYZ grid: unknown sampler: {x}")
else:
@@ -67,7 +67,7 @@ def apply_latent_sampler(p, x, xs):
def confirm_samplers(p, xs):
for x in xs:
if x not in sd_samplers.samplers_map:
if x.lower() not in sd_samplers.samplers_map:
shared.log.warning(f"XYZ grid: unknown sampler: {x}")