mcpField
N
Nano Banana 2 Image Generation Master

Nano Banana 2 Image Generation Master

github.com/aiagentwithdhruvクリエイティブ・メディア2040 回インストール15 週間前に更新
リポジトリ

Nano Banana 2 Image Generation Master について

Nano Banana 2、または `generate_image` に接続されたモデル向けに、画像生成プロンプトを組み立てるスキルです。JSON形式と写実性を意識した記述方法に加え、fal.aiとEuri APIでの実行手順を示します。

主な機能

  1. 01構造化されたJSONプロンプト仕様
  2. 02詳細な文章形式のプロンプト
  3. 03カメラと照明の詳細ガイド
  4. 04ネガティブプロンプトの要件
  5. 05参照画像の入力に対応
  6. 06fal.aiとEuriでの実行手順

活用シーン

  1. 01写実的な画像の詳細プロンプトを作成
  2. 02参照画像を使ったプロンプトを準備
  3. 03fal.aiまたはEuriで画像を生成

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/aiagentwithdhruv/skills --skill nano-banana-2-image-generation-master

インストール後、Claude Code で/nano-banana-2-image-generation-masterを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

gemini.md
master_prompt_reference.md
scripts/
get_kie_image.py
generate_kie.py

詳細

Nano Banana 2 画像生成マスター

目標

このスキルの目的は、AI モデル Nano Banana 2(または generate_image ツールに接続された基盤モデル)を使用して画像を生成するための、標準化された高度に制御可能な方法を提供することです。構造化された JSON パラメータスキーマを厳格に適用することで、このスキルはモデル固有のバイアス(過度なスムージング、データセットの平均化、「プラスチック」のような AI スタイルなど)を抑制し、未加工で修正の加えられていない、超写実的な出力を実現します。

前提条件

  • fal.ai API キー(.env 内の FAL_KEY) — https://fal.ai で登録します(無料枠あり、Nano Banana 2 モデル)
  • または Euri API キー(.env 内の EURI_API_KEY)— https://euron.one/euri で Euron の学生は無料で利用できます
  • ユーザーが希望する被写体、照明、カメラの特性を明確に理解していること。

コアスキーマの構造

generate_image ツール用のプロンプトを作成するときは、基盤として次の JSON スキーマを必ず使用してください。文字列値には、極めて細かく詳細な内容を入力してください。

{
  "task": "string - High-level goal (e.g., 'sports_selfie_collage', 'single_macro_portrait')",
  
  "output": {
    "type": "string - e.g., 'single_image', '4-panel_collage'",
    "layout": "string - e.g., '1x1', '2x2_grid', 'side-by-side'",
    "aspect_ratio": "string - e.g., '3:4', '16:9', '4:5'",
    "resolution": "string - e.g., 'ultra_high', 'medium_low'",
    "camera_style": "string - e.g., 'smartphone_front_camera', 'professional_dslr'"
  },

  "image_quality_simulation": {
    "sharpness": "string - e.g., 'tack_sharp', 'slightly_soft_edges'",
    "noise": "string - e.g., 'unfiltered_sensor_grain', 'visible_film_grain', 'clean_digital'",
    "compression_artifacts": "boolean - true if attempting to simulate uploaded UGC",
    "dynamic_range": "string - e.g., 'limited', 'hdr_capable'",
    "white_balance": "string - e.g., 'slightly_warm', 'cool_fluorescent'",
    "lens_imperfections": [
      "array of strings - e.g., 'subtle chromatic aberration', 'minor lens distortion', 'vignetting'"
    ]
  },

  "subject": {
    "type": "string - e.g., 'human_portrait', 'nature_macro', 'infographic_flatlay'",
    "human_details": {
      "//": "Use this block ONLY for human subjects",
      "identity": "string",
      "appearance": "string - Extremely specific (e.g., visible pores, mild redness)",
      "outfit": "string"
    },
    "object_or_nature_details": {
      "//": "Use this block for non-human subjects",
      "material_or_texture": "string - e.g., 'brushed aluminum', 'dew-covered velvety petals'",
      "wear_and_tear": "string - e.g., 'subtle scratches on the anodized finish', 'browning edges on leaves'",
      "typography": "string - e.g., 'clean sans-serif overlaid text, perfectly legible'"
    }
  },

  "multi_panel_layout": {
    "grid_panels": [
      {
        "panel": "string - e.g., 'top_left', 'full_frame' (if not a grid)",
        "pose": "string - e.g., 'slight upward selfie angle, relaxed smile'",
        "action": "string - e.g., 'holding phone with one hand, casual posture'"
      }
    ]
  },

  "environment": {
    "location": "string - e.g., 'gym or outdoor sports area'",
    "background": "string - What is behind the subject (e.g., 'blurred gym equipment')",
    "lighting": {
      "type": "string - e.g., 'natural or overhead gym lighting', 'harsh direct sunlight'",
      "quality": "string - e.g., 'uneven, realistic, non-studio', 'high-contrast dramatic'"
    }
  },

  "embedded_text_and_overlays": {
    "text": "string (optional)",
    "location": "string (optional)"
  },

  "structural_preservation": {
    "preservation_rules": [
      "array of strings - e.g., 'Exact physical proportions must be preserved'"
    ]
  },

  "controlnet": {
    "pose_control": {
      "model_type": "string - e.g., 'DWPose'",
      "purpose": "string",
      "constraints": ["array of strings"],
      "recommended_weight": "number"
    },
    "depth_control": {
      "model_type": "string - e.g., 'ZoeDepth'",
      "purpose": "string",
      "constraints": ["array of strings"],
      "recommended_weight": "number"
    }
  },

  "explicit_restrictions": {
    "no_professional_retouching": "boolean - typically true for realism",
    "no_studio_lighting": "boolean - typically true for candid shots",
    "no_ai_beauty_filters": "boolean - mandatory true to avoid plastic look",
    "no_high_end_camera_look": "boolean - true if simulating smartphones"
  },

  "negative_prompt": {
    "forbidden_elements": [
      "array of strings - Massive list of 'AI style' blockers required for extreme realism. Example stack: 'anatomy normalization', 'body proportion averaging', 'dataset-average anatomy', 'wide-angle distortion not in reference', 'lens compression not in reference', 'cropping that removes volume', 'depth flattening', 'mirror selfies', 'reflections', 'beautification filters', 'skin smoothing', 'plastic skin', 'airbrushed texture', 'stylized realism', 'editorial fashion proportions', 'more realistic reinterpretation'"
    ]
  }
}

パラダイム 2:詳細なナラティブ形式(fal.ai などの API 向けに最適化)

通常の生成エンドポイント(文字列プロンプトのみを受け付けることが多い)に API 呼び出しを行う場合は、上記のロジックを、膨大な説明テキストを含む詳細でフラットな JSON 文字列にまとめると非常に効果的です。

{
  "prompt": "string - A dense, ultra-descriptive narrative. Use specific camera math (85mm lens, f/1.8, ISO 200), explicit flaws (visible pores, mild redness, subtle freckles, light acne marks), lighting behavior (direct on-camera flash creating sharp highlights), and direct negative commands (Do not beautify or alter facial features).",
  "negative_prompt": "string - A comma-separated list of explicit realism blockers (no plastic skin, no CGI).",
  "image_input": [
    "array of strings (URLs) - Optional. Input images to transform or use as reference (up to 14). Formatting: URL to jpeg, png, or webp. Max size: 30MB."
  ],
  "api_parameters": {
    "google_search": "boolean - Optional. Use Google Web Search grounding",
    "resolution": "string - Optional. '1K', '2K', or '4K' (default 1K)",
    "output_format": "string - Optional. 'jpg' or 'png' (default jpg)",
    "aspect_ratio": "string - Optional. Overrides CLI aspect_ratio (e.g., '16:9', '4:5', 'auto')"
  },
  "settings": {
    "resolution": "string",
    "style": "string - e.g., 'documentary realism'",
    "lighting": "string - e.g., 'direct on-camera flash'",
    "camera_angle": "string",
    "depth_of_field": "string - e.g., 'shallow depth of field'",
    "quality": "string - e.g., 'high detail, unretouched skin'"
  }
}

ベストプラクティスと自然言語のテクニック

  1. カメラの数値設定: 焦点距離、絞り、ISO を必ず正確に指定してください(例:85mm lens, f/2.0, ISO 200)。こうすることで、デジタルレンダリングではなく、光学物理を模倣するようモデルに促せます。
  2. 不完全さを明示する: 「リアル」という言葉だけでは不十分です。欠点を具体的に指示してください:mild redness、subtle freckles、light acne marks、unguided grooming。
  3. 直接的な指示: 肯定的なプロンプトの段落内に、命令形の否定指示を含めてください:Do not beautify or alter facial features. No makeup styling.
  4. 照明の作用: 光源の名前だけでなく、その作用も指定してください:direct flash photography, creating sharp highlights on skin and a slightly shadowed background.
  5. 非人間の素材(製品/自然): 人間以外を生成する場合は、肌や服装に関する指定を、素材の物理的特性に関する極めて詳細な指定に置き換えてください。表面の状態(例:「陽極酸化アルミニウムの微細な傷」)、光の散乱(例:「露に覆われた花びらを透過する表面下散乱」)、またはグラフィックのレイアウト(例:「フラットレイ構図、すっきりとしたサンセリフ体のタイポグラフィ」)を定義します。
  6. 必須のネガティブプロンプト: 「肌のスムージング」や「解剖学的特徴の標準化」を禁止するなど、詳細なネガティブプロンプトのブロックを必ず含めてください。
  7. 劣化させすぎない(ノイズの罠): compression artifacts のようなカメラの欠点を再現するとリアリティの向上に役立ちますが、ネオンが輝く夜の街のような複雑でコントラストの高い環境で、ISO 3200 や heavy film grain を極端に強めると、かえってモデルの「デジタルアート/イラスト」のバイアスを引き起こします。ISO 設定は 800 未満に抑え、強いカメラノイズではなく、物理的な被写体の不完全さ(産毛や左右非対称な毛穴など)を活用してリアリティを表現してください。

マスターリファレンスガイド

スキーマの詳細な全容、パラメータの選択肢、またはマルチパネルグリッド用の複雑な JSON 構造が必要な場合は、以下を参照してください: master_prompt_reference.md(このスキルのフォルダー内)

fal.ai 経由での実行(主要な方法 — kie.ai に代わる方法)

超写実的な画像生成には、fal.ai の Nano Banana 2 モデルを使用してください。

前提条件:

  1. .env ファイルに FAL_KEY="your_key" が含まれている必要があります(https://fal.ai/dashboard/keys で取得)
  2. 詳細なナラティブ形式に準拠する JSON プロンプトファイルを /prompts/ に保存しておきます

実行:

# Using the Videos toolkit script (recommended) — defaults to nano-banana-2
python Social-Media-Agent-1.0/Videos/scripts/generate_fal.py "<dense_prompt>" output.jpg --size portrait_4_3

# Or using the legacy kie.ai script (if you still have KIE_API_KEY)
python scripts/generate_kie.py prompts/your_prompt.json images/output_image.jpg "4:5"

Euri API 経由での実行(代替手段 — 学生は無料)

Euri の Gemini 3 Pro Image Preview モデルを使用してください。

python Social-Media-Agent-1.0/Videos/scripts/generate_euri.py "<dense_prompt>" output.jpg

環境変数: .env 内の EURI_API_KEY | 無料:1 日あたり 200K トークン

このスキルの使い方

ユーザーから非常に詳細でリアル、または複雑な画像の生成を依頼された場合は、上記の JSON スキーマとまったく同じ形式でプロンプト文字列を作成する必要があります。その文字列全体を、生成スクリプトの prompt 引数として渡してください(fal.ai を優先し、代替として Euri を使用します)。

コメント