baoyu-image-gen

Generates images from text prompts via OpenAI, Google, and DashScope APIs.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/chhpt/skills --skill baoyu-image-gen-chhpt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: baoyu-image-gen
Source: https://github.com/chhpt/skills/tree/main/skills/baoyu-image-gen
Command: npx skills add https://github.com/chhpt/skills --skill baoyu-image-gen-chhpt

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Creating images programmatically requires juggling multiple provider APIs, each with different endpoints, parameters, and authentication schemes. This Skill unifies OpenAI, Google (Gemini/Imagen), and DashScope (阿里通义万象) image generation behind a single CLI script with consistent options for aspect ratio, quality, and reference images. ## Core Features & Use Cases - Multi-Provider Generation: Generate images with OpenAI (gpt-image, DALL-E), Google (Gemini multimodal, Imagen), or DashScope, with automatic provider detection based on available API keys. - Reference Image Editing: Pass reference images for image-to-image editing via Google multimodal models or OpenAI GPT Image edits. - Configurable Defaults: Set default provider, quality, aspect ratio, and models through EXTEND.md preference files at project or user level. - Use Case: A content creator needs a 16:9 cover illustration at 2K quality. Run the script with --ar 16:9 --quality 2k and the image is generated and saved to the specified path. ## Quick Start Ask the AI to generate an image of a cat saved as cat.png using the baoyu-image-gen skill with your preferred provider and aspect ratio.

Frequently Asked Questions about baoyu-image-gen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate an image with a specific aspect ratio?

Pass the --ar flag with a ratio like 16:9, 1:1, 4:3, 3:4, or 2.35:1. Google models use native aspect ratio parameters, while OpenAI maps the ratio to its closest supported size such as 1536x1024 for landscape.

Which providers support reference images for image editing?

Reference images work with Google Gemini multimodal models (gemini-3-pro-image-preview, gemini-3-flash-preview) and OpenAI GPT Image models via the edits endpoint. DashScope and Imagen models do not support reference images.

What API keys are needed for AI image generation?

Set GOOGLE_API_KEY or GEMINI_API_KEY for Google, OPENAI_API_KEY for OpenAI, or DASHSCOPE_API_KEY for DashScope. Keys can be placed in environment variables or in .baoyu-skills/.env files in your project or home directory.

How does the script choose between OpenAI, Google, and DashScope?

If --provider is specified, that provider is used. Otherwise the script auto-detects based on available API keys, defaulting to Google when multiple keys exist. With reference images and no provider specified, Google is tried first, then OpenAI.

Can I set default quality and model preferences?

Yes, create an EXTEND.md file with YAML frontmatter in .baoyu-skills/baoyu-image-gen/ at project or user level. It supports default_provider, default_quality, default_aspect_ratio, default_image_size, and per-provider default models.

Why does image generation fail with reference images?

Failures occur when using providers or models that do not support reference inputs, such as DashScope, Imagen, or DALL-E models. Switch to a Gemini multimodal model or an OpenAI GPT Image model like gpt-image-1.5.