Stable Diffusion WebUI integration. File CORP proxy.

This commit is contained in:
2026-07-25 20:22:51 -07:00
parent 449a41742d
commit f808f4d599
6 changed files with 344 additions and 1 deletions
+33
View File
@@ -23,6 +23,8 @@ from .list_directory import handle as list_directory_details_handler
from .preview_image import handle as preview_image_handler
from .get_text_context import handle as get_text_context_handler
from .wikipedia import handle as wikipedia_handler
from .get_model_info import handle as get_model_info_handler
from .generate_image import handle as generate_image_handler
# Central registry of all available tools
TOOL_REGISTRY = [
@@ -124,4 +126,35 @@ TOOL_REGISTRY = [
},
handler=wikipedia_handler
),
Tool(
name="get_model_info",
description="Returns a list of available models and their short descriptions. If a specific model name is provided, it returns the comprehensive prompting guide, available resolution presets, and active configuration tips for that model. CRITICAL: You must call this for any model you are unfamiliar with, as prompting styles vary wildly (e.g., tag-based vs. natural language) and using the wrong style will result in poor image quality.",
schema={
"type": "object",
"properties": {
"model_name": {"type": "string", "description": "The name of the model to get detailed info for. Leave empty to list all available models."}
},
"required": [],
},
handler=get_model_info_handler
),
Tool(
name="generate_image",
description="Generates an image using the specified model and parameters. Note: To ensure high quality, verify the model's prompting requirements via get_model_info before calling this tool.",
schema={
"type": "object",
"properties": {
"model_name": {"type": "string", "description": "The name of the model to use. Required."},
"prompt": {"type": "string", "description": "The prompt for the image. Required."},
"negative_prompt": {"type": "string", "description": "The negative prompt to exclude unwanted elements."},
"resolution_preset": {"type": "string", "description": "A named resolution preset (e.g., 'square', 'portrait'). Available options depend on the model."},
"steps": {"type": "integer", "description": "Number of sampling steps."},
"cfg_scale": {"type": "number", "description": "CFG scale for prompt adherence."},
"seed": {"type": "number", "description": "Random seed for reproducibility. Use -1 for random."},
"sampler": {"type": "string", "description": "The sampling method to use."},
},
"required": ["model_name", "prompt"],
},
handler=generate_image_handler
),
]