From 7d4ab8fdd43b284443fade1fc1bc4b7e1b13910a Mon Sep 17 00:00:00 2001 From: Chris Dumas Date: Fri, 14 Aug 2026 13:19:57 +0000 Subject: [PATCH] Add gender to character helper --- README.md | 4 ++-- dumas_image_nodes.py | 15 +++++++++++++++ tests/test_dumas_image_nodes.py | 3 +++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 02004a9..36f71d0 100644 --- a/README.md +++ b/README.md @@ -28,10 +28,10 @@ - Reads back the seven optional images for a selected MiniMax H3 plan scene, for example by connecting the current `clip_index`. - `Dumas Character Helper` - - Inputs: `image1`, `image2`, `image1_picture_id`, `image2_picture_id`, `character_id`, `name`, `alias`, `age`, `nationality`, `occupation`, `height_feet`, `height_inches`, `accent`, `general` + - Inputs: `image1`, `image2`, `image1_picture_id`, `image2_picture_id`, `character_id`, `name`, `alias`, `gender`, `age`, `nationality`, `occupation`, `height_feet`, `height_inches`, `accent`, `general` - Outputs: `image1`, `image2`, `character_text` - Passes both images through unchanged and builds a character reference string such as ` and reference the same character who is called Dave.` - - Appends optional sentences for non-visual facts such as ID, alias, age, nationality, occupation, height, accent, and freeform notes only when those fields are valid and filled in. + - Appends optional sentences for non-visual facts such as ID, alias, gender, age, nationality, occupation, height, accent, and freeform notes only when those fields are valid and filled in. - `Dumas JSON String to Object` - Input: `json_string` diff --git a/dumas_image_nodes.py b/dumas_image_nodes.py index 8076c8a..4de0a70 100644 --- a/dumas_image_nodes.py +++ b/dumas_image_nodes.py @@ -316,6 +316,7 @@ def _build_character_helper_text( character_id, name, alias, + gender, age, nationality, occupation, @@ -329,6 +330,7 @@ def _build_character_helper_text( character_name = _normalize_free_text(name) character_id = _normalize_free_text(character_id) alias = _normalize_free_text(alias) + gender = _normalize_free_text(gender) nationality = _normalize_free_text(nationality) occupation = _normalize_free_text(occupation) accent = _normalize_free_text(accent) @@ -364,6 +366,9 @@ def _build_character_helper_text( if alias: lines.append(f"{character_label} is also known as {alias}.") + if gender: + lines.append(f"{character_label} is {gender}.") + if age_value is not None: lines.append(f"{character_label} is {age_value} years old.") @@ -848,6 +853,14 @@ class DumasCharacterHelperNode: "tooltip": "Optional alternate name, codename, or nickname.", }, ), + "gender": ( + "STRING", + { + "default": "", + "multiline": False, + "tooltip": "Optional gender field for non-visual character facts.", + }, + ), "age": ( "STRING", { @@ -914,6 +927,7 @@ class DumasCharacterHelperNode: character_id, name, alias, + gender, age, nationality, occupation, @@ -928,6 +942,7 @@ class DumasCharacterHelperNode: character_id, name, alias, + gender, age, nationality, occupation, diff --git a/tests/test_dumas_image_nodes.py b/tests/test_dumas_image_nodes.py index a3cf631..c263d91 100644 --- a/tests/test_dumas_image_nodes.py +++ b/tests/test_dumas_image_nodes.py @@ -252,6 +252,7 @@ class DumasImageNodeTests(unittest.TestCase): character_id="char_dave", name="Dave", alias="The Locksmith", + gender="male", age="41", nationality="English", occupation="a detective", @@ -271,6 +272,7 @@ class DumasImageNodeTests(unittest.TestCase): " is a frontal facial reference for Dave.\n" 'The character ID string is "char_dave".\n' "Dave is also known as The Locksmith.\n" + "Dave is male.\n" "Dave is 41 years old.\n" "Dave is English.\n" "Dave works as a detective.\n" @@ -293,6 +295,7 @@ class DumasImageNodeTests(unittest.TestCase): character_id="", name="", alias="", + gender="", age="unknown", nationality="", occupation="",