Expose individual prompt reference descriptions
This commit is contained in:
+18
-2
@@ -1253,11 +1253,13 @@ def curate_h3_prompt(
|
||||
soundscape_text = _reference_text(soundscape)
|
||||
bgm_text = _reference_text(bgm)
|
||||
reference_description = ""
|
||||
individual_reference_descriptions = []
|
||||
if selected:
|
||||
reference_description = " ".join(
|
||||
individual_reference_descriptions = [
|
||||
_reference_context(ref, picture_number)
|
||||
for picture_number, (_slot, ref) in enumerate(selected, 1)
|
||||
)
|
||||
]
|
||||
reference_description = " ".join(individual_reference_descriptions)
|
||||
|
||||
prompt_parts = []
|
||||
_append_prompt_section(prompt_parts, "Scene anchor", anchor_text)
|
||||
@@ -1279,6 +1281,9 @@ def curate_h3_prompt(
|
||||
images.extend([None] * (_H3_PROMPT_REF_SLOTS - len(images)))
|
||||
selected_refs = [ref for _slot, ref in selected]
|
||||
selected_refs.extend([None] * (_H3_PROMPT_REF_SLOTS - len(selected_refs)))
|
||||
individual_reference_descriptions.extend(
|
||||
[""] * (_H3_PROMPT_REF_SLOTS - len(individual_reference_descriptions))
|
||||
)
|
||||
debug = (
|
||||
f"Selected {len(selected)} reference(s): "
|
||||
+ ", ".join(
|
||||
@@ -1298,6 +1303,7 @@ def curate_h3_prompt(
|
||||
bgm_text,
|
||||
*selected_refs[:_H3_PROMPT_REF_SLOTS],
|
||||
reference_description,
|
||||
*individual_reference_descriptions[:_H3_PROMPT_REF_SLOTS],
|
||||
)
|
||||
|
||||
|
||||
@@ -2691,6 +2697,7 @@ class DumasH3PromptCuratorNode:
|
||||
+ ("INT", "STRING", "STRING", "STRING", "STRING")
|
||||
+ (_REFERENCE_TYPE,) * _H3_PROMPT_REF_SLOTS
|
||||
+ ("STRING",)
|
||||
+ ("STRING",) * _H3_PROMPT_REF_SLOTS
|
||||
)
|
||||
RETURN_NAMES = (
|
||||
"prompt",
|
||||
@@ -2718,6 +2725,15 @@ class DumasH3PromptCuratorNode:
|
||||
"original_ref_8",
|
||||
"original_ref_9",
|
||||
"reference_description",
|
||||
"original_ref_description_1",
|
||||
"original_ref_description_2",
|
||||
"original_ref_description_3",
|
||||
"original_ref_description_4",
|
||||
"original_ref_description_5",
|
||||
"original_ref_description_6",
|
||||
"original_ref_description_7",
|
||||
"original_ref_description_8",
|
||||
"original_ref_description_9",
|
||||
)
|
||||
FUNCTION = "curate_prompt"
|
||||
CATEGORY = "Dumas/MiniMax"
|
||||
|
||||
Reference in New Issue
Block a user