Add Dumas character helper node

This commit is contained in:
2026-08-14 13:07:58 +00:00
parent f261a048b7
commit 49cb16338d
3 changed files with 257 additions and 0 deletions
+58
View File
@@ -239,6 +239,64 @@ class DumasImageNodeTests(unittest.TestCase):
saved_path = FakePILImage.saved_paths[0][0]
self.assertTrue(os.path.isdir(os.path.dirname(saved_path)))
def test_character_helper_passes_through_images_and_formats_text(self):
node = self.image_nodes.DumasCharacterHelperNode()
image1 = FakeTensorBatch()
image2 = FakeTensorBatch()
result = node.build_character_text(
image1=image1,
image2=image2,
image1_picture_id="2",
image2_picture_id="3",
character_id="char_dave",
name="Dave",
height_feet="6",
height_inches="2",
accent="northern English",
general="wears a long grey coat",
)
self.assertIs(result[0], image1)
self.assertIs(result[1], image2)
self.assertEqual(
result[2],
(
"<Picture 2> and <Picture 3> reference the same character who is called Dave.\n"
"<Picture 2> is the primary full-body reference for Dave.\n"
'The character ID string is "char_dave".\n'
"Dave is 6'2\" tall.\n"
"Dave has a northern English accent.\n"
"wears a long grey coat."
),
)
def test_character_helper_handles_missing_optional_fields(self):
node = self.image_nodes.DumasCharacterHelperNode()
image1 = FakeTensorBatch()
image2 = FakeTensorBatch()
result = node.build_character_text(
image1=image1,
image2=image2,
image1_picture_id="4",
image2_picture_id="6",
character_id="",
name="",
height_feet="",
height_inches="",
accent="",
general="",
)
self.assertEqual(
result[2],
(
"<Picture 4> and <Picture 6> reference the same character.\n"
"<Picture 4> is the primary full-body reference for the character."
),
)
def test_save_image_returns_ui_entries_for_output_folder(self):
node = self.image_nodes.DumasSaveImageNode()
image = FakeTensorBatch()