mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
improve params pasting
This commit is contained in:
@@ -351,7 +351,7 @@ def connect_paste(button, local_paste_fields, input_comp, override_settings_comp
|
||||
prompt = file.read()
|
||||
else:
|
||||
prompt = ''
|
||||
shared.log.debug(f'paste prompt: {prompt}')
|
||||
shared.log.debug(f'Paste prompt: {prompt}')
|
||||
params = parse_generation_parameters(prompt)
|
||||
script_callbacks.infotext_pasted_callback(prompt, params)
|
||||
res = []
|
||||
|
||||
@@ -27,7 +27,8 @@ from modules.shared import opts, log
|
||||
round_bracket_multiplier = 1.1
|
||||
square_bracket_multiplier = 1.0 / 1.1
|
||||
re_AND = re.compile(r"\bAND\b")
|
||||
re_weight = re.compile(r"^(.*?)(?:\s*:\s*([-+]?(?:\d+\.?|\d*\.\d+)))?\s*$")
|
||||
# re_weight = re.compile(r"^(.*?)(?:\s*:\s*([-+]?(?:\d+\.?|\d*\.\d+)))?\s*$")
|
||||
re_weight = re.compile(r"^((?:\s|.)*?)(?:\s*:\s*([-+]?(?:\d+\.?|\d*\.\d+)))?\s*$")
|
||||
ScheduledPromptConditioning = namedtuple("ScheduledPromptConditioning", ["end_at_step", "cond"])
|
||||
schedule_parser = lark.Lark(r"""
|
||||
!start: (prompt | /[][():]/+)*
|
||||
|
||||
+27
-16
@@ -44,6 +44,7 @@ def gr_show(visible=True):
|
||||
|
||||
sample_img2img = "assets/stable-samples/img2img/sketch-mountains-input.jpg"
|
||||
sample_img2img = sample_img2img if os.path.exists(sample_img2img) else None
|
||||
paste_function = None
|
||||
|
||||
# Using constants for these since the variation selector isn't visible.
|
||||
# Important that they exactly match script.js for tooltip to work.
|
||||
@@ -471,22 +472,23 @@ def create_ui(startup_timer = None):
|
||||
(txt2img_prompt, "Prompt"),
|
||||
(txt2img_negative_prompt, "Negative prompt"),
|
||||
(steps, "Steps"),
|
||||
(sampler_index, "Sampler"),
|
||||
(latent_index, "Latent sampler"),
|
||||
(restore_faces, "Face restoration"),
|
||||
(cfg_scale, "CFG scale"),
|
||||
(clip_skip, "Clip skip"),
|
||||
(seed, "Seed"),
|
||||
(sampler_index, "Sampler"),
|
||||
(cfg_scale, "CFG scale"),
|
||||
(width, "Size-1"),
|
||||
(height, "Size-2"),
|
||||
(batch_size, "Batch size"),
|
||||
(subseed, "Variation seed"),
|
||||
(subseed_strength, "Variation strength"),
|
||||
(clip_skip, "Clip skip"),
|
||||
(latent_index, "Latent sampler"),
|
||||
(denoising_strength, "Denoising strength"),
|
||||
(refiner_denoise_start, "Denoising strength"),
|
||||
(refiner_denoise_end, "Denoising end"),
|
||||
(restore_faces, "Face restoration"),
|
||||
(batch_size, "Batch size"),
|
||||
(batch_count, "Batch count"),
|
||||
(seed_resize_from_w, "Seed resize from-1"),
|
||||
(seed_resize_from_h, "Seed resize from-2"),
|
||||
(denoising_strength, "Denoising strength"),
|
||||
(show_second_pass, lambda d: "Denoising strength" in d),
|
||||
(show_second_pass, lambda d: gr.Row.update(visible="Denoising strength" in d)),
|
||||
(hr_scale, "Hires upscale"),
|
||||
(hr_upscaler, "Hires upscaler"),
|
||||
(hr_second_pass_steps, "Hires steps"),
|
||||
@@ -824,20 +826,29 @@ def create_ui(startup_timer = None):
|
||||
(img2img_prompt, "Prompt"),
|
||||
(img2img_negative_prompt, "Negative prompt"),
|
||||
(steps, "Steps"),
|
||||
(sampler_index, "Sampler"),
|
||||
(restore_faces, "Face restoration"),
|
||||
(cfg_scale, "CFG scale"),
|
||||
(image_cfg_scale, "Image CFG scale"),
|
||||
(clip_skip, "Clip skip"),
|
||||
(seed, "Seed"),
|
||||
(sampler_index, "Sampler"),
|
||||
(cfg_scale, "CFG scale"),
|
||||
(width, "Size-1"),
|
||||
(height, "Size-2"),
|
||||
(batch_size, "Batch size"),
|
||||
(subseed, "Variation seed"),
|
||||
(subseed_strength, "Variation strength"),
|
||||
(clip_skip, "Clip skip"),
|
||||
(latent_index, "Latent sampler"),
|
||||
(denoising_strength, "Denoising strength"),
|
||||
(refiner_denoise_start, "Denoising strength"),
|
||||
(refiner_denoise_end, "Denoising end"),
|
||||
(restore_faces, "Face restoration"),
|
||||
(batch_size, "Batch size"),
|
||||
(batch_count, "Batch count"),
|
||||
(seed_resize_from_w, "Seed resize from-1"),
|
||||
(seed_resize_from_h, "Seed resize from-2"),
|
||||
(denoising_strength, "Denoising strength"),
|
||||
(hr_scale, "Hires upscale"),
|
||||
(hr_upscaler, "Hires upscaler"),
|
||||
(hr_second_pass_steps, "Hires steps"),
|
||||
(hr_resize_x, "Hires resize-1"),
|
||||
(hr_resize_y, "Hires resize-2"),
|
||||
(image_cfg_scale, "Image CFG scale"),
|
||||
(mask_blur, "Mask blur"),
|
||||
*modules.scripts.scripts_img2img.infotext_fields
|
||||
]
|
||||
|
||||
+1
-1
Submodule wiki updated: bdc13d7053...6257ac57cc
Reference in New Issue
Block a user