nano-banana-pro について
nano-banana-proは、Google Nano Banana Pro APIで画像を生成・編集するスキルです。解像度、アスペクト比、出力先、参照画像を指定できるコマンドラインスクリプトを提供します。
主な機能
- 01テキストプロンプトから画像を生成
- 02解像度とアスペクト比の指定
- 03出力先ディレクトリの指定
- 04参照ファイルを使った画像編集
- 05複数の参照画像の利用
活用シーン
- 01文章の説明からイラストを作成
- 02指定したサイズで画像を生成
- 03既存画像の背景を変更
- 04参照画像を使ったスタイル適用
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ feedtailor/ ccskill-nanobanana --skill nano-banana-proインストール後、Claude Code で/nano-banana-proを入力して読み込まれたか確認します。
同梱ファイルSKILL.ja.md
詳細
Nano Banana Pro 画像生成スキル
概要
このスキルは、Google Nano Banana Pro API を使用して画像を生成します。 ユーザーが画像生成を必要とする場合にこのスキルを使用します。
前提条件
- 環境変数
CCSKILL_NANOBANANA_DIRにこのスキルのリポジトリのパスを設定しますexport CCSKILL_NANOBANANA_DIR="$HOME/projects/ccskill-nanobanana" - 環境変数
GEMINI_API_KEYを設定する必要があります(または$CCSKILL_NANOBANANA_DIR/.envで指定します)
使用方法
次のコマンドで画像を生成します:
$CCSKILL_NANOBANANA_DIR/venv/bin/python $CCSKILL_NANOBANANA_DIR/generate_image.py "prompt"
オプション
--resolution: 解像度(1K、2K、4K)デフォルト: 2K--aspect: アスペクト比(1:1、16:9、9:16、4:3 など)デフォルト: 16:9--output: 出力ディレクトリ デフォルト: ./generated_images--reference: 参照画像のパス(複数指定可能、最大 14 枚)
例
基本的な画像生成:
$CCSKILL_NANOBANANA_DIR/venv/bin/python $CCSKILL_NANOBANANA_DIR/generate_image.py "a cat playing piano in watercolor style"
高解像度のワイド画像:
$CCSKILL_NANOBANANA_DIR/venv/bin/python $CCSKILL_NANOBANANA_DIR/generate_image.py "sunset coastline" --resolution 4K --aspect 16:9
特定のディレクトリに出力:
$CCSKILL_NANOBANANA_DIR/venv/bin/python $CCSKILL_NANOBANANA_DIR/generate_image.py "logo design" --output ./assets/images
参照画像の編集
参照画像を指定することで、既存の画像を編集・変更できます:
# Change background
$CCSKILL_NANOBANANA_DIR/venv/bin/python $CCSKILL_NANOBANANA_DIR/generate_image.py "change background to sunset" --reference ./original.png
# Use multiple reference images (pose, style, etc.)
$CCSKILL_NANOBANANA_DIR/venv/bin/python $CCSKILL_NANOBANANA_DIR/generate_image.py "draw this person in this pose" --reference ./person.png --reference ./pose.png
参照画像のユースケース:
- 部分的な画像編集(背景の変更、色調整など)
- スタイル転送(別の画像のスタイルを適用)
- キャラクターの一貫性(異なるシーンで同じ人物)
- 画像の合成
プロンプト作成ガイド
クイックリファレンス
出典: 7 tips to get the most out of Nano Banana Pro - Google 公式ブログ
より良い結果を得るには、プロンプトに次の要素を含めてください:
- 被写体: 画像に誰/何が写っていますか?具体的に指定します。(例: 「青く光る目をした寡黙なロボットバリスタ」、「小さな魔法使いの帽子をかぶったふわふわの三毛猫」)
- 構図: ショットはどのようにフレーミングされていますか?(例: 極端なクローズアップ、ワイドショット、ローアングルショット、ポートレート)
- アクション: 何が起きていますか?(例: コーヒーを淹れている、呪文を唱えている、草原を走っている最中)
- 場所: シーンはどこで起こりますか?(例: 火星にある未来的なカフェ、散らかった錬金術師の書斎、ゴールデンアワーの日差しが差し込む草原)
- スタイル: 全体的な美学は何ですか?(例: 3D アニメーション、フィルムノワール、水彩画、フォトリアリスティック、1990 年代の商品写真)
- 編集指示: 既存の画像を編集する場合は、直接的かつ具体的に指定します。(例: 「男性のネクタイを緑に変更する」、「背景から車を削除する」)
プロフェッショナルな結果を得るには、より具体的な指示を含めてください:
- 構図とアスペクト比: キャンバスを定義します(例: 「9:16 の縦型ポスター」、「シネマティックな 21:9 のワイドショット」)
- カメラとライティング: 撮影監督のようにショットを演出します(例: 「被写界深度の浅いローアングルショット(f/1.8)」、「長い影を落とすゴールデンアワーの逆光」)
- テキストの統合: テキストの外観と配置を明確に指定します(例: 「見出し『URBAN EXPLORER』を上部に太字の白いサンセリフ体で配置する」)
包括的なガイド
出典: Guillaume Vernade、Gemini Developer Advocate、Google DeepMind
プロンプト作成の黄金律
Nano-Banana Pro は「思考する」モデルです。単にキーワードを照合するだけでなく、意図、物理法則、構図を理解します。最高の結果を得るには、「タグの寄せ集め」(例:dog, park, 4k, realistic)を使うのをやめ、クリエイティブディレクターのように振る舞いましょう。
1. 編集せよ、再生成するな
このモデルは、会話形式の編集を理解することに極めて優れています。画像が 80% 正しいなら、ゼロから新しい画像を生成しないでください。代わりに、必要な具体的な変更を simply 依頼するだけで済みます。
例:「それは素晴らしいですが、照明を夕日に変えて、テキストをネオンブルーにしてください。」
2. 自然な言語と完全な文を使用する
まるで人間のアーティストに指示を出すかのように、モデルに話しかけてください。正しい文法と描写力のある形容詞を使いましょう。
- 悪い例:「Cool car, neon, city, night, 8k.」
- 良い例:「雨の降る夜の東京の街を疾走する未来的なスポーツカーのシネマティックなワイドショット。ネオンサインが濡れた路面と車の金属製シャシーに反射している。」
3. 具体的かつ描写的に
曖昧なプロンプトはありきたりな結果しか生みません。被写体、設定、照明、雰囲気を定義しましょう。
- 被写体:「a woman」ではなく「ヴィンテージのシャネル風スーツを着た洗練された老婦人」と言いましょう。
- 質感:テクスチャを描写しましょう。「マット仕上げ」「ヘアライン仕上げの鋼」「柔らかなベルベット」「しわくちゃの紙」。
4. コンテキスト(「なぜ」または「誰のために」)を提供する
このモデルは「思考する」ため、コンテキストを与えることで論理的な芸術的判断を下す助けになります。
例:「ブラジルの高級グルメ料理本用のサンドイッチの画像を作成してください。」(モデルはプロフェッショナルな盛り付け、浅い被写界深度、完璧な照明を推論します)。
テキストレンダリング、インフォグラフィック、視覚的合成
Nano-Banana Pro は、読みやすく様式化されたテキストのレンダリングと、複雑な情報を視覚的形式に合成するための SOTA 能力を備えています。
ベストプラクティス:
- 圧縮:高密度のテキストや PDF を視覚的補助資料に「圧縮」するようモデルに依頼しましょう。
- スタイル:「洗練されたエディトリアル」「技術図解」「手描きホワイトボード」の見た目のどれが欲しいかを指定しましょう。
- 引用:引用符で囲んで欲しいテキストを明確に指定しましょう。
プロンプト例:
決算報告インフォグラフィック(データ取り込み):
[Input PDF of Google's latest earnings report]
"Generate a clean, modern infographic summarizing the key financial highlights from this earnings report. Include charts for 'Revenue Growth' and 'Net Income', and highlight the CEO's key quote in a stylized pull-quote box."
レトロインフォグラフィック:
"Make a retro, 1950s-style infographic about the history of the American diner. Include distinct sections for 'The Food,' 'The Jukebox,' and 'The Decor.' Ensure all text is legible and stylized to match the period."
技術図解:
"Create an orthographic blueprint that describes this building in plan, elevation, and section. Label the 'North Elevation' and 'Main Entrance' clearly in technical architectural font. Format 16:9."
ホワイトボード要約(教育用):
"Summarize the concept of 'Transformer Neural Network Architecture' as a hand-drawn whiteboard diagram suitable for a university lecture. Use different colored markers for the Encoder and Decoder blocks, and include legible labels for 'Self-Attention' and 'Feed Forward'."
キャラクターの一貫性とバイラルサムネイル
Nano-Banana Pro は最大 14 枚の参照画像(高忠実度なら 6 枚)をサポートします。これにより「アイデンティティロック」—特定の人物やキャラクターを顔の歪みなく新しいシナリオに配置することが可能になります。
ベストプラクティス:
- アイデンティティロック:「画像 1 とまったく同じ人物の顔の特徴を保ってください」と明示的に述べましょう。
- 表情/動作:アイデンティティを維持しながら、感情やポーズの変化を描写しましょう。
- バイラル構図:被写体と大胆なグラフィックやテキストを 1 回のパスで組み合わせましょう。
プロンプト例:
「バイラルサムネイル」(アイデンティティ+テキスト+グラフィック):
"Design a viral video thumbnail using the person from Image 1. Face Consistency: Keep the person's facial features exactly the same as Image 1, but change their expression to look excited and surprised. Action: Pose the person on the left side, pointing their finger towards the right side of the frame. Subject: On the right side, place a high-quality image of a delicious avocado toast. Graphics: Add a bold yellow arrow connecting the person's finger to the toast. Text: Overlay massive, pop-style text in the middle: '3 mins!' Use a thick white outline and drop shadow. Background: A blurred, bright kitchen background. High saturation and contrast."
「ふわふわの仲間たち」シナリオ(グループの一貫性):
[Input 3 images of different plush creatures]
"Create a funny 10-part story with these 3 fluffy friends going on a tropical vacation. The story is thrilling throughout with emotional highs and lows and ends in a happy moment. Keep the attire and identity consistent for all 3 characters, but their expressions and angles should vary throughout all 10 images. Make sure to only have one of each character in each image."
ブランドアセット生成:
[Input 1 image of a product]
"Create 9 stunning fashion shots as if they're from an award-winning fashion editorial. Use this reference as the brand style but add nuance and variety to the range so they convey a professional design touch. Please generate nine images, one at a time."
高度な編集、復元、カラー化
このモデルは、会話形式のプロンプトによる複雑な編集に優れています。これには「インペインティング」(オブジェクトの削除/追加)、「復元」(古い写真の修復)、「カラー化」(マンガ/白黒写真)、「スタイルの交換」が含まれます。
ベストプラクティス:
- 意味論的指示:手動でマスクする必要はありません。変更したい内容を自然にモデルに伝えるだけで済みます。
- 物理法則の理解:物理生成をテストするために、「このグラスに液体を注いでください」のような複雑な変更を依頼できます。
プロンプト例:
オブジェクトの削除とインペインティング:
"Remove the tourists from the background of this photo and fill the space with logical textures (cobblestones and storefronts) that match the surrounding environment."
マンガ/コミックのカラー化:
[Input black and white manga panel]
"Colorize this manga panel. Use a vibrant anime style palette. Ensure the lighting effects on the energy beams are glowing neon blue and the character's outfit is consistent with their official colors."
ローカライズ(テキスト翻訳+文化的適応):
[Input image of a London bus stop ad]
"Take this concept and localize it to a Tokyo setting, including translating the tagline into Japanese. Change the background to a bustling Shibuya street at night."
照明/季節のコントロール:
[Input image of a house in summer]
"Turn this scene into winter time. Keep the house architecture exactly the same, but add snow to the roof and yard, and change the lighting to a cold, overcast afternoon."
次元変換(2D → 3D)
2D の図面を 3D ビジュアライゼーションに変換する、あるいはその逆を行う強力な新機能です。インテリアデザイナー、建築家、ミーム制作者に最適です。
プロンプト例:
2D 間取り図から 3D インテリアデザインボードへ:
"Based on the uploaded 2D floor plan, generate a professional interior design presentation board in a single image. Layout: A collage with one large main image at the top (wide-angle perspective of the living area), and three smaller images below (Master Bedroom, Home Office, and a 3D top-down floor plan). Style: Apply a Modern Minimalist style with warm oak wood flooring and off-white walls across ALL images. Quality: Photorealistic rendering, soft natural lighting."
2D から 3D へのミーム変換:
"Turn the 'This is Fine' dog meme into a photorealistic 3D render. Keep the composition identical but make the dog look like a plush toy and the fire look like realistic flames."
ワンショットのストーリーボード & コンセプトアート
グリッドなしで連続したアートやストーリーボードを生成でき、1 回のセッションで一貫した物語の流れを確保できます。これは「映画のコンセプトアート」(例: 公開予定作品の偽リーク)としても人気です。
プロンプト例:
"Create an addictively intriguing 9-part story with 9 images featuring a woman and man in an award-winning luxury luggage commercial. The story should have emotional highs and lows, ending on an elegant shot of the woman with the logo. The identity of the woman and man and their attire must stay consistent throughout but they can and should be seen from different angles and distances. Please generate images one at a time. Make sure every image is in a 16:9 landscape format."
構造制御 & レイアウトガイダンス
入力画像は、キャラクターの参照や編集対象の被写体に限定されません。最終出力の構図やレイアウトを厳密に制御するために使用できます。これは、ナプキンに描いたスケッチ、ワイヤーフレーム、特定のグリッドレイアウトを洗練されたアセットに変換する必要があるデザイナーにとって画期的なものです。
ベストプラクティス:
- 下書き & スケッチ: 手描きのスケッチをアップロードして、テキストやオブジェクトを配置すべき場所を正確に定義します。
- ワイヤーフレーム: 既存のレイアウトやワイヤーフレームのスクリーンショットを使用して、高忠実度の UI モックアップを生成します。
- グリッド: グリッド画像を使用して、タイルベースのゲームや LED ディスプレイ向けのアセットをモデルに強制的に生成させます。
プロンプト例:
スケッチから最終広告へ:
"Create a ad for a [product] following this sketch."
ワイヤーフレームから UI モックアップへ:
"Create a mock-up for a [product] following these guidelines."
ピクセルアート & LED ディスプレイ:
"Generate a pixel art sprite of a unicorn that fits perfectly into this 64x64 grid image. Use high contrast colors."
(Tip: Developers can then programmatically extract the center color of each cell to drive a connected 64x64 LED matrix display).
スプライト:
"Sprite sheet of a woman doing a backflip on a drone, 3x3 grid, sequence, frame by frame animation, square aspect ratio. Follow the structure of the attached reference image exactly."
(Tip: You can then extract each cell and make a gif)
現在の制限事項
- 小さなテキスト、細かいディテール、正確なスペルは完璧でない場合があります
- 図やインフォグラフィックの事実的な正確性は常に確認してください
- 多言語のテキスト生成には、文法上の誤りや文化的なニュアンスの欠如がある場合があります
- コンポジットやライティング変更などの高度な編集では、不自然なアーティファクトが生じる場合があります
出力
- 画像は指定したディレクトリに保存されます(デフォルト:
./generated_images) - ファイル名の形式はタイムスタンプです(例:
20251130_153045.png、20251130_153045.jpg) - ファイル拡張子は API レスポンスの形式(PNG/JPEG/WebP)に基づいて自動的に決定されます
注意事項
- 環境変数
GEMINI_API_KEYを設定する必要があります - Nano Banana Pro は有料 API であるため、料金が発生します
- 生成された画像には SynthID ウォーターマークが含まれます