Spaces:
Running on Zero
Running on Zero
Enhanced get_model_architecture_list MCP Tools.
Browse filesFiles changed (2)
123456789101112138 unmodified lines222324252627282930313233343536"""MCP Tool: get_model_architecture_listGet all supported model architectures and their corresponding default resolutions."""from .common import _load_yaml, _MODEL_ARCHITECTURES_PATH, _CONSTANTS_PATHdef handle_get_model_architecture_list() -> list:"""Dynamically load all supported model architectures from model_architectures.yaml."""arch_config = _load_yaml(_MODEL_ARCHITECTURES_PATH)constants = _load_yaml(_CONSTANTS_PATH)resolution_map = constants.get("RESOLUTION_MAP", {})8 unmodified linesmodel_type = arch_data.get("model_type", arch_name.lower())default_res = [1024, 1024]if model_type in resolution_map:resolutions = resolution_map[model_type]if resolutions:first_key = next(iter(resolutions))default_res = resolutions[first_key]result.append({"model_architecture": arch_name,"default_resolution": default_res,})return result123456789101112138 unmodified lines222324252627282930313233343536373839404142"""MCP Tool: get_model_architecture_listGet all supported model architectures, their corresponding default resolutions, and available aspect ratios."""from .common import _load_yaml, _MODEL_ARCHITECTURES_PATH, _CONSTANTS_PATHdef handle_get_model_architecture_list() -> list:"""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 linesmodel_type = arch_data.get("model_type", arch_name.lower())default_res = [1024, 1024]resolutions_dict = {}if model_type in resolution_map:resolutions_dict = resolution_map[model_type]if resolutions_dict:first_key = next(iter(resolutions_dict))default_res = resolutions_dict[first_key]entry = {"model_architecture": arch_name,"default_resolution": default_res,}if resolutions_dict:entry["available_resolutions"] = resolutions_dictresult.append(entry)return result
80 unmodified lines8182838485868780 unmodified linesreturn 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."""return sanitize_keys(handle_get_model_architecture_list())def get_model_list(model_architecture: str = "") -> list | dict:80 unmodified lines8182838485868780 unmodified linesreturn 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 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