From 2f36e0ff835ae0874faa3cfe90ed57eb76cef7ac Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Mon, 11 Dec 2023 18:58:02 +0200 Subject: [PATCH] Don't emit empty template/negative template into infotext (#695) --- sd_dynamic_prompts/dynamic_prompting.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sd_dynamic_prompts/dynamic_prompting.py b/sd_dynamic_prompts/dynamic_prompting.py index 966287ba..fe0caa9b 100644 --- a/sd_dynamic_prompts/dynamic_prompting.py +++ b/sd_dynamic_prompts/dynamic_prompting.py @@ -517,8 +517,11 @@ def process( ) if opts.dp_write_raw_template: - p.extra_generation_params["Template"] = original_prompt - p.extra_generation_params["Negative Template"] = original_negative_prompt + params = p.extra_generation_params + if original_prompt: + params["Template"] = original_prompt + if original_negative_prompt: + params["Negative Template"] = original_negative_prompt p.all_prompts = all_prompts p.all_negative_prompts = all_negative_prompts