# Generate Images with OpenAI and Google

Image prompts often need provider setup, sizes, and repeatable output paths. This skill runs an API-based generator with aspect ratio, quality, and reference image options.

## Install

```bash
npx skillstore add jimliu/baoyu-image-gen
```

## Metadata

- Status: approved
- Slug: jimliu-baoyu-image-gen
- Skillstore revision: r1
- Version status: missing
- Tree hash: 0fa92b2d71c2d13e625dc4ff77a61f3c3f22d93eb25018973424048383cfd694
- Author: jimliu
- GitHub username: jimliu
- License: MIT
- Repository: https://github.com/jimliu/baoyu-skills/tree/main/skills/baoyu-image-gen/
- Ref: a06681402992ceae98ba04d54cfd4ab004862696
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: confirmation\_required
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: scripts, external\_commands, filesystem, env\_access, network
- Quality score: 38
- Quality tier: warning
- Public page: https://skillstore.pages.dev/skills/jimliu-baoyu-image-gen
- Manifest: https://skillstore.pages.dev/api/skills/jimliu-baoyu-image-gen/manifest

## Capabilities

- Generates images from prompt text through OpenAI or Google APIs.
- Reads prompts from direct text, stdin, or prompt files.
- Supports common aspect ratios and OpenAI size mapping.
- Accepts reference images for supported Google multimodal models.
- Saves generated image bytes to a requested output path.
- Can return JSON metadata with provider, model, and saved image path.

## Use Cases

- Create Design Drafts: Generate concept art, product scenes, or campaign visuals from short prompts.
- Prepare Marketing Assets: Create wide, square, or portrait images for posts, slides, and landing pages.
- Automate Visual Workflows: Add API image generation to agent workflows with chosen providers and output paths.

## Prompt Templates

### Create a Single Image

```
Use baoyu-image-gen to create one image of a modern desk setup at sunrise. Save it as desk-scene.png.
```

### Set Shape and Quality

```
Generate a 16:9 hero image for a productivity app. Use 2k quality and save it in the project assets folder.
```

### Use a Reference Image

```
Use the provided reference image and generate a blue variant with the same composition. Use the Google provider.
```

### Run a Provider-Specific Set

```
Generate three options for a launch banner with OpenAI. Use a landscape aspect ratio and return concise result details.
```

## Limitations

- Requires a valid OpenAI, Google, or Gemini API key.
- Reference images are only used with supported Google multimodal models.
- Custom base URLs require careful trust because credentials are sent there.
- The script saves only the first image found in provider responses.

## Best Practices

- Keep API keys in user-level environment config and avoid committing project env files.
- Use explicit output paths inside the current project.
- Review custom base URLs before sending prompts or reference images.

## Anti Patterns

- Do not use secret documents as prompt files or reference images.
- Do not enable custom provider endpoints from untrusted projects.
- Do not request large batches without checking API cost and rate limits.

## Security Audit

- Audited at: 2026-07-06T15:43:58.409\+00:00
- Summary: The code mostly implements the documented image-generation workflow, and many static hits are documentation backticks or JavaScript template literals. Confirmed risks center on loading project and home env files, sending API credentials over network requests, and allowing project configuration to redirect provider base URLs.

## Stats

- Views: 175
- Downloads: 27
- Favorites: 1
- Popularity score: 0
