Enhanced get_model_architecture_list MCP Tools.
Browse filesFiles changed (2)
123345678910101112138 unmodified lines222324252626272829272829303131323334343536373839404142"""
MCP Tool: get_model_architecture_list
Get all supported model architectures and their corresponding default resolutions.
Get all supported model architectures, their corresponding default resolutions, and available aspect ratios.
"""
from .common import _load_yaml, _MODEL_ARCHITECTURES_PATH, _CONSTANTS_PATH
def handle_get_model_architecture_list() -> list:
"""Dynamically load all supported model architectures from model_architectures.yaml."""
"""Dynamically load all supported model architectures from model_architectures.yaml along with available aspect ratios and resolutions."""
arch_config = _load_yaml(_MODEL_ARCHITECTURES_PATH)
constants = _load_yaml(_CONSTANTS_PATH)
resolution_map = constants.get("RESOLUTION_MAP", {})8 unmodified lines model_type = arch_data.get("model_type", arch_name.lower())
default_res = [1024, 1024]
resolutions_dict = {}
if model_type in resolution_map:
resolutions = resolution_map[model_type]
if resolutions:
first_key = next(iter(resolutions))
default_res = resolutions[first_key]
resolutions_dict = resolution_map[model_type]
if resolutions_dict:
first_key = next(iter(resolutions_dict))
default_res = resolutions_dict[first_key]
result.append({
entry = {
"model_architecture": arch_name,
"default_resolution": default_res,
})
}
if resolutions_dict:
entry["available_resolutions"] = resolutions_dict
result.append(entry)
return result
80 unmodified lines818283848485868780 unmodified lines return sanitize_keys(handle_get_task_list())
def get_model_architecture_list() -> list:
"""[Recommended Discovery Flow Step 2] Get a list of all supported model architectures (e.g., SD1.5, SDXL, FLUX, etc.) along with their default resolutions. It is recommended to call this tool before get_model_list to obtain valid model_architecture parameters for precise model filtering."""
"""[Recommended Discovery Flow Step 2] Get a list of all supported model architectures (e.g., SD1.5, SDXL, FLUX, etc.) along with their default resolutions and available aspect ratios (with corresponding width & height). It is recommended to call this tool before get_model_list to obtain valid model_architecture parameters for precise model filtering."""
return sanitize_keys(handle_get_model_architecture_list())
def get_model_list(model_architecture: str = "") -> list | dict:mcp_tools/get_model_architecture_list.py+14-8
mcp_tools/mcp_gradio_integration.py+1-1