feat: add MiniMax Cloud API as alternative prompt enhancement provider#134
Open
octo-patch wants to merge 1 commit intoTencent-Hunyuan:mainfrom
Open
feat: add MiniMax Cloud API as alternative prompt enhancement provider#134octo-patch wants to merge 1 commit intoTencent-Hunyuan:mainfrom
octo-patch wants to merge 1 commit intoTencent-Hunyuan:mainfrom
Conversation
Add MiniMax M2.7 as a cloud-based prompt enhancement option, allowing users without sufficient GPU memory for the local reprompt model to offload prompt rewriting to MiniMax's OpenAI-compatible API. Changes: - New RePromptCloud class with same predict()/to() interface as local models - HUNYUANIMAGE_REPROMPT_MINIMAX factory in model_zoo - Pipeline support for reprompt_model="minimax" in from_pretrained() - Cloud detection via empty load_from to skip local model loading - Think-tag stripping and <answer> tag parsing for M2.7 compatibility - Temperature clamped to (0, 1] per MiniMax API constraint - README docs with usage example and env var configuration - 36 unit tests + 3 integration tests (39 total) Co-Authored-By: Octopus <liyuan851277048@icloud.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add MiniMax M2.7 as a cloud-based prompt enhancement option for users who don't have enough GPU memory to run the local reprompt model (32B or smaller).
This offloads prompt rewriting to MiniMax's OpenAI-compatible API while keeping the exact same
predict()/to()interface as the localRePromptmodels, so users only need to change one parameter:Changes
hyimage/models/reprompt/reprompt_cloud.py—RePromptCloudclass<answer>tag parsing (matches local model output format)hyimage/models/model_zoo.py—HUNYUANIMAGE_REPROMPT_MINIMAX()factoryhyimage/diffusion/pipelines/hunyuanimage_pipeline.py_resolve_reprompt_config()for clean model name → config mapping_load_reprompt_model()(skipsmodels_root_pathfor cloud models)from_pretrained()docstringREADME.md— Cloud-based prompt enhancement usage guidetests/test_reprompt_cloud.py— 36 unit + 3 integration tests5 files changed, 717 additions, 4 deletions
Environment Variables
MINIMAX_API_KEYMINIMAX_MODELMiniMax-M2.7MINIMAX_BASE_URLhttps://api.minimax.io/v1Test Plan