sparkcode-image
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "sparkcode-image" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-30b5503db3a18aba416c9680bb91d4e1f5cce4185babeba9c0d2536a5de5346d. Verify the upstream source and version against https://skillhub.cn/skills/user_ce828a92/sparkcode-image before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
SparkCode Image Skill: generates and edits images via SparkCode’s OpenAI-compatible Gemini 3.1 Flash Image API. Applicable to text-to-image generation, image editing, portrait retouching, product scene images, infographics and flowcharts, PPT visual elements or full slide image sets, posters and social media graphics, and requests mentioning Nano Banana 2, Gemini image generation, SparkCode, image aspect ratios, or 1K/2K/4K outputs.
Introduction source: third_party · user_ce828a92 · 1.0.1 Reference
SkillPi interpretation
- Tasks
- Generate and edit images through SparkCode's OpenAI-compatible Gemini 3.1 Flash Image API. Use for text-to-image generation, image modification, portrait retouching, product scenes, infographics and flowcharts, PPT slide visuals or complete slide-image sets, posters, social media graphics, and any request mentioning Nano Banana 2, Gemini image generation, SparkCode, image ratios, or 1K/2K/4K output.
- Inputs and outputs
- Identify: use case and target audience core message exact text, numbers, labels, logos, and data that must be preserved reference/input images aspect ratio and resolution brand or visual style regions or elements that must not change Infer safe defaults when the request is clear. Ask one concise question only when a required input image is missing, mandatory copy/data is ambiguous, or a choice would materially change the result.
- Testing
- Not tested
Browse files
Frontmatter
name: sparkcode-image
description: Generate and edit images through SparkCode's OpenAI-compatible Gemini 3.1 Flash Image API. Use for text-to-image generation, image modification, portrait retouching, product scenes, infographics and flowcharts, PPT slide visuals or complete slide-image sets, posters, social media graphics, and any request mentioning Nano Banana 2, Gemini image generation, SparkCode, image ratios, or 1K/2K/4K output.SparkCode Image
Use scripts/generate_image.py for deterministic API calls. Keep credentials in this skill's
.cache/config.json; never put a key in source code, prompts, logs, or delivered artifacts.
Initialize
Run python scripts/configure.py status before the first API call.
If configuration is missing, read references/onboarding.md, guide the
user through account setup, and ask them to provide the newly created token. Then run
python scripts/configure.py configure in an interactive terminal and enter the token through the
hidden prompt. Do not echo it. Initialization is complete only when status reports configured.
The cache deliberately lives inside this skill for portability. Before sharing the skill, run
python scripts/configure.py clear or delete .cache/.
Workflow
1. Classify the task
Choose exactly one primary type:
- Generate from scratch
- Modify an existing image
- Portrait retouching
- Product scene
- Infographic or flowchart
- Single PPT slide
- Complete presentation image set
- Poster or social-media visual
For a complete presentation, create a slide list and render one coherent 16:9 image per slide.
If the user needs an editable .pptx, use a presentation capability afterward to assemble the
generated slide images; this skill only produces image assets.
2. Extract inputs
Identify:
- use case and target audience
- core message
- exact text, numbers, labels, logos, and data that must be preserved
- reference/input images
- aspect ratio and resolution
- brand or visual style
- regions or elements that must not change
Infer safe defaults when the request is clear. Ask one concise question only when a required input image is missing, mandatory copy/data is ambiguous, or a choice would materially change the result.
3. Plan before generating
Write a compact internal plan covering:
- information compression
- content hierarchy
- composition
- layout system
- primary visual
- intentional whitespace
For text-heavy Chinese visuals, shorten copy without changing meaning and favor fewer, larger text blocks. Use references/prompt-workflow.md for task-specific planning.
4. Select output settings
Resolution is a real, honored parameter — always pass --resolution explicitly rather than relying
on the default, and pass whatever the user asked for. Use 2K by default for final work, 1K for
inexpensive drafts, 512 for throwaway checks, 4K for high-detail or text-heavy final work, and
auto only when the user explicitly wants the model to decide.
Use 16:9 for PPT slides and horizontal infographics, 9:16 for stories, 4:5 for social feeds,
1:1 for square posts/products, and preserve an input image's ratio for edits unless the user asks
to reframe. Supported ratios and the measured output size of each setting are listed in
references/api.md.
If the user asks for a resolution or ratio, never substitute another value and never leave it at a
default. Both settings only take effect when nested under extra_body.google.image_config, which the
script does; a top-level image_config is silently ignored by the gateway.
Use gemini-3.1-flash-image by default. Retry once with
gemini-3.1-flash-image-preview only when the default model has no available channel or the user
explicitly requests Preview. Do not silently downgrade resolution or change ratio.
5. Build the final prompt
Include the task, intended use, audience, exact required content, composition, hierarchy, style, ratio, resolution, and preservation constraints. For edits, explicitly identify what may change and state that everything else must remain unchanged.
Always append these constraints:
- Use correct Simplified Chinese; no misspellings, fake glyphs, or garbled text.
- Preserve all user-provided data exactly.
- Do not invent business conclusions or unsupported claims.
- Keep unspecified areas unchanged during edits.
- Preserve identity and recognizable facial features in portrait work.
- Avoid crowded pages and meaningless English decoration.
- Do not add watermarks, signatures, or brand marks that were not supplied.
6. Generate or edit
Run from the user's desired output directory:
python <skill-dir>\scripts\generate_image.py --prompt-file <prompt.txt> --task-type infographic --aspect-ratio 16:9 --resolution 2K --output <image.png>
For an edit, add one or more --input <path> arguments. Never use an edit workflow without the
actual source image. Do not write temporary prompts or outputs inside the skill directory.
The command prints JSON containing the real format, width, and height of every saved file. The
API often returns JPEG, so the saved extension may differ from the one you passed — report the
path from that JSON, not the path you requested. Add --print-payload when a setting appears to be
ignored; it dumps the outgoing request body (minus image data) to stderr.
7. Verify
Open every output image and check:
- file is a valid, non-empty image
- the reported
width/heightmatch the requested ratio and resolution tier (512≈0.5K,1K≈1024,2K≈2048,4K≈4096 on the long side; a 1408x768 result for a non-16:9 request means the settings were dropped, not honored) - required text and data are present and accurate
- layout is legible at normal viewing size
- preserved content remains intact
- no watermark, garbled text, or unintended additions appear
Regenerate with a corrected prompt when these checks fail. Do not claim exact text correctness without visual inspection.
Commands
python scripts/configure.py status
python scripts/configure.py configure
python scripts/configure.py clear
python scripts/generate_image.py --helpCurrent listing version
1.0.1
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 支持多种高频刚需图像生成与编辑场景,包括文本转图像、人像修图、产品场景、信息图、PPT 幻灯片、海报和社交媒体图形
- 明确覆盖用户常见需求,具有广泛实用价值
Highlights
- 触发词覆盖全面,包括多种任务类型和关键词(如 Nano Banana 2, Gemini image generation, SparkCode, image ratios, 1K/2K/4K output)
- 边界清晰,不易与其他 Skill 重叠
Areas to improve
-
缺少 When to Use 章节,文档过长 Reported severity: Minor
文档结构完整但缺少 When to Use 章节,且内容超过 500 行,影响阅读体验
Recommendation: 建议添加 When to Use 章节并适当精简内容,提升可读性
Highlights
- Workflow 步骤清晰,包含 7 个明确的执行阶段
- 提供了完整的初始化、配置和生成命令示例
Highlights
- 工具来源明确,参数使用规范,覆盖主要异常处理
- 包含完整的输出验证机制和重试策略,确保生成结果符合预期
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Accounts, secrets or authorization
Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.
Mentioned in main document · lines 8
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.