Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions apps/models_provider/impl/minimax_model_provider/credential/itv.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,37 @@ def get_model_params_setting_form(self, model_name: str):
:return: Parameter setting form.
"""
return MiniMaxModelParams()


class MiniMaxH3ImageParams(BaseForm):
"""
Parameters for the MiniMax H3 / H3-Max (V2) image-to-video model.
ratio is always adaptive for image-to-video, so it is not exposed.
"""

resolution = SingleSelect(
_('Resolution'), text_field='label', value_field='value',
option_list=[
{'label': '480P', 'value': '480P'},
{'label': '768P', 'value': '768P'},
{'label': '2K', 'value': '2K'},
],
required=True, default_value='768P',
)
duration = SliderField(
_('Duration (seconds)'), _min=4, _max=15, _step=1, precision=0,
required=True, default_value=4,
)


class MiniMaxH3ImageToVideoModelCredential(ImageToVideoModelCredential):
"""
Credential for the MiniMax H3 / H3-Max (V2) image-to-video model.
Uses the V2 endpoint and requires resolution / duration.
"""

api_base = forms.TextInputField('API URL', required=True,
default_value='https://api.minimax.io/v2')

def get_model_params_setting_form(self, model_name: str):
return MiniMaxH3ImageParams()
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
ModelTypeConst,
ModelInfoManage,
)
from models_provider.impl.minimax_model_provider.credential.itv import ImageToVideoModelCredential
from models_provider.impl.minimax_model_provider.credential.itv import (
ImageToVideoModelCredential,
MiniMaxH3ImageToVideoModelCredential,
)
from models_provider.impl.minimax_model_provider.credential.llm import MiniMaxLLMModelCredential
from models_provider.impl.minimax_model_provider.credential.tti import MiniMaxTextToImageModelCredential
from models_provider.impl.minimax_model_provider.credential.tts import MiniMaxTTSModelCredential
Expand All @@ -31,6 +34,7 @@
minimax_ttv_model_credential = TextToVideoModelCredential()
minimax_h3_ttv_model_credential = MiniMaxH3TextToVideoModelCredential()
minimax_itv_model_credential = ImageToVideoModelCredential()
minimax_h3_itv_model_credential = MiniMaxH3ImageToVideoModelCredential()

minimax_m2_7 = ModelInfo(
"MiniMax-M2.7",
Expand Down Expand Up @@ -97,6 +101,8 @@
]

model_info_itv_list = [
ModelInfo("MiniMax-H3", _(""), ModelTypeConst.ITV, minimax_h3_itv_model_credential, GenerationVideoModel),
ModelInfo("MiniMax-H3-Max", _(""), ModelTypeConst.ITV, minimax_h3_itv_model_credential, GenerationVideoModel),
ModelInfo("MiniMax-Hailuo-2.3", _(""), ModelTypeConst.ITV, minimax_itv_model_credential, GenerationVideoModel),
]
model_info_manage = (
Expand Down
Loading