Skip to content

feat(api-nodes): add MiniMax Chat and TTS nodes#13374

Open
octo-patch wants to merge 1 commit intoComfy-Org:masterfrom
octo-patch:feature/add-minimax-chat-tts
Open

feat(api-nodes): add MiniMax Chat and TTS nodes#13374
octo-patch wants to merge 1 commit intoComfy-Org:masterfrom
octo-patch:feature/add-minimax-chat-tts

Conversation

@octo-patch
Copy link
Copy Markdown

@octo-patch octo-patch commented Apr 12, 2026

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)

  • Generate text responses using MiniMax chat models
  • Supports MiniMax-M2.7 (default) and MiniMax-M2.7-highspeed
  • Optional system prompt and configurable max tokens
  • Uses OpenAI-compatible chat completions API at /proxy/minimax/v1/chat/completions

MiniMax Text to Speech (api node/audio/MiniMax)

  • Convert text to speech using MiniMax TTS models
  • Supports speech-2.8-hd (default, higher quality) and speech-2.8-turbo (faster)
  • 6 English voice options
  • Configurable speech speed
  • Uses MiniMax TTS API at /proxy/minimax/v1/t2a_v2

Changes

  • comfy_api_nodes/apis/minimax.py — Added Pydantic request/response models for Chat and TTS APIs
  • comfy_api_nodes/nodes_minimax.py — Added MinimaxChatNode and MinimaxTextToSpeechNode, registered in MinimaxExtension
  • tests-unit/comfy_api_test/test_minimax_nodes.py — Added 14 unit tests covering all new API models

API References

Test plan

  • Unit tests pass (pytest tests-unit/comfy_api_test/test_minimax_nodes.py — 14/14 passed)
  • MiniMax Chat API integration verified (MiniMax-M2.7 responds correctly)
  • MiniMax TTS API integration verified (speech-2.8-hd generates valid MP3 audio)

API Node PR Checklist

Scope

  • Is API Node Change

Pricing & Billing

  • Need pricing update
  • No pricing update

If Need pricing update:

  • Metronome rate cards updated
  • Auto‑billing tests updated and passing

QA

  • QA done
  • QA not required

Comms

  • Informed Kosinkadink

- 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
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 12, 2026

📝 Walkthrough

Walkthrough

This pull request introduces two new MiniMax API integration nodes for the Comfy platform. MinimaxChatNode sends chat completion requests to the MiniMax chat endpoint, assembling optional system prompts with user input into message format with fixed parameters. MinimaxTextToSpeechNode converts text to audio by posting requests to the MiniMax TTS endpoint with configurable voice and speed settings. The nodes return chat responses or binary audio data respectively. A new test module validates both nodes' behavior, constants, and Pydantic model defaults.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding MiniMax Chat and TTS nodes to the codebase.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, detailing the new nodes, their functionality, affected files, and test coverage.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 31283d2 and 3c5f87b.

⛔ Files ignored due to path filters (1)
  • comfy_api_nodes/apis/minimax.py is excluded by !comfy_api_nodes/apis/**
📒 Files selected for processing (2)
  • comfy_api_nodes/nodes_minimax.py
  • tests-unit/comfy_api_test/test_minimax_nodes.py

Comment on lines +98 to +124
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant