gemini-image

Generate images via API using $ARGUMENTS as prompt or interactively.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "gemini-image" with this command: npx skills add bahayonghang/my-claude-code-settings/bahayonghang-my-claude-code-settings-gemini-image

Generate images via API using $ARGUMENTS as prompt or interactively.

Steps

Read $SKILL_DIR/config/secrets.md to get API configuration. If missing, report error and link to secrets.example.md .

  • Check API_PROVIDER value: google (default) or proxy .

If $ARGUMENTS provided, use as prompt. Otherwise ask user for description.

Determine mode:

  • Text-to-Image: Use prompt text directly.

  • Image-to-Image: Upload local image first (see references/image-upload.md ), prepend URL to prompt.

Call API based on provider:

Google Official API (when API_PROVIDER=google ):

curl -s -X POST
"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-exp:generateContent?key=GOOGLE_API_KEY"
-H "Content-Type: application/json"
-d '{ "contents": [{"parts": [{"text": "prompt_text"}]}], "generationConfig": {"responseModalities": ["TEXT", "IMAGE"]} }'

Third-party Proxy API (when API_PROVIDER=proxy ):

curl -s -X POST "PROXY_BASE_URL/v1/images/generations"
-H "Authorization: Bearer PROXY_API_KEY"
-H "Content-Type: application/json"
-d '{"model":"model_name","prompt":"prompt_text","size":"aspect_ratio","n":1}'

Extract image data from response. For Google API, decode base64 inlineData ; for proxy API, extract data[0].url . Display image to user.

For Chinese text edits, follow references/chinese-text.md .

Supported Models

  • Google Official: gemini-2.0-flash-exp (or latest model supporting image generation)

  • Proxy: Depends on provider — check proxy service documentation for available models

Error Handling

  • No API Key: Report "missing config/secrets.md" and show setup instructions from secrets.example.md .

  • API error 4xx/5xx: Display status code and error message.

  • Network timeout: Retry once, then report failure.

  • Wrong provider config: Validate API_PROVIDER is either google or proxy .

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

tech-design-doc

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

article-cover

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

tech-blog

No summary provided by upstream source.

Repository SourceNeeds Review