文章に含まれる語彙や文の構成、書式、引用の特徴を複数の観点から調べ、AI生成の可能性と根拠を整理します。誤判定を避けるための注意点も示します。
- 文章のAI生成らしさを複数の観点で調べたいとき
- 判定の根拠と反証材料を整理したいとき
- AI文章検出の特徴や限界を知りたいとき
Google Geminiの画像生成モデルを使い、文章からの画像作成、参照画像を使った編集、複数画像の合成や人物の見た目をそろえた生成を行います。
Generate and edit images using Google Gemini's native image generation models (Nano Banana / Nano Banana Pro). Supports text-to-image, image editing with reference images, multi-image composition, and character consistency. Use when the user asks to generate images via Gemini, create AI illustrations, edit photos with Gemini, or needs high-quality image generation with the Google API. Requires GEMINI_API_KEY. Triggers: "generate image with gemini", "nano banana", "gemini image", "create illustration", "AI generate picture", "text to image".
実行スコア 未検証
インストール方法を見るGoogle Geminiの画像生成モデルを使い、文章から画像を作成したり、参照画像をもとに写真やイラストを編集したりする手順を案内します。複数の画像を組み合わせる構成や、人物の見た目を複数画像でそろえる方法も扱います。用途に応じたモデル選び、アスペクト比の指定、画像内に入れる文字や構図を含むプロンプトの組み立て方を参照できます。スライド用など複数枚を作る場合の連続生成や、スタイルをそろえるための指定例もあります。
文章からイラストを作りたいとき、手元の画像の背景や雰囲気を変えたいとき、複数の参照画像を使って一枚にまとめたいときに向いています。スライドやSNS向けに比率を指定した画像を用意したり、シリーズ画像の見た目を統一したりする場面にも使えます。
利用にはGEMINI_API_KEYの設定が必要です。原文ではgoogle-genaiのインストールとGoogle Gemini APIの利用が示されています。
この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Generate and edit images via Google Gemini's native multimodal image generation.
| Model ID | Codename | Best for | Max resolution |
|---|---|---|---|
gemini-2.5-flash-image | Nano Banana | Fast drafts, high-volume, low-latency | 1K |
gemini-3-pro-image-preview | Nano Banana Pro | Studio-quality, text rendering, complex prompts | 4K |
Default: gemini-3-pro-image-preview (Pro) unless speed/cost is a concern.
# Install (once)
# pip install google-genai
from google import genai
import os, base64
client = genai.Client(api_key=os.environ["GEMINI_API_KEY"])
If GEMINI_API_KEY is missing, instruct the user to set it as an environment variable.
Never ask the user to paste the key in chat.
from google import genai
from google.genai import types
import os
client = genai.Client(api_key=os.environ["GEMINI_API_KEY"])
response = client.models.generate_content(
model="gemini-3-pro-image-preview",
contents="A photorealistic cat on a rainbow sofa",
config=types.GenerateContentConfig(
response_modalities=["TEXT", "IMAGE"],
),
)
# Extract and save
for part in response.candidates[0].content.parts:
if part.inline_data is not None:
with open("output.png", "wb") as f:
f.write(part.inline_data.data)
break
Set via image_config:
config=types.GenerateContentConfig(
response_modalities=["TEXT", "IMAGE"],
image_config=types.ImageConfig(
aspect_ratio="16:9", # for slides / widescreen
),
)
Supported ratios: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
Common choices:
16:99:16 or 4:51:1from google.genai import types
from pathlib import Path
import base64
ref_bytes = Path("input.jpg").read_bytes()
response = client.models.generate_content(
model="gemini-3-pro-image-preview",
contents=[
types.Part(inline_data=types.Blob(mime_type="image/jpeg", data=base64.b64encode(ref_bytes).decode())),
types.Part(text="Remove the background and replace with a sunset gradient"),
],
config=types.GenerateContentConfig(
response_modalities=["TEXT", "IMAGE"],
),
)
Pro supports up to 14 reference images for multi-image composition and up to 5 human reference images for character/identity consistency.
When generating multiple images (e.g. one per slide), loop sequentially and save with numbered filenames:
import os, time
from google import genai
from google.genai import types
client = genai.Client(api_key=os.environ["GEMINI_API_KEY"])
prompts = [...] # list of prompt strings
for i, prompt in enumerate(prompts, 1):
response = client.models.generate_content(
model="gemini-3-pro-image-preview",
contents=prompt,
config=types.GenerateContentConfig(
response_modalities=["TEXT", "IMAGE"],
image_config=types.ImageConfig(aspect_ratio="16:9"),
),
)
for part in response.candidates[0].content.parts:
if part.inline_data is not None:
with open(f"slide_{i}.png", "wb") as f:
f.write(part.inline_data.data)
break
time.sleep(1) # rate limit courtesy
response.candidates is empty or has no image parts, the prompt
may be too vague. Add concrete scene details and retry.time.sleep(2 ** attempt).When generating a series (e.g. slide deck), prepend a style prefix to every prompt:
Style prefix: "flat vector illustration, soft pastel color palette, clean lines, minimal detail, 16:9 widescreen"
Slide 1 prompt: "{style_prefix}, a wide establishing shot of a modern office building at sunrise"
Slide 2 prompt: "{style_prefix}, a close-up of hands typing on a laptop keyboard"
This ensures visual coherence across all generated images.
まだレビューはありません。使ってみた感想をお寄せください。
ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。
まだコメントはありません。最初のコメントを書いてみませんか。
文章に含まれる語彙や文の構成、書式、引用の特徴を複数の観点から調べ、AI生成の可能性と根拠を整理します。誤判定を避けるための注意点も示します。
動画や対応サイトの音声を抽出し、MP3やFLACなどに変換して保存します。ポッドキャストやプレイリストの一括取得、曲情報やカバー画像の埋め込みにも使えます。
DNA・RNA・タンパク質の配列や生物学ファイルをPythonで扱い、配列解析、BLAST、NCBI検索、系統樹作成などの処理を組み立てます。
プロジェクトの説明をもとに、ロゴや配色、書体、名刺、SNSカバー、ブランド仕様書を一貫したビジュアルアイデンティティとしてまとめます。
ポスターや静的なアートを、色・形・余白の方針づくりから制作するスキル。デザイン思想をまとめたMarkdownと、文字を抑えたPNG・PDFの作品を作ります。
ソースコードを読み解き、構成やデータの関係、処理の流れをMermaid.jsの図にしてSVG・PNGで出力するスキルです。