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 Intent | Entry Point |
|---|---|
| Describe a desired scene / request a new prompt | Path 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 prompt | Path A + Reference Image Analysis |
| Prompt is ready, need to generate the image | Path C: Image Generation Execution |
Core Output Rules (Common to All Paths)
- Output only the JSON body: strictly no markdown code block wrapping (no ```json), no explanatory text.
- Complete structure: all fields must be filled, none omitted or left blank.
- Wording requirements: vivid, professional, graceful, and specific; avoid vague expressions.
- 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.
- After generation or modification, run structural validation (in the plugin: use the
ips_validatetool, not python; in a standalone environment, use<SKILL_ROOT>/scripts/validate_prompt.py).
Path A: Generate a New Prompt
- Read the full
SYSTEM_PROMPTfrom<SKILL_ROOT>/references/system-prompts.mdand strictly follow it as the system instruction for this generation. - 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).
- If the user has no reference image, generate directly based on their natural language description.
- 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). - Before output, use validation to confirm the structure is correct, then deliver the JSON to the user (save as a
.jsonfile or display directly). - When a style baseline is needed, use
ips_presets(action=get) to retrieve the closest preset and rewrite the relevant fields. - 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
- Read the full
MODIFY_SYSTEM_PROMPTfrom<SKILL_ROOT>/references/system-prompts.mdand 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.
- Output the complete JSON after modification (not a diff, not a fragment).
- Run structural validation again.
- 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 directoryREADME.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, useips_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.
- 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. - 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 thereferenceImagesparameter (GPT-Image automatically usesreference_image_urls, Nano Banana automatically usesimage_urls; no need to remember parameter names). This step can be omitted only for text-to-image generation without a reference image. - Select the model:
- GPT-Image route (default):
apiz/gpt-image-2.5-flare, quality defaultlow(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.
- Execution: first try the plugin tool
ips_generate(same engine, used by the "Prompt Workbench" panel); if the plugin does not have anapizApiKeyconfigured and the CLI is not logged in, it will report an error. In that case, fall back to theapizCLI:
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 ofSYSTEM_PROMPT(generation) andMODIFY_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--partialfor 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).