1. Add remove_prompt_emphasis function to Prompt Combiner.
2. Update Portrait Master + Random Prompter imgen workflow.
This commit is contained in:
jakechai
2025-11-15 15:32:52 +08:00
parent 55651a4bdd
commit 77522878ed
15 changed files with 52 additions and 16 deletions
+9 -1
View File
@@ -344,9 +344,13 @@ If you like what I share, please support me with [PayPal](https://paypal.me/jake
4. Add shot size and view angle choices for Random Prompter, useful when using QWen Edit 2509 Multiple Angles Lora.
- 2025-11-14 - v2.3.6
1. Random Prompter Geek supports custom selection of database random processing and reserved LLM processing, retaining the advantage of database random processing in certain aspects of semantic accuracy, and making the most of the more possibilities that LLM can provide in other aspects.
1. Random Prompter Geek supports the custom selection of database random processing and reserved LLM processing, retaining the advantages of database random processing in certain aspects of semantic accuracy while leveraging the possibilities that LLM can provide in other elements.
2. Fix some typo issues.
- 2025-11-15 - v2.3.7
1. Add remove_prompt_emphasis function to Prompt Combiner.
2. Update Portrait Master + Random Prompter imgen workflow.
## Installation
1. `git clone https://github.com/jakechai/ComfyUI-JakeUpgrade` into the `custom_nodes` folder
- e.g. `custom_nodes\ComfyUI-JakeUpgrade`
@@ -428,6 +432,10 @@ Shot Script Combiner JK🐉: Combine shot scripts into string list output.
Shot Script Extractor JK🐉: Extract specific element from shot script or string list based on index.
![image](imgs/nodes/Prompt/Prompt%20Combine%20JK.png)
Prompt Combine JK🐉: Merge the two strings into one and clean up the result.
![image](imgs/nodes/Prompt/promptworkflow.png)
Prompt node exsample 01: In conjunction with QWen VL, input different system prompts from the System Prompter node to generate a single image or shot script list, supporting JSON format output. The workflow is embedded in the image.
![image](imgs/nodes/Prompt/sysprompterworkflow.png)
Prompt node exsample 02: Random Prompter Geek supports the custom selection of database random processing and reserved LLM processing, retaining the advantages of database random processing in certain aspects of semantic accuracy while leveraging the possibilities that LLM can provide in other elements. The workflow is embedded in the image.
- ControlNet Nodes
![image](imgs/nodes/ControlNet/ControlNet%20Loader%20JK.png)
ControlNet Loader JK🐉: Load ControlNet models with configurable union types.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 KiB

+13 -1
View File
@@ -1935,6 +1935,7 @@ class SysPromptBuilder:
(["first_shot_02"] if input_as_1st_shot else []),
["detail_preset", detail],
[model_type, "script", "part_04"],
(["first_shot_03"] if input_as_1st_shot else []),
["add_json_detail", "script", json_key],
["json_detail", "description"],
[model_type, "script", "part_05"],
@@ -1951,6 +1952,7 @@ class SysPromptBuilder:
(["first_shot_02"] if input_as_1st_shot else []),
["detail_preset", detail],
[model_type, "script", "part_04"],
(["first_shot_03"] if input_as_1st_shot else []),
["add_json_detail", "script", json_key],
[model_type, "script", "part_05"],
["combine_shots"]
@@ -2567,6 +2569,10 @@ class PromptCombine_JK:
"default": True,
"tooltip": "Preserve original format of prompts (including line breaks)"
}),
"remove_prompt_emphasis": ("BOOLEAN", {
"default": True,
"tooltip": "Remove emphasis symbols and weight markers from custom_subject (e.g., (word:1.5) -> word, [A:B:0.5] -> A-B)"
}),
},
}
@@ -2576,12 +2582,15 @@ class PromptCombine_JK:
CATEGORY = icons.get("JK/Prompt")
DESCRIPTION = "Merge the two strings into one and clean up the result."
def combine(self, prompt_1=None, prompt_2=None, preserve_format=True):
def combine(self, prompt_1=None, prompt_2=None, preserve_format=True, remove_prompt_emphasis=True):
# 根据 preserve_format 参数选择处理方式
if preserve_format:
# 保持原始格式,使用换行符作为分隔符
processed_1 = ShotScriptUtils.preserve_format(prompt_1) if prompt_1 else ""
processed_2 = ShotScriptUtils.preserve_format(prompt_2) if prompt_2 else ""
if remove_prompt_emphasis:
processed_1 = PromptUtils.remove_prompt_emphasis(processed_1)
processed_2 = PromptUtils.remove_prompt_emphasis(processed_2)
# 使用换行符连接两个字符串
elements = []
@@ -2595,6 +2604,9 @@ class PromptCombine_JK:
# 清理两个输入字符串
processed_1 = DataCleaner.clean_prompt_string(prompt_1) if prompt_1 else ""
processed_2 = DataCleaner.clean_prompt_string(prompt_2) if prompt_2 else ""
if remove_prompt_emphasis:
processed_1 = PromptUtils.remove_prompt_emphasis(processed_1)
processed_2 = PromptUtils.remove_prompt_emphasis(processed_2)
# 检查 processed_1 的结尾是否有标点符号
ends_with_punctuation = False
+13 -1
View File
@@ -2377,6 +2377,7 @@ class SysPromptBuilder:
(["first_shot_02"] if input_as_1st_shot else []),
["detail_preset", detail],
[model_type, "script", "part_04"],
(["first_shot_03"] if input_as_1st_shot else []),
["add_json_detail", "script", json_key],
["json_detail", "description"],
[model_type, "script", "part_05"],
@@ -2393,6 +2394,7 @@ class SysPromptBuilder:
(["first_shot_02"] if input_as_1st_shot else []),
["detail_preset", detail],
[model_type, "script", "part_04"],
(["first_shot_03"] if input_as_1st_shot else []),
["add_json_detail", "script", json_key],
[model_type, "script", "part_05"],
["combine_shots"]
@@ -3009,6 +3011,10 @@ class PromptCombine_JK:
"default": True,
"tooltip": "Preserve original format of prompts (including line breaks)"
}),
"remove_prompt_emphasis": ("BOOLEAN", {
"default": True,
"tooltip": "Remove emphasis symbols and weight markers from custom_subject (e.g., (word:1.5) -> word, [A:B:0.5] -> A-B)"
}),
},
}
@@ -3018,12 +3024,15 @@ class PromptCombine_JK:
CATEGORY = icons.get("JK/Prompt")
DESCRIPTION = "Merge the two strings into one and clean up the result."
def combine(self, prompt_1=None, prompt_2=None, preserve_format=True):
def combine(self, prompt_1=None, prompt_2=None, preserve_format=True, remove_prompt_emphasis=True):
# 根据 preserve_format 参数选择处理方式
if preserve_format:
# 保持原始格式,使用换行符作为分隔符
processed_1 = ShotScriptUtils.preserve_format(prompt_1) if prompt_1 else ""
processed_2 = ShotScriptUtils.preserve_format(prompt_2) if prompt_2 else ""
if remove_prompt_emphasis:
processed_1 = PromptUtils.remove_prompt_emphasis(processed_1)
processed_2 = PromptUtils.remove_prompt_emphasis(processed_2)
# 使用换行符连接两个字符串
elements = []
@@ -3037,6 +3046,9 @@ class PromptCombine_JK:
# 清理两个输入字符串
processed_1 = DataCleaner.clean_prompt_string(prompt_1) if prompt_1 else ""
processed_2 = DataCleaner.clean_prompt_string(prompt_2) if prompt_2 else ""
if remove_prompt_emphasis:
processed_1 = PromptUtils.remove_prompt_emphasis(processed_1)
processed_2 = PromptUtils.remove_prompt_emphasis(processed_2)
# 检查 processed_1 的结尾是否有标点符号
ends_with_punctuation = False
+14 -10
View File
@@ -2,7 +2,7 @@
"text":{
"single":{
"part_01": {
"en": "This is a brand new request. You are an expert in creating image generation prompts. Please rewrite and generate new prompts based on the user-input text description. No need to output the process and note, only the result. Requirements: \n\n1. The rewritten paragraph must maintain the same intent as the original; Follow the original text's content order and structure to ensure clear information hierarchy; \n2. ",
"en": "This is a brand new request, ignore previous generation results. \nYou are an expert in creating image generation prompts. Please rewrite and generate new prompts based on the user-input text description. No need to output the process and note, only the result. Requirements: \n\n1. The rewritten paragraph must maintain the same intent as the original; Follow the original text's content order and structure to ensure clear information hierarchy; \n2. ",
"cn": "这是一个全新的需求,忽略之前的生成结果。\n你是一位图像生成提示词撰写专家,请根据用户输入的文本描述改写生成新的提示词,无需输出过程和注释,仅输出结果。要求:\n\n1. 改写后的段落,必须和改写前的意图一致;遵循原文本描述的内容顺序结构,确保信息的层次清晰;\n2. "
},
"part_02": {
@@ -12,7 +12,7 @@
},
"script":{
"part_01": {
"en": "This is a brand new request. You are an expert in creating shot script prompts. Please rewrite and create shot scripts based on the user-input text description. No need to output the process and note, only the result. Requirements: \n\n1. The rewritten paragraph must maintain the same intent as the original; Follow the original text's content order and structure to ensure clear information hierarchy; \n2. ",
"en": "This is a brand new request, ignore previous generation results. \nYou are an expert in creating shot script prompts. Please rewrite and create shot scripts based on the user-input text description. No need to output the process and note, only the result. Requirements: \n\n1. The rewritten paragraph must maintain the same intent as the original; Follow the original text's content order and structure to ensure clear information hierarchy; \n2. ",
"cn": "这是一个全新的需求,忽略之前的生成结果。\n你是一位电影分镜脚本撰写专家,请根据用户输入的文本描述改写并创作分镜脚本,无需输出过程和注释,仅输出结果。要求:\n\n1. 改写后的段落,必须和改写前的意图一致;遵循原文本描述的内容顺序结构,确保信息的层次清晰;\n2. "
},
"part_02": {
@@ -40,7 +40,7 @@
"image": {
"single":{
"part_01": {
"en": "This is a brand new request. You are an expert in creating image generation prompts. Please create prompts based on the reference image. No need to output the process and note, only the result. Requirements: \n\n1. Based on the reference image, ",
"en": "This is a brand new request, ignore previous generation results. \nYou are an expert in creating image generation prompts. Please create prompts based on the reference image. No need to output the process and note, only the result. Requirements: \n\n1. Based on the reference image, ",
"cn": "这是一个全新的需求,忽略之前的生成结果。\n你是一位图像生成提示词撰写专家,请根据参考图编写提示词,无需输出过程和注释,仅输出结果。要求:\n\n1. 根据参考图,"
},
"part_02": {
@@ -50,7 +50,7 @@
},
"script":{
"part_01": {
"en": "This is a brand new request. You are an expert in creating shot script prompts. Please create shot scripts based on the reference image. No need to output the process and note, only the result. Requirements: \n\n1. Based on the reference image, ",
"en": "This is a brand new request, ignore previous generation results. \nYou are an expert in creating shot script prompts. Please create shot scripts based on the reference image. No need to output the process and note, only the result. Requirements: \n\n1. Based on the reference image, ",
"cn": "这是一个全新的需求,忽略之前的生成结果。\n你是一位电影分镜脚本撰写专家,请根据参考图创作分镜脚本,无需输出过程和注释,仅输出结果。要求:\n\n1. 根据参考图,"
},
"part_02": {
@@ -105,8 +105,8 @@
},
"script": {
"json_detail": {
"en": "Split the detailed descriptions for each generated shot script, ",
"cn": "将每个生成的分镜提示词进行细节描述的拆分,"
"en": "Split the detailed descriptions for each all shot scripts, ",
"cn": "对所有分镜头脚本进行细节描述的拆分,"
},
"no_json_detail": {
"en": "Each shot script is the generated <specified_language> language shot script; \n",
@@ -116,19 +116,23 @@
},
"split_shots": {
"en": "Create <shot_count> shot scripts based on the story's development, ensuring they align with the previous intent; follow the story and content sequence structure described in it, and ensure that the information hierarchy is clear, the continuity of elements between shots, and the connection of camera framing, perspective and movement; \n",
"cn": "根据故事发展,创作<shot_count>个分镜脚本,必须和之前的意图一致;遵循其中描述的故事及内容顺序结构,确保信息的层次清晰、前后镜头之间各元素的延续以及相机的景别、视角和运动的衔接;\n"
"cn": "根据故事发展,创作<shot_count>个分镜头,必须和之前的意图一致;遵循其中描述的故事及内容顺序结构,确保信息的层次清晰、前后镜头之间各元素的延续以及相机的景别、视角和运动的衔接;\n"
},
"combine_shots": {
"en": "Combine all shot scripts into a JSON format with keys representing shot numbers: {'shot01': '', 'shot02': '', ...}. \n",
"cn": "将各个分镜头脚本放在按JSON文件代表对应镜头编号的英文名称简写中,{'shot01': '', 'shot02': ...}。\n"
"en": "Combine all shot scripts into a JSON format with keys representing shot numbers. \n",
"cn": "将所有分镜头脚本放在按JSON文件代表对应镜头编号的英文名称简写中。\n"
},
"first_shot_01": {
"en": "And use this prompt as the first shot script;",
"cn": "并将这个提示词作为第一个分镜头提示词;"
"cn": "并将这个提示词作为第一个分镜头脚本;"
},
"first_shot_02": {
"en": "(except for the first shot)",
"cn": "(第一个分镜头除外)"
},
"first_shot_03": {
"en": "(including the first shot)",
"cn": "(包括第一个分镜头)"
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "comfyui-jakeupgrade"
description = "ComfyUI workflow customization by Jake."
version = "2.3.6"
version = "2.3.7"
license = {file = "LICENSE"}
dependencies = ["opencv-python", "piexif", "torch", "torchvision", "numpy", "pillow", "simpleeval", "functools", "PyYAML", "toml"]