feat(api-nodes): add MiniMax Chat and TTS nodes#13374
feat(api-nodes): add MiniMax Chat and TTS nodes#13374octo-patch wants to merge 1 commit intoComfy-Org:masterfrom
Conversation
- Add MinimaxChatNode for text generation using MiniMax-M2.7 and MiniMax-M2.7-highspeed models via OpenAI-compatible API - Add MinimaxTextToSpeechNode for speech synthesis using speech-2.8-hd and speech-2.8-turbo models via MiniMax TTS API - Add Pydantic request/response models for Chat and TTS APIs to comfy_api_nodes/apis/minimax.py - Add unit tests for all new API models
📝 WalkthroughWalkthroughThis pull request introduces two new MiniMax API integration nodes for the Comfy platform. 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests-unit/comfy_api_test/test_minimax_nodes.py`:
- Around line 98-124: The tests are tautological because they assert against
locally defined lists; update each test in TestMinimaxNodeConstants
(test_chat_models_are_correct, test_tts_models_are_correct,
test_tts_voices_list) to import the real constants from
comfy_api_nodes.nodes_minimax (e.g., the exported CHAT_MODELS, TTS_MODELS,
TTS_VOICES or whatever constant names are defined there) and assert against
those imported values (use equality or membership checks against the production
constants instead of local copies) so the tests validate the production
constants rather than reproducing them locally.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 48a40fb3-6468-42b9-8cc2-7940a6c24f46
⛔ Files ignored due to path filters (1)
comfy_api_nodes/apis/minimax.pyis excluded by!comfy_api_nodes/apis/**
📒 Files selected for processing (2)
comfy_api_nodes/nodes_minimax.pytests-unit/comfy_api_test/test_minimax_nodes.py
| class TestMinimaxNodeConstants: | ||
| """Test that node constants are correct per the SKILL.md spec.""" | ||
|
|
||
| def test_chat_models_are_correct(self): | ||
| # Verify expected chat models without importing GPU-dependent modules | ||
| expected_chat_models = ["MiniMax-M2.7", "MiniMax-M2.7-highspeed"] | ||
| assert "MiniMax-M2.7" in expected_chat_models | ||
| assert "MiniMax-M2.7-highspeed" in expected_chat_models | ||
| assert len(expected_chat_models) == 2 | ||
|
|
||
| def test_tts_models_are_correct(self): | ||
| expected_tts_models = ["speech-2.8-hd", "speech-2.8-turbo"] | ||
| assert "speech-2.8-hd" in expected_tts_models | ||
| assert "speech-2.8-turbo" in expected_tts_models | ||
|
|
||
| def test_tts_voices_list(self): | ||
| expected_voices = [ | ||
| "English_Graceful_Lady", | ||
| "English_Insightful_Speaker", | ||
| "English_radiant_girl", | ||
| "English_Persuasive_Man", | ||
| "English_Lucky_Robot", | ||
| "English_expressive_narrator", | ||
| ] | ||
| assert len(expected_voices) > 0 | ||
| assert "English_Graceful_Lady" in expected_voices | ||
|
|
There was a problem hiding this comment.
Tests are tautological—they don't validate the production constants.
These tests create local lists and assert against those same local values. They should import the actual constants from comfy_api_nodes.nodes_minimax to verify the production code.
Proposed fix to test actual production constants
class TestMinimaxNodeConstants:
"""Test that node constants are correct per the SKILL.md spec."""
def test_chat_models_are_correct(self):
- # Verify expected chat models without importing GPU-dependent modules
- expected_chat_models = ["MiniMax-M2.7", "MiniMax-M2.7-highspeed"]
- assert "MiniMax-M2.7" in expected_chat_models
- assert "MiniMax-M2.7-highspeed" in expected_chat_models
- assert len(expected_chat_models) == 2
+ from comfy_api_nodes.nodes_minimax import MINIMAX_CHAT_MODELS
+ assert "MiniMax-M2.7" in MINIMAX_CHAT_MODELS
+ assert "MiniMax-M2.7-highspeed" in MINIMAX_CHAT_MODELS
+ assert len(MINIMAX_CHAT_MODELS) == 2
def test_tts_models_are_correct(self):
- expected_tts_models = ["speech-2.8-hd", "speech-2.8-turbo"]
- assert "speech-2.8-hd" in expected_tts_models
- assert "speech-2.8-turbo" in expected_tts_models
+ from comfy_api_nodes.nodes_minimax import MINIMAX_TTS_MODELS
+ assert "speech-2.8-hd" in MINIMAX_TTS_MODELS
+ assert "speech-2.8-turbo" in MINIMAX_TTS_MODELS
def test_tts_voices_list(self):
- expected_voices = [
- "English_Graceful_Lady",
- "English_Insightful_Speaker",
- "English_radiant_girl",
- "English_Persuasive_Man",
- "English_Lucky_Robot",
- "English_expressive_narrator",
- ]
- assert len(expected_voices) > 0
- assert "English_Graceful_Lady" in expected_voices
+ from comfy_api_nodes.nodes_minimax import MINIMAX_TTS_VOICES
+ assert len(MINIMAX_TTS_VOICES) == 6
+ assert "English_Graceful_Lady" in MINIMAX_TTS_VOICES🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@tests-unit/comfy_api_test/test_minimax_nodes.py` around lines 98 - 124, The
tests are tautological because they assert against locally defined lists; update
each test in TestMinimaxNodeConstants (test_chat_models_are_correct,
test_tts_models_are_correct, test_tts_voices_list) to import the real constants
from comfy_api_nodes.nodes_minimax (e.g., the exported CHAT_MODELS, TTS_MODELS,
TTS_VOICES or whatever constant names are defined there) and assert against
those imported values (use equality or membership checks against the production
constants instead of local copies) so the tests validate the production
constants rather than reproducing them locally.
Summary
This PR adds MiniMax Chat and Text-to-Speech (TTS) API nodes to ComfyUI, complementing the existing MiniMax video generation nodes.
New Nodes
MiniMax Chat(api node/text/MiniMax)MiniMax-M2.7(default) andMiniMax-M2.7-highspeed/proxy/minimax/v1/chat/completionsMiniMax Text to Speech(api node/audio/MiniMax)speech-2.8-hd(default, higher quality) andspeech-2.8-turbo(faster)/proxy/minimax/v1/t2a_v2Changes
comfy_api_nodes/apis/minimax.py— Added Pydantic request/response models for Chat and TTS APIscomfy_api_nodes/nodes_minimax.py— AddedMinimaxChatNodeandMinimaxTextToSpeechNode, registered inMinimaxExtensiontests-unit/comfy_api_test/test_minimax_nodes.py— Added 14 unit tests covering all new API modelsAPI References
Test plan
pytest tests-unit/comfy_api_test/test_minimax_nodes.py— 14/14 passed)MiniMax-M2.7responds correctly)speech-2.8-hdgenerates valid MP3 audio)API Node PR Checklist
Scope
Pricing & Billing
If Need pricing update:
QA
Comms