Token导航 LogoToken导航TokenDH.com
图像处理敏感数据github未标认证来源可访问许可证需确认审计通过

gemini-imagegenGemini imagegen 图像

Agent Skill

用于辅助图像生成、图片编辑、视觉素材处理或图像模型工作流。它适合让 Agent 根据文本生成图片、处理背景、整理视觉提示词或调用相关图像工具。使用时需要确认输入图片、版权来源、输出格式和模型限制;涉及人物、品牌、商品或公开展示素材时,应额外核对授权、真实性和内容合规边界。

总安装

692

周安装

28

GitHub Stars

1,103

下载量

217
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:gemini-imagegen(Gemini imagegen 图像)
来源仓库:https://github.com/moosegoose0701/skill-compose
仓库路径:skills/gemini-imagegen
安装命令:
npx skills add https://github.com/moosegoose0701/skill-compose --skill gemini-imagegen
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/moosegoose0701/skill-compose --skill gemini-imagegen

简介

gemini-imagegen 用于辅助图像生成和图片编辑工作流。

  • 适合根据文本生成图片或处理视觉提示词。
  • 使用时需确认输入图片、版权来源和输出格式。
  • 涉及人物、品牌或公开展示素材时应核对授权和合规性。
  • 支持调用相关图像工具完成特定任务。gemini-imagegen 属于图像处理类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Gemini Image Generation

Generate and edit images via Google Gemini's native multimodal image generation.

Model Selection

Model IDCodenameBest forMax resolution
gemini-2.5-flash-imageNano BananaFast drafts, high-volume, low-latency1K
gemini-3-pro-image-previewNano Banana ProStudio-quality, text rendering, complex prompts4K

Default: gemini-3-pro-image-preview (Pro) unless speed/cost is a concern.

Setup

# 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.

Text-to-Image

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

Aspect Ratio

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:

  • Slides / presentations → 16:9
  • Social media / portraits → 9:16 or 4:5
  • Square thumbnails → 1:1

Image Editing (with reference image)

from 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.

Batch Generation (for slides)

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

Error Handling

  • Safety filter block: The model may refuse prompts it deems unsafe. Adjust the prompt to be less ambiguous (remove violent/adult/medical imagery language) and retry.
  • Empty response: If response.candidates is empty or has no image parts, the prompt may be too vague. Add concrete scene details and retry.
  • Rate limit (429): Back off with exponential delay. Default: time.sleep(2 ** attempt).
  • Timeout: Set a reasonable timeout; Pro model may take 10–30s for complex prompts.

Prompt Best Practices

  • Structure: scene → subject → style → composition → constraints
  • Always specify art style: "flat vector illustration", "watercolor painting", "3D render", "photorealistic photograph"
  • Include lighting and mood: "soft diffused lighting", "dramatic rim light", "golden hour"
  • For text in images: quote exact text, specify font style and placement
  • For slide illustrations: add "negative space on [side]" to leave room for text overlay
  • Use English prompts even for non-English content (better generation quality)
  • Keep prompts under 500 words; be specific but not verbose

Style Consistency for Multi-Image Sets

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.

适合场景

01

文本生成图片

02

图片风格化

03

产品图和创意图

04

需要 FLUX 模型时

能力概览

能力 1

调用 FLUX 图像模型

能力 2

支持文本生图和图像改写

能力 3

覆盖 LoRA 或风格适配

能力 4

适合创意视觉生成

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.54%
按下载量换算81

Claude

27.04%
按下载量换算59

Cursor

17.67%
按下载量换算38

Gemini CLI

9.86%
按下载量换算21

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills