diff --git a/comfy_api_nodes/apis/minimax.py b/comfy_api_nodes/apis/minimax.py index 117306af0..fcd0a6a38 100644 --- a/comfy_api_nodes/apis/minimax.py +++ b/comfy_api_nodes/apis/minimax.py @@ -121,10 +121,9 @@ class MinimaxVideoGenerationResponse(BaseModel): class MiniMaxChatModel(str, Enum): + M3 = 'MiniMax-M3' M2_7 = 'MiniMax-M2.7' M2_7_highspeed = 'MiniMax-M2.7-highspeed' - M2_5 = 'MiniMax-M2.5' - M2_5_highspeed = 'MiniMax-M2.5-highspeed' class MiniMaxChatMessage(BaseModel): diff --git a/comfy_api_nodes/nodes_minimax.py b/comfy_api_nodes/nodes_minimax.py index a75477165..f84968553 100644 --- a/comfy_api_nodes/nodes_minimax.py +++ b/comfy_api_nodes/nodes_minimax.py @@ -452,7 +452,7 @@ class MinimaxChatNode(IO.ComfyNode): node_id="MinimaxChatNode", display_name="MiniMax Chat", category="api node/text/MiniMax", - description="Generate text responses using MiniMax language models (MiniMax-M2.7).", + description="Generate text responses using MiniMax language models (MiniMax-M3).", inputs=[ IO.String.Input( "prompt", @@ -463,7 +463,7 @@ class MinimaxChatNode(IO.ComfyNode): IO.Combo.Input( "model", options=MiniMaxChatModel, - default=MiniMaxChatModel.M2_7.value, + default=MiniMaxChatModel.M3.value, tooltip="The MiniMax model to use for text generation.", ), IO.String.Input( @@ -505,7 +505,12 @@ class MinimaxChatNode(IO.ComfyNode): expr=""" ( $m := widgets.model; - $contains($m, "highspeed") ? { + $m = "MiniMax-M3" ? { + "type": "list_usd", + "usd": [0.0006, 0.0024], + "format": { "approximate": true, "separator": "-", "suffix": " per 1K tokens" } + } + : $contains($m, "highspeed") ? { "type": "list_usd", "usd": [0.00004, 0.0002], "format": { "approximate": true, "separator": "-", "suffix": " per 1K tokens" } @@ -524,7 +529,7 @@ class MinimaxChatNode(IO.ComfyNode): async def execute( cls, prompt: str, - model: str = MiniMaxChatModel.M2_7.value, + model: str = MiniMaxChatModel.M3.value, system_prompt: Optional[str] = None, max_tokens: int = 4096, temperature: float = 0.7, diff --git a/tests-unit/comfy_api_test/minimax_models_test.py b/tests-unit/comfy_api_test/minimax_models_test.py index d0fb947bd..e1e4f44fd 100644 --- a/tests-unit/comfy_api_test/minimax_models_test.py +++ b/tests-unit/comfy_api_test/minimax_models_test.py @@ -3,6 +3,10 @@ from comfy_api_nodes.apis.minimax import MiniMaxChatModel class TestMiniMaxChatModel: + def test_m3_in_model_list(self): + """MiniMax-M3 should be available in the chat model enum.""" + assert MiniMaxChatModel.M3.value == 'MiniMax-M3' + def test_m27_in_model_list(self): """MiniMax-M2.7 should be available in the chat model enum.""" assert MiniMaxChatModel.M2_7.value == 'MiniMax-M2.7' @@ -11,17 +15,19 @@ class TestMiniMaxChatModel: """MiniMax-M2.7-highspeed should be available in the chat model enum.""" assert MiniMaxChatModel.M2_7_highspeed.value == 'MiniMax-M2.7-highspeed' - def test_m27_is_first_in_enum(self): - """M2.7 should appear before older models in the enum.""" + def test_m3_is_first_in_enum(self): + """M3 should appear before older models in the enum.""" members = list(MiniMaxChatModel) - assert members[0] == MiniMaxChatModel.M2_7 - assert members[1] == MiniMaxChatModel.M2_7_highspeed + assert members[0] == MiniMaxChatModel.M3 + assert members[1] == MiniMaxChatModel.M2_7 + assert members[2] == MiniMaxChatModel.M2_7_highspeed - def test_legacy_models_still_available(self): - """Previous M2.5 models should still be available.""" - assert MiniMaxChatModel.M2_5.value == 'MiniMax-M2.5' - assert MiniMaxChatModel.M2_5_highspeed.value == 'MiniMax-M2.5-highspeed' + def test_legacy_m25_models_removed(self): + """Older M2.5 models should be removed.""" + values = [m.value for m in MiniMaxChatModel] + assert 'MiniMax-M2.5' not in values + assert 'MiniMax-M2.5-highspeed' not in values def test_total_model_count(self): - """Should have 4 chat models total (M2.7, M2.7-highspeed, M2.5, M2.5-highspeed).""" - assert len(MiniMaxChatModel) == 4 + """Should have 3 chat models total (M3, M2.7, M2.7-highspeed).""" + assert len(MiniMaxChatModel) == 3