All skills
github avatar

/generate-image

@83cd18c official
by githubgithub/awesome-copilot40k stars
5,040

Generate images using AI. Use when asked to generate, create, or make images, textures, icons, sprites, artwork, visual assets, or mockups. Supports OpenAI (gpt-image-2) and Google Gemini (Nano Banana). Requires an API key for the chosen provider.

Use this Skill: https://skilld.dev/gh/github/awesome-copilot/generate-image

This session only. Nothing lands on disk.

SKILL.md

โ‰ˆ66 tokens always: the name and description. โ‰ˆ855 when used: this file.

Generate Image

You are an image generation assistant. When invoked, follow the workflow below.

Workflow

  1. Check for API keys โ€” check whether SKILL_IMAGE_GEN_OPENAI_KEY and/or SKILL_IMAGE_GEN_GEMINI_KEY are set in the environment.
  2. If one key is set โ€” use that provider. No need to ask.
  3. If both are set โ€” pick based on context (OpenAI for polish, Gemini for speed), or ask if the user has a preference.
  4. If no keys are set โ€” run the Onboarding section.
  5. Generate the image using the appropriate API reference.
  6. Tell the user where the image was saved.

Onboarding

Only run this if no keys are set. Guide the user conversationally.

  1. Ask which provider they'd like to use:
    • OpenAI (gpt-image-2) โ€” High quality, excellent text rendering, paid per image
    • Google Gemini (Nano Banana) โ€” Fast, free tier available, great for iteration
  2. Direct them to get an API key:
  3. Once they provide the key, set SKILL_IMAGE_GEN_OPENAI_KEY or SKILL_IMAGE_GEN_GEMINI_KEY in the current session and persist it to the appropriate shell profile.
  4. Proceed to generate the image they originally asked for.

API Reference: OpenAI

Method: POST URL: https://api.openai.com/v1/images/generations

Headers:

  • Authorization: Bearer <SKILL_IMAGE_GEN_OPENAI_KEY>
  • Content-Type: application/json

Body (JSON):

{
  "model": "gpt-image-2",
  "prompt": "<user prompt>",
  "n": 1,
  "size": "1024x1024",
  "quality": "medium"
}
Field Default Options
model gpt-image-2 gpt-image-2, gpt-image-1
size 1024x1024 1024x1024, 1024x1536, 1536x1024, auto
quality medium low, medium, high

Response: data[0].b64_json contains the base64-encoded image. Decode it and save to the output path. If data[0].url is present instead, download the image from that URL.

API Reference: Google Gemini (Nano Banana)

Method: POST URL: https://generativelanguage.googleapis.com/v1beta/models/<model>:generateContent

Headers:

  • x-goog-api-key: <SKILL_IMAGE_GEN_GEMINI_KEY>
  • Content-Type: application/json

Body (JSON):

{
  "contents": [{"parts": [{"text": "Generate an image: <user prompt>"}]}],
  "generationConfig": {"responseModalities": ["TEXT", "IMAGE"]}
}
Field Default Options
model (in URL) gemini-2.0-flash-exp gemini-2.0-flash-exp, gemini-2.5-flash-image

Response: Find candidates[0].content.parts[] โ€” look for a part with inlineData.data (base64 image) and inlineData.mimeType. Decode and save.

Error cases: error key (API error), promptFeedback.blockReason (safety block), finishReason: "SAFETY" (filtered).

Agent Guidelines

  • Choose the output path intelligently โ€” save to the project's relevant directory (e.g., assets/, images/, or the current directory).
  • For game textures, enrich prompts with "seamless", "tileable", "game asset".
  • For batch generation, make multiple API calls in parallel.
  • If the user asks to switch providers or what options are available, explain both and help them set up.
  • Always create the output directory before saving.
  • Ensure special characters in the user's prompt are properly escaped in the JSON body.

Source: SKILL.md on GitHub

1 warning11d3 checks ยท Risk MEDIUM
  • Gen Agent Trust Hub11d

    The skill facilitates AI-driven image generation through external API integrations and automates the storage of API credentials in system shell profiles.

  • Socket11d

    No alerts

  • Snyk11d

    Risk: LOW ยท No issues

Signed by skilld at 83cd18c. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 19 hours ago.

Activeupdated 5 months ago
argument-hint
[description of the image to generate]
metadata
{
  "version": "2.1.0",
  "providers": "openai, gemini"
}

README badge

README badge for github/awesome-copilot/generate-image

Generates images via OpenAI (DALL-E 3) or Google Gemini APIs based on text prompts. Handles API key setup, provider selection, and saves output to a specified path; supports customizable image dimensions and quality settings.

Generated from the current SKILL.md.

Which image generation providers does this skill support?
OpenAI (gpt-image-2) and Google Gemini (Nano Banana). OpenAI offers higher quality with better text rendering but is paid per image. Gemini is faster with a free tier available.
Do I need API keys to use this skill?
Yes. You must provide an API key for at least one provider (OpenAI or Gemini). If neither key is set, the skill runs an onboarding flow to help you get one.
Can I switch between providers after setup?
Yes. If you have both API keys configured, the skill picks based on context or asks for your preference. You can also set up additional providers during the session.
What image formats and sizes does this support?
OpenAI supports 1024x1024, 1024x1536, 1536x1024, or auto size. Google Gemini returns images in the format the API provides (base64 inline data with MIME type). Both output base64-encoded images that are decoded and saved to disk.
Does this skill support batch or parallel image generation?
Yes. The skill can make multiple API calls in parallel for batch generation requests.

Generated from the current SKILL.md. These answers refresh after source changes.