agentleFS
sonichisonichi/sutando/skills/image-generation/SKILL.md

image-generation

Skill396 starsChanged 7 months agoMITView on GitHub

Generate an image from a prompt or edit an existing one (Gemini image model, standard library only, any Gemini key the resolver finds) and attach the file to the reply; generate a video with Veo when the google-genai SDK is installed. Use when the owner asks for a picture, logo, hero image, mockup, illustration, edited photo, or a short video clip.

  • Reads credentials

41 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use gift-evaluator, Podcast Generate and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • jjyaoaoSkill

    gift-evaluator

    The PRIMARY tool for Spring Festival gift analysis and social interaction generation. Use this skill when users upload photos of gifts (alcohol, tea, supplements, etc.) to inquire about their value, authenticity, or how to respond socially. Integrates visual perception, market valuation, and HTML card generation.

    Also in 4 projects that use this

  • jjyaoaoSkill

    Podcast Generate

    Generate podcast episodes from user-provided content or by searching the web for specified topics. If user uploads a text file/article, creates a dual-host dialogue podcast (or single-host upon request). If no content is provided, searches the web for information about the user-specified topic and generates a podcast. Duration scales with content size (3-20 minutes, ~240 chars/min). Uses z-ai-web-dev-sdk for LLM script generation and TTS audio synthesis. Outputs both a podcast script (Markdown) and a complete audio file (WAV).

    Also in 4 projects that use this

  • michaelboedingSkill

    music-generation

    Use this skill for AI music generation. Triggers include: "generate music", "create a song", "make music", "compose", "create a beat", "generate audio", "make a soundtrack", "create a jingle", "instrumental music", "background music", "lo-fi beats", "electronic music" Supports vocals (Suno/Udio) and instrumental-only (Google Lyria).

    Also in 4 projects that use this

  • michaelboedingSkill

    video-generation

    Use this skill for AI video generation. Triggers include: "generate video", "create video", "make video", "animate", "text to video", "video from image", "video of", "animate image", "bring to life", "make it move", "add motion", "video with audio", "video with dialogue" Supports text-to-video, image-to-video, video with dialogue/audio using Google Veo 3.1 (default) or OpenAI Sora.

    Also in 10 projects that use this

  • MindrallySkill

    llm

    Large Language Model development, training, fine-tuning, and deployment best practices.

    Also in 4 projects that use this

  • SuperInstanceSkill

    aminer-data-search

    使用 AMiner 开放平台 API 进行学术数据查询与分析。当用户需要查询学者信息、论文详情、机构数据、期刊内容或专利信息时使用此 skill。 触发场景:提到 AMiner、学术数据查询、查论文/学者/机构/期刊/专利、学术问答搜索、引用分析、科研机构分析、学者画像、论文引用链、期刊投稿分析等。 支持 6 大组合工作流(学者全景分析、论文深度挖掘、机构研究力分析、期刊论文监控、学术智能问答、专利链分析)以及 28 个独立 API 的直接调用。 即使用户只说"帮我查一下 XXX 学者"或"找找关于 XXX 的论文",也应主动使用此 skill。

    Also in 3 projects that use this

  • +2 more from jjyaoao

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 33 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every failure line carries a remedy.

    line 42

“Common” is measured: kept by at least 6 in 10 of the 33 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Image and video generation

scripts/generate.py makes an image (or a video) from a prompt and prints one JSON line on stdout. Nothing to install for images: it calls the Gemini REST API with the standard library and takes the key from the credential resolver (gemini-image: the managed key of a desktop install, else GEMINI_API_KEY / GEMINI_VOICE_API_KEY). Never run pip for this skill; Pillow is optional (input resizing, jpg/webp conversion) and google-genai is only needed for --video.

Run it

G="<this skill's directory>/scripts/generate.py"
python3 "$G" --prompt "A flat-design mascot for a note-taking app, teal and cream"     # text-to-image
python3 "$G" --input photo.jpg --prompt "Replace the background with a sunset"          # edit
python3 "$G" --prompt "A cute robot" --output "<workspace>/results/media/robot.png"     # explicit path
python3 "$G" --video --prompt "A timelapse of a city at sunset" [--aspect 9:16]         # video (SDK)

Output lands at <workspace>/results/media/generated-<ts>.png (.mp4 for video), which is inside the attachment allowlist, so the file can be sent as-is. --model overrides IMAGE_MODEL / VIDEO_MODEL (env, then this skill's manifest.json config).

Read the result

stdout is exactly one JSON line; progress goes to stderr.

lineexitwhat to do
{"ok": true, "path": "...", "model": "...", "note"?: "..."}0deliver the file (below)
{"ok": false, "error": "no_key", ...}2say the no-key message, verbatim, and stop
{"ok": false, "error": "refused", "message": ...}1say it was declined; offer a reworded prompt
{"ok": false, "error": "no_image", "message": ...}1say what the model answered instead; offer a more concrete prompt
{"ok": false, "error": "api_error", "message": ...}1say it failed on Google's side; one retry at most, then stop
{"ok": false, "error": "sdk_missing", ...} (video)2say the SDK is missing; offer an image instead
{"ok": false, "error": "bad_input", ...}2fix the input path; ask for the image again

Every failure line carries a remedy; say it. Never imply an image exists when ok is false.

Deliver the image

The reply that carries the picture has the [file: <path>] marker on its own line, with the path from the JSON, and one short line of text:

Here's the mascot.
[file: /Users/…/workspace/results/media/generated-1789000000000.png]

In a task result this goes in the result file; in a direct reply, in the message. A generated image goes where it was asked (it is your own work, not private data): the room the request came from, or the DM when that is where it was asked.

What to say when it fails (verbatim)

  • no_key: "I can't generate images on this install yet: there is no Gemini key for image generation. Add one in Agent settings → Agent → Gemini API, or ask again once your plan includes the managed key."
  • refused: "Gemini declined to generate that image: <message>. I can try a reworded prompt (no real people's faces, no copyrighted characters)."
  • no_image: "Gemini answered with text instead of an image: <message>. Want me to try a more concrete description?"
  • quota: "I can't generate images with the current Gemini key: Google says it has no image quota (a free-tier key has 0 image requests per day). Enable billing on that key's Google Cloud project, or switch to the managed key in Agent settings → Agent → Gemini API." Say which key it was when the message names it; never retry a quota error.
  • api_error: "Image generation failed on Google's side: <message>. I can try once more in a moment."
  • sdk_missing (video only): "I can't generate videos on this install: the google-genai package is not installed. Run pip3 install google-genai on this machine, or I can make an image instead."

State the blocker in one line, name what unblocks it, and stop; no silent retries.

Notes

  • Video generation takes 1-3 minutes (polled every 10 s); Google keeps generated videos for 2 days.
  • For image editing, be explicit: "keep the subject unchanged, only modify the background".
  • Output format follows the --output extension when Pillow can convert; otherwise the returned format is kept under its own extension, never mislabelled. Maximum input image size ~20 MB.
  • Options: --prompt (required), --input (repeatable), --output, --model, --video, --aspect (16:9 default, 9:16), --quality (jpg/webp, default 90).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.