generate-image
Generate and edit images using Google Gemini (Nano Banana). Use when user asks to create, generate, or edit images. Requires Chrome logged into gemini.google.com.
$ 安裝
git clone https://github.com/majiayu000/claude-skill-registry /tmp/claude-skill-registry && cp -r /tmp/claude-skill-registry/skills/design/generate-image ~/.claude/skills/claude-skill-registry// tip: Run this command in your terminal to install the skill
name: generate-image description: "Generate and edit images using Google Gemini (Nano Banana). Use when user asks to create, generate, or edit images. Requires Chrome logged into gemini.google.com."
<generate_image_skill> Image Generator <primary_goal>Generate and edit images using Gemini Nano Banana via browser cookies</primary_goal>
With options:
```bash
~/.claude/skills/generate-image/scripts/nano-banana "A cat in space" --output /tmp/cat.png --aspect 16:9
```
Edit an existing image:
```bash
~/.claude/skills/generate-image/scripts/nano-banana "Make the sky purple" --input photo.jpg --output /tmp/edited.png
```
<cli_options>
| Option | Description |
|--------|-------------|
| --output, -o FILE | Output file path (default: generated.png) |
| --input, -i FILE | Input image for editing mode |
| --aspect RATIO | Aspect ratio hint (e.g., 16:9, 1:1, 4:3, 3:4) |
| --retries N | Number of retries for transient failures (default: 3) |
| --timeout SECS | Client initialization timeout in seconds (default: 90) |
| --help, -h | Show help |
Model: gemini-3.0-pro (Nano Banana Pro) - hardcoded for best image quality
</cli_options>
<example name="Generate with specific aspect ratio">
```bash
~/.claude/skills/generate-image/scripts/nano-banana "A panoramic mountain landscape" --aspect 16:9 --output /tmp/landscape.png
```
</example>
<example name="Generate a portrait">
```bash
~/.claude/skills/generate-image/scripts/nano-banana "A professional headshot photo style portrait" --aspect 3:4 --output /tmp/portrait.png
```
</example>
<example name="Edit an existing image">
```bash
~/.claude/skills/generate-image/scripts/nano-banana "Add a rainbow in the sky" --input /tmp/photo.jpg --output /tmp/with-rainbow.png
```
</example>
<example name="Generate detailed artwork">
```bash
~/.claude/skills/generate-image/scripts/nano-banana "Detailed oil painting of a forest at dawn" --output /tmp/painting.png
```
</example>
<prompting_tips> Be specific and descriptive - "A red vintage sports car on a winding mountain road at sunset" works better than "a car" Include style hints - "in the style of watercolor painting", "photorealistic", "3D render" Specify lighting - "golden hour lighting", "dramatic shadows", "soft diffused light" Mention composition - "close-up", "wide angle", "bird's eye view" For editing, describe the specific change you want, not the full scene </prompting_tips>
<issue name="Transient/timeout errors">
<symptom>Timeout, connection reset, or 5xx errors during generation</symptom>
<solution>The client automatically retries with backoff. If failures persist, try --retries 5. Check your network connection.</solution>
</issue>
<issue name="No images generated">
<symptom>Script runs but no image output after retries</symptom>
<solution>
1. Rephrase prompt to be more explicit
2. Some content may be filtered by safety systems
3. Try simpler prompts first to verify the client works
4. Check stderr for model's text response (may explain why image failed)
</solution>
</issue>
<issue name="Module not found">
<symptom>ImportError for gemini_webapi or browser_cookie3</symptom>
<solution>Run: cd ~/.claude/skills/generate-image && pip install -r requirements.txt</solution>
</issue>
<issue name="Permission denied on macOS">
<symptom>Error reading Chrome cookies</symptom>
<solution>Grant Keychain access when macOS prompts. You may need to run the script again after granting access.</solution>
</issue>
<issue name="Rate limiting">
<symptom>Repeated failures with rate limit errors</symptom>
<solution>Wait a few minutes before retrying. The client uses exponential backoff automatically.</solution>
</issue>
<important_notes> Requires Chrome logged into gemini.google.com - cookies are auto-extracted First run on macOS will prompt for Keychain access Image generation uses your Google account's Gemini quota Generated images include SynthID watermark (Google's AI watermark) Default output is 1024x1024 PNG </important_notes> </generate_image_skill>
Repository
