Skip to main content
Glama

kobold_img2img

Modify images by applying text prompts to transform their content, style, or composition using AI image generation techniques.

Instructions

Transform existing image using prompt

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiUrlNohttp://localhost:5001
promptYes
negative_promptNo
widthNo
heightNo
stepsNo
cfg_scaleNo
sampler_nameNo
seedNo
init_imagesYes
denoising_strengthNo

Implementation Reference

  • Shared handler logic for all POST-based tools like kobold_img2img: validates arguments with the tool's schema, proxies the request to the specified KoboldAI API endpoint, and returns the JSON response.
    if (postEndpoints[name]) {
        const { endpoint, schema } = postEndpoints[name];
        const parsed = schema.safeParse(args);
        if (!parsed.success) {
            throw new Error(`Invalid arguments: ${parsed.error}`);
        }
    
        const result = await makeRequest(`${apiUrl}${endpoint}`, 'POST', requestData);
        return {
            content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
            isError: false,
        };
  • Zod schemas defining the input parameters for kobold_img2img (Img2ImgSchema extends Txt2ImgSchema, which extends BaseConfigSchema).
    const Txt2ImgSchema = BaseConfigSchema.extend({
        prompt: z.string(),
        negative_prompt: z.string().optional(),
        width: z.number().optional(),
        height: z.number().optional(),
        steps: z.number().optional(),
        cfg_scale: z.number().optional(),
        sampler_name: z.string().optional(),
        seed: z.number().optional(),
    });
    
    const Img2ImgSchema = Txt2ImgSchema.extend({
        init_images: z.array(z.string()),
        denoising_strength: z.number().optional(),
    });
  • src/index.ts:250-252 (registration)
    Registration of the kobold_img2img tool in the ListTools response, including its name, description, and input schema.
    name: "kobold_img2img",
    description: "Transform existing image using prompt",
    inputSchema: zodToJsonSchema(Img2ImgSchema),
  • src/index.ts:341-341 (registration)
    Internal registration of the kobold_img2img tool's endpoint and schema in the postEndpoints routing map used by the handler.
    kobold_img2img: { endpoint: '/sdapi/v1/img2img', schema: Img2ImgSchema },
  • Helper function for making HTTP requests to the KoboldAI API, used by the tool handler.
    async function makeRequest(url: string, method = 'GET', body: Record<string, unknown> | null = null) {
        const options: RequestInit = {
            method,
            headers: body ? { 'Content-Type': 'application/json' } : undefined,
        };
        
        if (body && method !== 'GET') {
            options.body = JSON.stringify(body);
        }
    
        const response = await fetch(url, options);
        if (!response.ok) {
            throw new Error(`KoboldAI API error: ${response.statusText}`);
        }
        
        return response.json();
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. 'Transform existing image' implies mutation of input images, but it doesn't disclose behavioral traits like whether this is a generative AI process, what happens to the original images (e.g., are they modified in place or used as reference), potential rate limits, or authentication needs. The description is minimal and leaves critical behavioral aspects unspecified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with a single four-word sentence that's front-loaded with the core action. There's no wasted language or unnecessary elaboration, making it efficient for quick scanning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (11 parameters, AI image generation tool), lack of annotations, 0% schema description coverage, and no output schema, the description is incomplete. It doesn't explain what the tool returns, how parameters interact, or the generative nature of the transformation. For a tool with this many configuration options, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 11 parameters and 0% schema description coverage, the description 'Transform existing image using prompt' adds minimal semantic value. It mentions 'prompt' and implies 'init_images' through 'existing image', but doesn't explain the purpose of other parameters like negative_prompt, denoising_strength, or sampler_name. The description fails to compensate for the lack of schema documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Transform existing image using prompt' clearly states the action (transform) and resource (existing image), but it's vague about what transformation entails and doesn't differentiate from sibling tools like kobold_txt2img (text-to-image) or kobold_interrogate (image analysis). It provides basic purpose but lacks specificity about the AI image generation context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives. With siblings like kobold_txt2img (text-to-image generation) and kobold_interrogate (image analysis), the description doesn't indicate this is specifically for image-to-image transformation or when one would choose this over text-to-image generation. Usage context is implied but not explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PhialsBasement/KoboldCPP-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server