image-generation

image-generation is a skill for Claude Code, Codex from ssmurfgg04-gif/context-m. It costs 69 tokens per session (3,769 once invoked), scanned A, original, Apache-2.0.

A backend skill for adding AI image creation to an application from text descriptions. It uses the z-ai-web-dev-sdk and returns generated image data.

In plain words
What is it for?
Use it to create artwork, illustrations, design assets, or other images from written prompts.
Why use it?
It removes the need to build the image-generation integration from scratch. It also clarifies that the SDK must run on the server, not in browser code.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create artwork, illustrations, design assets, or other images from written prompts.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ssmurfgg04-gif/context-m/image-generation
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ssmurfgg04-gif/context-m --skill image-generation
Clone the repo
git clone --depth 1 https://github.com/ssmurfgg04-gif/context-m

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for image-generation

README.md
[![agentmods](https://agentmods.dev/badge/skills/ssmurfgg04-gif/context-m/image-generation/github.svg)](https://agentmods.dev/skills/ssmurfgg04-gif/context-m/image-generation)
Your own site
<a href="https://agentmods.dev/skills/ssmurfgg04-gif/context-m/image-generation"><img src="https://agentmods.dev/badge/skills/ssmurfgg04-gif/context-m/image-generation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for image-generation

Your own site · 80×15
<a href="https://agentmods.dev/skills/ssmurfgg04-gif/context-m/image-generation"><img src="https://agentmods.dev/badge/skills/ssmurfgg04-gif/context-m/image-generation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,769 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00069 $0.03769
Opus 5 $0.00034 $0.01885
Sonnet 5 $0.00014 $0.00754
Haiku 4.5 $0.00007 $0.00377

Measured 9d ago against content hash eeb64a859c4f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

image-generation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/image-generation.ts), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/image-generation/SKILL.md · 584 lines

How it starts

The opening of the file, as written. The whole thing — 584 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Image Generation Skill

This skill guides the implementation of image generation functionality using the z-ai-web-dev-sdk package and CLI tool, enabling creation of high-quality images from text descriptions.

Skills Path

Skill Location: {project_path}/skills/image-generation

this skill is located at above path in your project.

Reference Scripts: Example test scripts are available in the {Skill Location}/scripts/ directory for quick testing and reference. See {Skill Location}/scripts/image-generation.ts for a working example.

Overview

Image Generation allows you to build applications that create visual content from text prompts using AI models, enabling creative workflows, design automation, and visual content production.

IMPORTANT: z-ai-web-dev-sdk MUST be used in backend code only. Never use it in client-side code.

Prerequisites

The z-ai-web-dev-sdk package is already installed. Import it as shown in the examples below.

Basic Image Generation

Simple Image Creation

import ZAI from 'z-ai-web-dev-sdk';
import fs from 'fs';

async function generateImage(prompt, outputPath) {
  const zai = await ZAI.create();

  const response = await zai.images.generations.create({
    prompt: prompt,
    size: '1024x1024'
  });

  const imageBase64 = response.data[0].base64;
  
  // Save image
  const buffer = Buffer.from(imageBase64, 'base64');
  fs.writeFileSync(outputPath, buffer);
  
  console.log(`Image saved to ${outputPath}`);
  return outputPath;
}

// Usage
await generateImage(
  'A cute cat playing in the garden',
  './cat_image.png'
);

Multiple Image Sizes

import ZAI from 'z-ai-web-dev-sdk';
import fs from 'fs';

// Supported sizes
const SUPPORTED_SIZES = [
  '1024x1024',  // Square
  '768x1344',   // Portrait
  '864x1152',   // Portrait
  '1344x768',   // Landscape
  '1152x864',   // Landscape
  '1440x720',   // Wide landscape
  '720x1440'    // Tall portrait
];

async function generateImageWithSize(prompt, size, outputPath) {
  if (!SUPPORTED_SIZES.includes(size)) {
    throw new Error(`Unsupported size: ${size}. Use one of: ${SUPPORTED_SIZES.join(', ')}`);
  }

  const zai = await ZAI.create();

  const response = await zai.images.generations.create({
    prompt: prompt,
    size: size
  });

  const imageBase64 = response.data[0].base64;
  const buffer = Buffer.from(imageBase64, 'base64');
  fs.writeFileSync(outputPath, buffer);

  return {
    path: outputPath,
    size: size,
    fileSize: buffer.length
  };
}

// Usage - Different sizes
await generateImageWithSize(
  'A beautiful landscape',
  '1344x768',
  './landscape.png'
);

await generateImageWithSize(
  'A portrait of a person',
  '768x1344',
  './portrait.png'
);

Read the full file on GitHub · 584 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 584 lines · 69 tokens per session scan A eeb64a859c4f

Subscribe to this mod's changes

image-generation is a skill published in the GitHub repository ssmurfgg04-gif/context-m (2 stars, last pushed yesterday), licensed Apache-2.0. It adds 69 tokens to every session and 3,769 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

ai-style

A Chinese-language writing guide for producing or revising reader-facing text such as product announcements, public-account articles, emails, and README files. It focuses on reducing patterns that make writing sound machine-generated.

bojieli/ai-agent-book · 25 tokens

triage

A task-routing guide that identifies goals, dependencies, and acceptance conditions before work begins. It orders work as research, calculation or execution, and writing.

bojieli/ai-agent-book · 28 tokens

coding

A coding guide for writing and running Python programs in a sandbox. It requires scripts to be small and reproducible, with their actual output or errors reported.

bojieli/ai-agent-book · 18 tokens

setup-open-index

Install and configure Open Index as the read/write context layer for a domain-specialized agent. Use when setting up a legal, marketing, customer support, sales, infrastructure, or other domain agent with Open Index over MCP.

DrDroidLab/open-index · 48 tokens

build-personal-brain

Create, resume, validate, connect, or maintain a private cross-project memory for AI assistants. Use when a person asks to build a personal memory from local work folders and past assistant conversations, continue an interrupted memory audit, connect an existing memory to another local assistant, verify that the…

mikeshu2001/personal-brain-builder · 81 tokens

codex-memory-guard

Guard task boundaries and preserve confirmed critical project state across Codex compaction. Use when a user wants topic-switch guidance, write-through critical memory, compact HANDOFF checkpoints, PreCompact and compact-resume hooks, four-layer Markdown memory initialization, or memory workflow auditing.

wl1650918245/codex-memory-guard · 59 tokens