Files
ComfyUI_frontend/tools/devtools/nodes/__init__.py
Glary-Bot e9ac55af59 test: add failing tests for DynamicCombo text preview inside subgraphs
Adds regression tests demonstrating that V3 DynamicCombo widget
serialization breaks when nodes are packed into subgraphs. The
serializeValue callback is lost during subgraph conversion, causing
sampling_mode to serialize as the raw string 'on' instead of the
expected {sampling_mode: 'on', temperature: 0.7, top_k: 64} object.

This reproduces the bug where TextGenerateLTX2Prompt -> PreviewAny
text preview fails inside subgraphs.

Tests:
- Unit: graphToPrompt DynamicCombo serialization at top level (pass)
  and inside subgraph (intentional fail)
- E2E: DynamicCombo text preview at top level and inside subgraph
- Devtools: Mock V3 DynamicCombo node for CI testing (no model needed)
2026-04-19 09:17:13 +00:00

102 lines
2.7 KiB
Python

from __future__ import annotations
from .errors import (
DeprecatedNode,
ErrorRaiseNode,
ErrorRaiseNodeWithMessage,
ExperimentalNode,
NODE_CLASS_MAPPINGS as errors_class_mappings,
NODE_DISPLAY_NAME_MAPPINGS as errors_display_name_mappings,
)
from .dynamic_combo import (
DynamicComboStringOutput,
NODE_CLASS_MAPPINGS as dynamic_combo_class_mappings,
NODE_DISPLAY_NAME_MAPPINGS as dynamic_combo_display_name_mappings,
)
from .inputs import (
LongComboDropdown,
NodeWithBooleanInput,
NodeWithDefaultInput,
NodeWithForceInput,
NodeWithOptionalComboInput,
NodeWithOptionalInput,
NodeWithOnlyOptionalInput,
NodeWithOutputList,
NodeWithSeedInput,
NodeWithStringInput,
NodeWithUnionInput,
NodeWithValidation,
NodeWithV2ComboInput,
SimpleSlider,
NODE_CLASS_MAPPINGS as inputs_class_mappings,
NODE_DISPLAY_NAME_MAPPINGS as inputs_display_name_mappings,
)
from .models import (
DummyPatch,
LoadAnimatedImageTest,
ObjectPatchNode,
NODE_CLASS_MAPPINGS as models_class_mappings,
NODE_DISPLAY_NAME_MAPPINGS as models_display_name_mappings,
)
from .remote import (
MultiSelectNode,
NodeWithOutputCombo,
RemoteWidgetNode,
RemoteWidgetNodeWithControlAfterRefresh,
RemoteWidgetNodeWithParams,
RemoteWidgetNodeWithRefresh,
RemoteWidgetNodeWithRefreshButton,
NODE_CLASS_MAPPINGS as remote_class_mappings,
NODE_DISPLAY_NAME_MAPPINGS as remote_display_name_mappings,
)
NODE_CLASS_MAPPINGS = {
**errors_class_mappings,
**dynamic_combo_class_mappings,
**inputs_class_mappings,
**remote_class_mappings,
**models_class_mappings,
}
NODE_DISPLAY_NAME_MAPPINGS = {
**errors_display_name_mappings,
**dynamic_combo_display_name_mappings,
**inputs_display_name_mappings,
**remote_display_name_mappings,
**models_display_name_mappings,
}
__all__ = [
"DeprecatedNode",
"DynamicComboStringOutput",
"DummyPatch",
"ErrorRaiseNode",
"ErrorRaiseNodeWithMessage",
"ExperimentalNode",
"LoadAnimatedImageTest",
"LongComboDropdown",
"MultiSelectNode",
"NodeWithBooleanInput",
"NodeWithDefaultInput",
"NodeWithForceInput",
"NodeWithOptionalComboInput",
"NodeWithOptionalInput",
"NodeWithOnlyOptionalInput",
"NodeWithOutputCombo",
"NodeWithOutputList",
"NodeWithSeedInput",
"NodeWithStringInput",
"NodeWithUnionInput",
"NodeWithValidation",
"NodeWithV2ComboInput",
"ObjectPatchNode",
"RemoteWidgetNode",
"RemoteWidgetNodeWithControlAfterRefresh",
"RemoteWidgetNodeWithParams",
"RemoteWidgetNodeWithRefresh",
"RemoteWidgetNodeWithRefreshButton",
"SimpleSlider",
"NODE_CLASS_MAPPINGS",
"NODE_DISPLAY_NAME_MAPPINGS",
]