jimeng-api-image-gen

wvlvik/toy-skills · updated Jun 2, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/wvlvik/toy-skills --skill jimeng-api-image-gen
0 commentsdiscussion
summary

Generate high-quality AI images using Volcengine's Jimeng 4.0 API with text prompts or image inputs.

skill.md

Jimeng API Image Generation

Generate high-quality AI images using Volcengine's Jimeng 4.0 API with text prompts or image inputs.

Configure Environment Variables

Get Access Key/Secret Key

# ~/.zshrc or ~/.zshenv
export VOLC_ACCESSKEY="your_access_key_id"
export VOLC_SECRETKEY="your_secret_access_key"

Output Behavior (Important)

After image generation succeeds, you MUST display the image directly to the user!

When generation completes, output in the following format:

![Generated Image](IMAGE_URL)

**Generation Info:**
- Prompt: [User's original prompt]
- Size: [Image dimensions]
- Save Path: [Local file path, if applicable]

Example Output

![Shiba Inu under cherry blossoms](https://example.com/image.png)

**Generation Info:**
- Prompt: Shiba Inu under cherry blossom tree, warm sunlight, healing art style
- Size: 2304 × 1728
- Save Path: /generated_images/[Generated Image] **important**

Notes

  1. Prefer markdown image syntax ![description](URL) to display images directly
  2. Also provide the online link for easy copying and sharing
  3. If saved locally, display the local file path
  4. For multiple images, display each one with numbered labels

Quick Start

Step 1: Run Generation

# Text-to-image
scripts/generate_image.py "A white Siamese cat sitting on a windowsill, sunlight streaming in"

# With specific size
scripts/generate_image.py "Mountain sunset landscape" --size 2K

# Image-to-image editing
scripts/generate_image.py "Change to watercolor style" --images https://example.com/input.jpg

# Save to file
scripts/generate_image.py "Serene lake at sunset" --output /generated_images/lake.png

API Configuration

Parameter Value Description
Endpoint https://visual.volcengineapi.com API base URL
Submit Action CVSync2AsyncSubmitTask Submit async generation task
Query Action CVSync2AsyncGetResult Query task result
Version 2022-08-31 API version
Service cv Service name for signing
Region cn-north-1 Region for signing
req_key jimeng_t2i_v40 Jimeng AI 4.0 model identifier

Image Size Options

Preset Resolutions

Preset Resolution Pixels
1K 1024×1024 1,048,576
2K 2048×2048 4,194,304 (default)
4K 4096×4096 16,777,216

Exact Dimensions

Use --width and --height together:

scripts/generate_image.py "prompt" --width 2560 --height 1440

Recommended aspect ratios:

  • 1:1 (2048x2048) - Social media posts
  • 4:3 (2304x1728) - Presentations
  • 16:9 (2560x1440) - Widescreen displays
  • 9:16 (1440x2560) - Mobile vertical
  • 3:2 (2496x1664) - Photography

Constraints:

  • Width × Height must be in [1024×1024, 4096×4096]
  • Aspect ratio (width/height) in [1/16, 16]
  • Recommended: Use 2K+ for better quality

Command-Line Options

scripts/generate_image.py PROMPT [OPTIONS]

Arguments:
  PROMPT              Text prompt for image generation (required, max 800 chars)

Options:
  --size SIZE         Image size: 1K, 2K, 4K or WxH (default: 2K)
  --width WIDTH       Exact width (requires --height)
  --height HEIGHT     Exact height (requires --width)
  --images URL [...]  Input image URLs for image-to-image (max 10)
  --watermark         Add "AI Generated" watermark
  --scale FLOAT       Text influence 0-1 (default: 0.5)
  --force-single      Force single image output
  --output PATH       Download image to file
  --json              Output raw JSON response

Environment Variables:
  VOLC_ACCESSKEY           Access Key ID (required)
  VOLC_SECRETKEY           Secret Access Key (required)
  JIMENG_API_URL           API endpoint (default: https://visual.volcengineapi.com)
  JIMENG_API_TIMEOUT       Request timeout seconds (default: 120)
  JIMENG_POLL_INTERVAL     Polling interval seconds (default: 2)
  JIMENG_MAX_POLL_ATTEMPTS Max polling attempts (default: 60)

Authentication

This skill uses Volcengine IAM v4 signature authentication (HMAC-SHA256). The signing process:

  1. Build canonical request with headers: content-type;host;x-content-sha256;x-date
  2. Calculate SHA256 hash of canonical request
  3. Derive signing key: secret_key → date → region → service → "request"
  4. Sign the string-to-sign with derived key
  5. Add Authorization header to request

Reference: HTTP请求示例

Error Codes

Code Message Description
10000 Success Request successful
50411 Pre Img Risk Not Pass Input image failed content check
50511 Post Img Risk Not Pass Output image failed content check
50412 Text Risk Not Pass Input text failed content check
50413 Post Text Risk Not Pass Input text contains sensitive words
50429 Request Has Reached API Limit Rate limit exceeded, retry later
50500 Internal Error Server error
timeout Request timeout Increase JIMENG_API_TIMEOUT

Input/Output Limits

Input Images:

  • Format: JPEG, PNG only
  • Max files: 10 images
  • Max size: 15MB per image
  • Max resolution: 4096×4096
  • Aspect ratio (W/H): [1/3, 3]

Output:

  • Max images: 15 - (input image count)
  • Format: PNG
  • URL validity: 24 hours

Reference Documentation

how to use jimeng-api-image-gen

How to use jimeng-api-image-gen on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add jimeng-api-image-gen
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/wvlvik/toy-skills --skill jimeng-api-image-gen

The skills CLI fetches jimeng-api-image-gen from GitHub repository wvlvik/toy-skills and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/jimeng-api-image-gen

Reload or restart Cursor to activate jimeng-api-image-gen. Access the skill through slash commands (e.g., /jimeng-api-image-gen) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

Task Automation & Efficiency

Automate repetitive workflows and reduce manual effort

Example

Generate reports, summarize documents, draft communications

Save 3-5 hours per week on routine tasks

Knowledge Enhancement

Learn new skills, understand complex topics, get expert guidance

Example

Explain concepts, provide examples, suggest learning resources

Accelerate learning and skill development by 2x

Quality Improvement

Enhance output quality through reviews, suggestions, and refinements

Example

Review drafts, suggest improvements, catch errors

Improve work quality by 30-40% with less effort

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client with skill support
  • Clear understanding of task or problem to solve
  • Willingness to iterate and refine outputs

Time Estimate

15-45 minutes depending on use case complexity

Installation Steps

  1. 1.Install skill using provided installation command
  2. 2.Test with simple use case relevant to your work
  3. 3.Evaluate output quality and relevance
  4. 4.Iterate on prompts to improve results
  5. 5.Integrate into regular workflow if valuable

Common Pitfalls

  • Expecting perfect results without iteration
  • Not providing enough context in prompts
  • Using skill for tasks outside its intended scope
  • Accepting outputs without review and validation

Best Practices

✓ Do

  • +Start with clear, specific prompts
  • +Provide relevant context and constraints
  • +Review and refine all outputs before using
  • +Iterate to improve output quality
  • +Document successful prompt patterns

✗ Don't

  • Don't use without understanding skill limitations
  • Don't skip validation of outputs
  • Don't share sensitive information in prompts
  • Don't expect skill to replace human judgment

💡 Pro Tips

  • Be specific about desired format and style
  • Ask for multiple options to choose from
  • Request explanations to understand reasoning
  • Combine AI efficiency with human expertise

When to Use This

✓ Use When

Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.

✗ Avoid When

Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.

Learning Path

  1. 1Familiarize yourself with skill capabilities and limitations
  2. 2Start with low-risk, non-critical tasks
  3. 3Progress to more complex and valuable use cases
  4. 4Build expertise through regular use and experimentation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.636 reviews
  • Mia Singh· Dec 28, 2024

    Solid pick for teams standardizing on skills: jimeng-api-image-gen is focused, and the summary matches what you get after install.

  • Nia Khanna· Dec 16, 2024

    We added jimeng-api-image-gen from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Chaitanya Patil· Dec 4, 2024

    Solid pick for teams standardizing on skills: jimeng-api-image-gen is focused, and the summary matches what you get after install.

  • Lucas Dixit· Dec 4, 2024

    I recommend jimeng-api-image-gen for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Piyush G· Nov 23, 2024

    We added jimeng-api-image-gen from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Isabella Perez· Nov 23, 2024

    Keeps context tight: jimeng-api-image-gen is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Luis Chawla· Nov 19, 2024

    We added jimeng-api-image-gen from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Ava Rahman· Nov 15, 2024

    jimeng-api-image-gen reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Benjamin Shah· Nov 7, 2024

    Solid pick for teams standardizing on skills: jimeng-api-image-gen is focused, and the summary matches what you get after install.

  • Benjamin Gupta· Oct 26, 2024

    jimeng-api-image-gen has been reliable in day-to-day use. Documentation quality is above average for community skills.

showing 1-10 of 36

1 / 4