Generate Images Mai logo

Generate Images Mai

Community
pamelafox
generate-images-mai

Generate or edit bitmap images with Microsoft MAI-Image-2.5 through the Azure AI image APIs. Use for text-to-image generation, image-to-image edits, object removal or replacement, inpainting, text updates, artifact cleanup, reference-image transformations, posters, thumbnails, and concept art.

Overview

Publisherpamelafox
Repositorypresentation-skills
Skill namegenerate-images-mai
Stars
129
Forks
23
Bundled files
2
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by pamelafox on GitHub. Read the source before you install it.

Installation

Install the Generate Images Mai AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/pamelafox/presentation-skills/tree/main/.agents/skills/generate-images-mai
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/pamelafox/presentation-skills.git /tmp/presentation-skills
mkdir -p .claude/skills
cp -r /tmp/presentation-skills/.agents/skills/generate-images-mai .claude/skills/generate-images-mai
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Generate Images Mai in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Generate Images Mai on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Generate Images Mai is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Generate and edit images with MAI-Image-2.5

Create an image from text or edit a supplied JPEG or PNG, save the result, and verify that the output is usable.

Requirements

  • Python 3.10+.
  • A .env file in the current directory or one of its parents:
dotenv
AZURE_API_KEY=your-key
AZURE_IMAGE_ENDPOINT=https://your-resource.services.ai.azure.com/mai/v1/images/generations

The endpoint can be the resource root, /mai/v1/images, /generations, or /edits; the script selects the operation-specific path.

Never read, print, return, commit, or embed the API key in generated files, commands, logs, or chat. Do not create a .env containing a real secret. If configuration is missing, tell the user which variable to add without asking them to send its value through chat.

Procedure

  1. Determine the requested subject or edit, intended use, output path, dimensions, and visual constraints from the conversation.
  2. For an edit, confirm that the input is a readable JPEG or PNG. Preserve the original composition or identity unless the request says otherwise.
  3. If the prompt is underspecified, preserve the user's intent and add only useful visual detail: medium, composition, environment, lighting, palette, camera or rendering style, and important exclusions. Do not introduce brands, people, text, or sensitive attributes the user did not request.
  4. Default to 1024x1024 and generated_image.png for generation. Generation dimensions must each be at least 768 pixels and contain no more than 1,048,576 total pixels. Edit output is always PNG and dimensions are controlled by the service.
  5. Run generate_image.py with the refined prompt. Pass arguments as separate shell tokens and quote all user-provided values.

Text-to-image generation:

bash
python3 .agents/skills/generate-images-mai/scripts/generate_image.py \
  --prompt "A photograph of a red fox in an autumn forest" \
  --width 1024 \
  --height 1024 \
  --output generated_image.png

Image-to-image edit:

bash
python3 .agents/skills/generate-images-mai/scripts/generate_image.py \
  --prompt "Replace the lawn with a native wildflower garden while preserving the house and paths" \
  --input-image garden.png \
  --output edited_garden.png
  1. If the destination exists, do not overwrite it unless the user explicitly requested replacement; use a new descriptive filename or pass --force only with that permission.
  2. Verify the output exists, is non-empty, and can be decoded as an image. Use the image-viewing tool to inspect it when available.
  3. Check that the result matches the requested subject or edit, composition, legibility, and safety constraints. Regenerate with a targeted prompt adjustment when the image is blank, malformed, materially off-topic, or has obvious layout defects.
  4. Report the saved path and, when available, final dimensions. Mention prompt changes only when they materially affect the user's request.

Options

  • --prompt: Required image description or editing instruction.
  • --input-image: Optional JPEG or PNG image to edit. When present, the script uses the MAI image edits API.
  • --output: Output PNG path; defaults to generated_image.png.
  • --width and --height: Generation dimensions; each defaults to 1024. Ignored for edits.
  • --model: Deployment name; defaults to MAI-Image-2.5.
  • --endpoint: Azure resource or image API endpoint; overrides AZURE_IMAGE_ENDPOINT.
  • --env-file: Loads a specific .env file instead of searching parent directories.
  • --force: Permits replacing an existing output file.

Environment variables already present in the process take precedence over values in .env.

API behavior

  • Text generation sends JSON to /mai/v1/images/generations.
  • Image editing sends prompt, model, and one image as multipart form data to /mai/v1/images/edits.
  • Image edits accept JPEG or PNG input and return PNG output.
  • MAI-Image-2.5 image editing is currently a public-preview feature and isn't recommended for production workloads without accounting for preview limitations.

Failure handling

  • Missing configuration: Identify AZURE_API_KEY or AZURE_IMAGE_ENDPOINT and stop.
  • Invalid input image: Report that image edits require a readable JPEG or PNG.
  • HTTP authentication failure: Tell the user to verify AZURE_API_KEY locally; never request the key in chat.
  • HTTP endpoint or deployment failure: Report the status and sanitized API message, then verify the endpoint and deployment name.
  • Invalid or absent b64_json: Do not create an output file; report the response-shape problem.
  • Content-policy rejection: Explain that the service rejected the prompt and offer a compliant revision.
  • Corrupt or empty image: Remove the incomplete output and retry once with the same request before changing the prompt.

Completion checks

  • The secret was not exposed.
  • The requested output was created without overwriting unrelated work.
  • The file is a decodable image.
  • Visual inspection confirms the primary subject and requested edits are present.
  • The user receives a clickable path to the image.

Reference

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Generate Images Mai AI skill do?

Generate or edit bitmap images with Microsoft MAI-Image-2.5 through the Azure AI image APIs. Use for text-to-image generation, image-to-image edits, object removal or replacement, inpainting, text updates, artifact cleanup, reference-image transformations, posters, thumbnails, and concept art.

Why use Generate Images Mai on TypingMind?

Because you install it once and use it with any model. Generate Images Mai is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Generate Images Mai in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/pamelafox/presentation-skills/tree/main/.agents/skills/generate-images-mai. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Generate Images Mai?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Generate Images Mai?

As many as you like. As long as a model supports skills, you can use Generate Images Mai with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Generate Images Mai AI skill free?

Yes. It is published on GitHub by pamelafox under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇