Skip to content

Commit 27c9862

Browse files
committed
fix: correct ImageConfig parameters and document watermark limitation v1.0.1
1 parent 8dd28cc commit 27c9862

File tree

4 files changed

+47
-4
lines changed

4 files changed

+47
-4
lines changed

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"name": "nano-banana-image-editor",
9090
"source": "./plugins/nano-banana-image-editor",
9191
"description": "Create and edit images with natural language using Gemini 3 Pro Image. Use for image generation, photo editing, infographics, icons, style transfer, and text rendering. Includes Google Search grounding for factual content and PIL/Pillow for quick crops.",
92-
"version": "1.0.0",
92+
"version": "1.0.1",
9393
"author": {
9494
"name": "Em"
9595
},

plugins/nano-banana-image-editor/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ All notable changes to the nano-banana-image-editor plugin will be documented in
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.0.1] - 2025-11-21
9+
10+
### Added
11+
12+
- New "Recreating Templates with Different Characters" section in SKILL.md with guidance on passing both template and character references
13+
14+
### Fixed
15+
16+
- Corrected `ImageConfig` parameter names to use Python snake_case (`aspect_ratio` and `image_size` instead of camelCase `aspectRatio` and `imageSize`)
17+
- Documented that prompts requesting "remove watermark" trigger Gemini content policy blocks to protect SynthID watermarks
18+
819
## [1.0.0] - 2025-11-21
920

1021
### Added

plugins/nano-banana-image-editor/skills/nano-banana-image-editor/SKILL.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,31 @@ ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv/bin/python3 ${CLAUDE
125125

126126
### Advanced Multi-Image Features
127127

128+
#### Recreating Templates with Different Characters
129+
130+
**Important**: When recreating memes, comics, or templates with different characters, **always pass both the template AND the character references**.
131+
132+
```bash
133+
${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/create_image.py \
134+
output.png "Recreate this meme template using these characters" \
135+
--reference template.png --reference character1.png --reference character2.png \
136+
--resolution 2K --aspect-ratio 16:9
137+
```
138+
139+
**Why both?**
140+
141+
- The **template/meme reference** provides the composition, layout, poses, and panel structure
142+
- The **character references** provide facial features, hairstyles, and distinctive characteristics to maintain
143+
144+
**Example: Recreating a two-panel comic meme**
145+
146+
```bash
147+
${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/create_image.py \
148+
my-meme.png "Recreate this two-panel comic using these two women as the characters. Maintain the exact composition and poses from the template." \
149+
--reference original-meme.png --reference my-characters.png \
150+
--resolution 2K --aspect-ratio 16:9
151+
```
152+
128153
#### Character Consistency (Up to 5 People)
129154

130155
Create group photos maintaining facial resemblance:
@@ -225,6 +250,7 @@ ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv/bin/python3 ${CLAUDE
225250
- **Iterative editing**: Make one change at a time for better results
226251
- **Reference locations**: Use "top left", "bottom right", "center" to specify areas
227252
- **Use reference images**: Provide style examples, object references, or character photos when appropriate
253+
- **Pass ALL relevant references**: When recreating templates/memes with different characters, pass both the template image AND the character images as references
228254
- **Enable search for facts**: Add `--search` when generating content requiring real-time information
229255

230256
**For comprehensive prompting strategies, see `references/prompting_guide.md`**
@@ -289,6 +315,12 @@ ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv/bin/python3 ${CLAUDE
289315
- Try breaking complex edits into multiple steps
290316
- Ensure input image quality is sufficient
291317

318+
**"MALFORMED_FUNCTION_CALL" error when editing:**
319+
320+
- **Do NOT request watermark removal** - Gemini blocks prompts mentioning "remove watermark" to protect SynthID watermarks
321+
- Avoid prompts like "remove the watermark" or "clean up watermarks"
322+
- This is a content policy restriction, not a technical limitation
323+
292324
**Prompts with dollar signs or special characters getting stripped:**
293325

294326
- **Problem:** Dollar signs (`$3`, `$4.50`) and other bash special characters get removed from prompts

plugins/nano-banana-image-editor/skills/nano-banana-image-editor/scripts/gemini_image.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ def generate_image(
118118
# Build image config with aspect ratio and resolution
119119
# Requires google-genai >= 1.48.0 (Python 3.10+)
120120
image_config = types.ImageConfig(
121-
aspectRatio=aspect_ratio,
122-
imageSize=resolution
121+
aspect_ratio=aspect_ratio,
122+
image_size=resolution
123123
)
124124

125125
# Build generation config with image settings
@@ -157,7 +157,7 @@ def generate_image(
157157
sys.exit(1)
158158

159159
# Save the image
160-
if hasattr(response, 'parts'):
160+
if hasattr(response, 'parts') and response.parts is not None:
161161
for i, part in enumerate(response.parts):
162162
# New API: check for as_image() method
163163
if hasattr(part, 'as_image'):

0 commit comments

Comments
 (0)