Community图像github.com

image-prompt-studio

结构化 JSON 提示词生成与修改(AI 绘画工作流)。当用户需要用一句话描述生成完整结构化 JSON 绘图提示词、对已有 JSON 提示词做精准最小化修改、从参考图反推提示词、按二次元立绘等风格创作画面,或把提示词通过 apiz 接入 Nano Banana / GPT-Image 生图时使用。内含字段规范、生成/修改系统提示词、下拉词库、9 套预设范例与 apiz 生图参数手册。

image-prompt-studio 是什么?

image-prompt-studio is a Gemini CLI agent skill that 结构化 JSON 提示词生成与修改(AI 绘画工作流)。当用户需要用一句话描述生成完整结构化 JSON 绘图提示词、对已有 JSON 提示词做精准最小化修改、从参考图反推提示词、按二次元立绘等风格创作画面,或把提示词通过 apiz 接入 Nano Banana / GPT-Image 生图时使用。内含字段规范、生成/修改系统提示词、下拉词库、9 套预设范例与 apiz 生图参数手册。.

兼容平台~Claude Code~Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/liangdabiao/dsh-image-prompt-studio/tree/main/skills/image-prompt-studio

Installed? Explore more 图像 skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Image Prompt Studio Skill

Overview

This skill distills the prompt engineering knowledge from the "Nano Banana Prompt Studio" project into a reusable skill: use structured JSON (instead of lengthy natural language) to control AI image generation, enabling precise customization, modular reuse, and consistency across a series of works. This skill covers four main paths: generating new prompts, making minimal modifications, reverse-engineering prompts from reference images, and image generation. The generated JSON prompts are compatible with both the Nano Banana and GPT-Image model families.

Workflow Decision Tree

Choose an entry point based on user intent:

User IntentEntry Point
Describe a desired scene / request a new promptPath A: Generation
Have an existing JSON and say "change XX" or "replace XX"Path B: Minimal Modification
Provided a reference image, want to imitate or reverse-engineer the promptPath A + Reference Image Analysis
Prompt is ready, need to generate the imagePath C: Image Generation Execution

Core Output Rules (Common to All Paths)

  1. Output only the JSON body: strictly no markdown code block wrapping (no ```json), no explanatory text.
  2. Complete structure: all fields must be filled, none omitted or left blank.
  3. Wording requirements: vivid, professional, graceful, and specific; avoid vague expressions.
  4. For non-human subjects (landscapes, objects, battle scenes, etc.): adjust the description under the subject's appearance features fields according to the actual object, do not force human character fields.
  5. After generation or modification, run structural validation (in the plugin: use the ips_validate tool, not python; in a standalone environment, use <SKILL_ROOT>/scripts/validate_prompt.py).

Path A: Generate a New Prompt

  1. Read the full SYSTEM_PROMPT from <SKILL_ROOT>/references/system-prompts.md and strictly follow it as the system instruction for this generation.
  2. If the user provides a reference image: The runtime agent directly reads and analyzes the image—use its own multimodal vision capability to open the image file, extract features according to the four dimensions required by the SYSTEM_PROMPT (character features, scene environment, image style, composition & camera angle), then generate the prompt in combination with the user's text description. Do not call an external vision model API; the analysis is done by the agent itself. Note the file path of the reference image: it must be passed back as a style reference during Path C image generation execution (see Path C, step 2).
  3. If the user has no reference image, generate directly based on their natural language description.
  4. For field filling specifications and writing tips for each field, see <SKILL_ROOT>/references/prompt-schema.md; you can choose or combine high-quality phrasing from the options library at <SKILL_ROOT>/references/options-library.md (the library is a source of material, not a constraint; freely adapt it to the needs of the scene).
  5. Before output, use validation to confirm the structure is correct, then deliver the JSON to the user (save as a .json file or display directly).
  6. When a style baseline is needed, use ips_presets (action=get) to retrieve the closest preset and rewrite the relevant fields.
  7. For analysis initiated by step 1 of the "Image Generation Workbench", the final step must call ips_style (action=set) to write the style JSON along with the reference image path back to the panel—the user is waiting in step 2 to select this style for image generation.

Path B: Minimally Modify an Existing Prompt

  1. Read the full MODIFY_SYSTEM_PROMPT from <SKILL_ROOT>/references/system-prompts.md and strictly follow the "minimal modification" principle:
  • Precision: only modify fields the user explicitly requests or that must logically change in tandem (summer → winter: short sleeves → down jacket is mandatory; hair color/composition must not be touched).
  • Complete freezing: untouched fields must be verbatim identical to the original JSON; no synonym swapping, rewording, or formatting optimization.
  • No divergence: do not "fix" any parameter the user didn't mention.
  1. Output the complete JSON after modification (not a diff, not a fragment).
  2. Run structural validation again.
  3. Freeze level self-check (required): call ips_diff (before=original JSON, after=modified JSON). The tool flattens leaf fields for programmatic comparison, returning a list of changes, a list of frozen fields, and the freeze rate. You judge whether the changes fall under the nodes covered by the user's intent—if changes fall outside the intent, the modification was too broad; redo it. For real-world test results, see the "Test Conclusions" in the plugin's root directory README.md (11 changes out of 26 leaf fields, 15 verbatim frozen); example JSON is not distributed with the package. When a style baseline is needed, use ips_presets (action=get) to retrieve a built-in preset.

Path C: Execute Image Generation

Image generation is performed once the prompt JSON is ready. The same JSON is simultaneously compatible with both the Nano Banana and GPT-Image model families; choose the path based on user preference or visual needs.

  1. Assemble the prompt: use the JSON text (JSON.stringify(data, null, 2) with Chinese characters as-is) as the prompt text; if the user has additional requests, append them as "\n\nSpecial request: <request>" after the JSON.
  2. With reference image (hard rule): as long as this prompt was derived from analyzing/modifying a reference image, that original image must be passed as a style reference during image generation—discarding the original image after analysis is a tested bug that significantly degrades style fidelity. For the plugin tool ips_generate, pass the local file path or HTTP URL in the referenceImages parameter (GPT-Image automatically uses reference_image_urls, Nano Banana automatically uses image_urls; no need to remember parameter names). This step can be omitted only for text-to-image generation without a reference image.
  3. Select the model:
  • GPT-Image route (default): apiz/gpt-image-2.5-flare, quality default low (10 credits/image, approx. 0.01 USD).
  • Nano Banana route: service-inference/gemini-nano-banana-2.1, uses the same endpoint for text-to-image and reference image editing, supports up to 14 reference images.
  • For parameter details and a full model table, see <SKILL_ROOT>/references/image-generation.md.
  1. Execution: first try the plugin tool ips_generate (same engine, used by the "Prompt Workbench" panel); if the plugin does not have an apizApiKey configured and the CLI is not logged in, it will report an error. In that case, fall back to the apiz CLI:
apiz generate "$(cat prompt.json)" --model apiz/gpt-image-2.5-flare \
  --aspect-ratio 1:1 \
  --params '{"quality":"low","reference_image_urls":["<public_url>"]}' \
  --wait --json

Set --aspect-ratio according to the original image or user request (vertical 3:4 / horizontal 16:9 / square 1:1, etc.); generation takes 2–9 minutes. The CLI --wait flag blocks until completion; for high timeout risk scenarios, use background execution instead. Do not rerun a polling timeout (duplicate charges); instead resume with apiz tasks wait <task_id> --json. 5. After image generation is complete, present the resulting image path along with the used prompt to the user; the plugin will automatically write the record to the generation history (visible in the panel). 6. If the account balance is unclear before generation, first check with apiz account balance; insufficient credits will result in an HTTP 429 from all models.

Presets & Examples

  • Use ips_presets (action=list) to view the 9 built-in presets (Chibi, Three Kingdoms, Song Dynasty, line art manga, satirical manga, Mid-Autumn Starry Series, etc.), covering typical scenarios such as character illustrations, scenes, and stylized works.
  • When generating a prompt, you can read the preset closest to the user's needs as a style baseline, then replace the relevant fields based on the user's description.
  • When a user says "save this as a preset", use ips_presets (action=save) to write the current JSON to the user's preset library with a given name.

Resources

references/

  • prompt-schema.md — JSON field specifications: meaning of each field, writing tips, adjustment rules for non-human subjects, optional negative fields, and compatibility notes with the two model families. Must be read before generation.
  • system-prompts.md — Full text of SYSTEM_PROMPT (generation) and MODIFY_SYSTEM_PROMPT (modification), along with runtime agent execution instructions. Follow verbatim when executing Path A/B.
  • options-library.md — Full dropdown options library (style modes, scene atmosphere, camera position, composition, lens, lighting, weather, clothing, colors, etc.), including character line art specific prompts. A vocabulary material library for selection.
  • image-generation.md — Image generation operation manual: command templates, dual-model parameter tables for Nano Banana and GPT-Image, reference image passing methods, quality tiers and pricing, credit gate, and known pitfalls.

assets/

  • presets/*.json — 9 preset examples, can be directly loaded, modified, or used as style baselines.

scripts/ (for standalone environments; in the plugin, use ips_validate / ips_diff tools)

  • validate_prompt.py — Structural validator. Usage: python validate_prompt.py <prompt.json>; add --partial for partial structure presets. Lists missing fields line by line, exit code non-zero on failure.

Source

This skill is distilled from the local project D:/nano-b/nano-banana-prompt-studio (a PyQt6 desktop app + Flask Web port of Nano Banana Prompt Studio). When GUI client, web service, or PyInstaller packaging capabilities are needed, use the project source code directly; this skill only carries its prompt engineering knowledge and does not depend on the project to run. The image generation channel is unified through apiz (replaced the project's original Gemini SDK / 302 proxy direct connection since 2026-10-14).

相关技能