feat: add config and option for uov prompt type

This commit is contained in:
Manuel Schmid
2024-06-24 21:21:11 +02:00
parent 9f9fcfa7ad
commit 00a27e7400
4 changed files with 30 additions and 7 deletions
+7 -5
View File
@@ -117,6 +117,7 @@ class AsyncTask:
self.enhance_checkbox = args.pop()
self.enhance_uov_method = args.pop()
self.enhance_uov_processing_order = args.pop()
self.enhance_uov_prompt_type = args.pop()
self.enhance_ctrls = []
for _ in range(modules.config.default_enhance_tabs):
enhance_enabled = args.pop()
@@ -1036,7 +1037,7 @@ def worker():
exception_result = ''
if len(goals_enhance) > 0:
try:
current_progress, img = process_enhance(
current_progress, img, prompt, negative_prompt = process_enhance(
all_steps, async_task, callback, controlnet_canny_path,
controlnet_cpds_path, current_progress, current_task_id, denoising_strength, False,
'None', 0.0, 0.0, prompt, negative_prompt, final_scheduler_name,
@@ -1385,10 +1386,11 @@ def worker():
preparation_steps, enhance_steps, switch, tiled, total_count, use_expansion, use_style,
use_synthetic_refiner, width)
if enhance_prompt_processed != '':
last_enhance_prompt = enhance_prompt_processed
if enhance_negative_prompt_processed != '':
last_enhance_negative_prompt = enhance_negative_prompt_processed
if async_task.enhance_uov_prompt_type == flags.enhancement_uov_prompt_type_last:
if enhance_prompt_processed != '':
last_enhance_prompt = enhance_prompt_processed
if enhance_negative_prompt_processed != '':
last_enhance_negative_prompt = enhance_negative_prompt_processed
except ldm_patched.modules.model_management.InterruptProcessingException:
if async_task.last_stop == 'skip':
+6
View File
@@ -521,6 +521,12 @@ enhance_uov_processing_order = get_config_item_or_set_default(
validator=lambda x: x in modules.flags.enhancement_uov_processing_order,
expected_type=int
)
enhance_uov_prompt_type = get_config_item_or_set_default(
key='default_enhance_uov_prompt_type',
default_value=modules.flags.enhancement_uov_prompt_type_last,
validator=lambda x: x in modules.flags.enhancement_uov_prompt_types,
expected_type=int
)
default_sam_max_detections = get_config_item_or_set_default(
key='default_sam_max_detections',
default_value=0,
+4
View File
@@ -21,6 +21,10 @@ enhancement_uov_processing_order = [
(enhancement_uov_after_label, enhancement_uov_after)
]
enhancement_uov_prompt_type_original = 'Original Prompts'
enhancement_uov_prompt_type_last = 'Last Filled Enhancement Prompts'
enhancement_uov_prompt_types = [enhancement_uov_prompt_type_original, enhancement_uov_prompt_type_last]
CIVITAI_NO_KARRAS = ["euler", "euler_ancestral", "heun", "dpm_fast", "dpm_adaptive", "ddim", "uni_pc"]
# fooocus: a1111 (Civitai)