SuperAPI AI Directory

image-prompt-studio

Design & creation

View repository

Updated 10-16 13:34

About this skill

Image Prompt Studio Skill

Overview

Solidify the prompt engineering knowledge of the "Nano Banana Prompt Studio" project into a reusable skill: use structured JSON (rather than long-form natural language) to control AI image generation, achieving precise customization, modular reuse, and consistency across a series of works. This skill covers four main paths: generating new prompts, minimal modification, reverse-engineering from reference images, and generating images via apiz-cli.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 intent Entry point
Describe a desired scene / want a new prompt Path A: Generation
With an existing JSON, say "change XX / replace with XX" Path B: Minimal modification
Given a reference image, want to imitate/reverse-engineer a prompt Path A + reference image analysis
Prompt is ready, want to actually generate an image Path C: apiz-cli image generation

Core output rules (common to all paths)

  1. Output only the JSON itself: markdown code block wrapping is strictly forbidden (no ```json), and any explanatory text is strictly forbidden.
  2. Complete structure: all fields must be filled in, none may be omitted or left empty.
  3. Wording requirements: vivid, professional, elegant, and specific; avoid vague expressions.
  4. For non-human subjects (landscapes, objects, battlefields, etc.), adjust the description of the appearance-feature fields under the subject according to the actual object, and do not force human fields onto them.
  5. After generation or modification is complete, run scripts/validate_prompt.py to validate structural completeness (see Resources).

Path A: Generate a new prompt

  1. Read references/system-prompts.md in SYSTEM_PROMPT in full, and strictly execute it as the system instruction for this generation.
  2. If the user provides a reference image:The runtime agent reads and analyzes the image directly—use its own multimodal visual capability to open the image file, extract features according to the four dimensions required by SYSTEM_PROMPT (character features, scene environment, visual style, composition and camera angle), then combine them with the user's text description to generate the prompt.Do not call an external visual model API; the analysis is performed by the agent itself.
  3. When the user has no reference image, generate directly from their natural language description.
  4. For field-filling specifications and key techniques for writing each field, see references/prompt-schema.md; you may select or combine high-quality wording from the lexicon in references/options-library.md (the lexicon is material, not a constraint; freely improvise as the scene requires).
  5. Before outputting, use the validation script to confirm the structure is correct, then deliver the JSON to the user (save it as a .json file or display it directly).

Path B: Minimally modify an existing prompt

  1. Read references/system-prompts.md in MODIFY_SYSTEM_PROMPT in full, and strictly follow the "minimal modification" principle:
    • Precision targeting: only change fields the user explicitly requests or fields that logically must change in tandem (when summer→winter, short sleeves→padded coat is mandatory; hair color/composition must never be touched).
    • Complete freeze: untouched fields must be word-for-word identical to the original JSON; synonym substitution, polishing, and format optimization are prohibited.
    • No divergence: do not "fix" any parameter the user did not mention.
  2. Output the modifiedcomplete JSON(not a diff, not a fragment).
  3. Run through the validation script the same way.
  4. Freeze-degree self-check (recommended): flatten the JSON before and after modification into sets of leaf field paths and compare programmatically, confirming that changes fall only on nodes covered by user intent and that all other field values are word-for-word equal. For a tested reference, see README.md "Example 2".

Path C: apiz-cli image generation

Once the prompt JSON is ready, generate images via apiz-cli.The same JSON is simultaneously compatible with both the Nano Banana and GPT-Image model families, so choose the route based on user preference or image requirements.

  1. Assemble the prompt: use the JSON text (json.dumps(data, ensure_ascii=False, indent=2)) as the prompt text; if the user has additional requirements, append them after the JSON in the form "\n\n特别要求:<要求>" .
  2. Choose the model (parameter details and the complete model table are in references/image-generation.md):
    • GPT-Image route (default):apiz/gpt-image-2.5-flare, quality defaults to low(10 credits/image, about 0.1 yuan).
    • Nano Banana route:service-inference/gemini-nano-banana-2.1, text-to-image and reference-image editing share the same endpoint, supporting up to 14 reference images.
  3. Execute (standard command):
    apiz generate "$(cat prompt.json)" --model apiz/gpt-image-2.5-flare \
      --aspect-ratio 3:4 --params '{"quality":"low"}' --wait --json
    
    --aspect-ratio Refer to the original image or user requirements (portrait 3:4 / landscape 16:9 / square 1:1, etc.); generation takes several minutes,--wait will block until completion, so switch to background running in situations with high timeout risk.
  4. From the returned JSON's result.images[0].url download the image (curl -sL -o out.jpg <url>), verify the dimensions and format, then show the user the finished image and the prompt used.
  5. If the balance is unknown before image generation, first apiz account balance confirm; when credits are insufficient, all models return HTTP 429.

Presets and examples

  • assets/presets/ contains 9 sets of high-quality presets accumulated for this project (chibi, Three Kingdoms, Song dynasty, line-art comics, satirical comics, Mid-Autumn starfield series, etc.), covering typical scenarios such as character illustrations, scenes, and stylization.
  • When generating prompts, you may read the set closest to the user's needs as a style baseline, then replace the corresponding fields according to the user's description.
  • When the user says "save as preset", write the current JSON into the preset directory and name it.

Resources

scripts/

  • validate_prompt.py — structure validator. Validates whether the JSON prompt contains all required fields and whether types are correct (e.g., "Material Realism" must be an array). Usage:python validate_prompt.py <prompt.json>; some structure presets add --partial; when fields are missing, list them one by one, with a non-zero exit code.

references/

  • prompt-schema.md — JSON field specification: the meaning of each field, filling guidelines, adjustment rules for non-character subjects, optional negative fields, and compatibility notes with the two model families. Required reading before generation.
  • system-prompts.md — SYSTEM_PROMPT(generation) and MODIFY_SYSTEM_PROMPT(modification) in full, with runtime agent execution instructions attached. Follow them as-is when executing paths A/B.
  • options-library.md — full dropdown option vocabulary (style mode, image temperament, camera angle, composition, lens, lighting, weather, clothing, color, etc.), including prompts dedicated to character line art. Vocabulary source library.
  • image-generation.md — apiz-cli image generation operation manual: command templates, parameter tables for both Nano Banana and GPT-Image models, reference image upload methods, quality tiers and pricing, balance gate, known pitfalls.

assets/

  • presets/*.json — 9 sets of preset examples that can be loaded directly, modified, or used as a style baseline.

Source

This skill is distilled from the local project D:/nano-b/nano-banana-prompt-studio(Nano Banana Prompt Studio with a PyQt6 desktop client + Flask Web frontend). When GUI clients, Web services, or PyInstaller packaging capabilities are needed, use that project's source code directly; this skill only carries its prompt engineering knowledge and does not depend on that project to run. Image generation channels uniformly go through apiz-cli (replacing the original project's Gemini SDK / 302 relay direct connection starting 2026-10-14).