jimeng_mcp_skill

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

即梦 AI 生成技能

Jimeng AI Generation Skill

概述

Overview

即梦技能通过 jimeng-mcp-server 实现 AI 驱动的图像和视频生成,这是一个集成了即梦 AI 多模态生成能力的 MCP(模型上下文协议)服务器。使用此技能可以直接通过自然语言指令创建视觉内容。
核心能力:
  • 🎨 文本生成图像:从文本描述生成高质量图像
  • 🎭 图像合成:智能合并和融合多张图片
  • 🎬 文本生成视频:从文本提示创建短视频
  • 🎞️ 图像生成视频:为静态图像添加动画效果
何时使用此技能:
  • 用户要求生成、创建或制作图像或视频
  • 用户提到"jimeng"、"即梦"或请求AI视觉内容生成
  • 用户提供文本描述并希望得到视觉输出
  • 用户想要组合、合并或合成多张图片
  • 用户想为静态图像添加动画或运动效果
The Jimeng Skill enables AI-driven image and video generation through jimeng-mcp-server, an MCP (Model Context Protocol) server integrated with Jimeng AI's multimodal generation capabilities. This skill allows you to create visual content directly through natural language instructions.
Core Capabilities:
  • 🎨 Text-to-Image: Generate high-quality images from text descriptions
  • 🎭 Image Synthesis: Intelligently merge and blend multiple images
  • 🎬 Text-to-Video: Create short videos from text prompts
  • 🎞️ Image-to-Video: Add animation effects to static images
When to Use This Skill:
  • Users request to generate, create or produce images or videos
  • Users mention "jimeng", "Jimeng" or request AI visual content generation
  • Users provide text descriptions and expect visual outputs
  • Users want to combine, merge or synthesize multiple images
  • Users want to add animation or motion effects to static images

前置条件

Prerequisites

使用此技能前,请确保 jimeng-mcp-server 已正确配置:
  1. 服务器必须运行,通过以下模式之一:
    • stdio 模式:在 MCP 客户端(Claude Desktop、Cherry Studio)中配置
    • SSE 模式:作为带 SSE 传输的 HTTP 服务器运行
    • HTTP 模式:作为 REST API 服务器运行
  2. 环境变量已配置
    • JIMENG_API_KEY
      :您的即梦 API 密钥(从即梦网站 cookies 获取)
    • JIMENG_API_URL
      :API 端点(默认:http://127.0.0.1:8001)
    • JIMENG_MODEL
      :模型名称(默认:jimeng-4.5)
  3. 后端 API 运行中:jimeng-free-api-all Docker 容器必须处于活动状态
详细的设置说明请参考
references/setup_guide.md
Before using this skill, ensure jimeng-mcp-server is properly configured:
  1. Server Must Be Running, in one of the following modes:
    • stdio Mode: Configured in MCP clients (Claude Desktop, Cherry Studio)
    • SSE Mode: Run as an HTTP server with SSE transmission
    • HTTP Mode: Run as a REST API server
  2. Environment Variables Configured:
    • JIMENG_API_KEY
      : Your Jimeng API key (obtained from Jimeng website cookies)
    • JIMENG_API_URL
      : API endpoint (default: http://127.0.0.1:8001)
    • JIMENG_MODEL
      : Model name (default: jimeng-4.5)
  3. Backend API Running: The jimeng-free-api-all Docker container must be active
For detailed setup instructions, refer to
references/setup_guide.md
.

快速开始

Quick Start

基本使用模式

Basic Usage Workflow

当用户请求图像或视频生成时,遵循以下工作流程:
  1. 识别任务类型,基于用户输入
  2. 提取必需参数,从请求中获取
  3. 调用相应的 jimeng-mcp-server 工具
  4. 返回生成的内容 URL 给用户
When users request image or video generation, follow this workflow:
  1. Identify Task Type based on user input
  2. Extract Required Parameters from the request
  3. Call the Corresponding jimeng-mcp-server Tool
  4. Return Generated Content URLs to the user

示例请求

Example Requests

文本生成图像:
用户:"用即梦生成一张图片:樱花树下的柴犬"
→ 使用 text_to_image 工具,参数 prompt="樱花树下的柴犬"
图像合成:
用户:"帮我合成这两张图片,风格偏向第一张"
→ 使用 image_composition 工具,提供图片 URL
文本生成视频:
用户:"创建一个5秒视频:小马过河的故事场景"
→ 使用 text_to_video 工具,设置提示词和时长
图像生成视频:
用户:"为这张图片添加动画效果"
→ 使用 image_to_video 工具,提供图片 URL
Text-to-Image:
User: "Generate an image with Jimeng: Shiba Inu under cherry blossom trees"
→ Use the text_to_image tool with parameter prompt="Shiba Inu under cherry blossom trees"
Image Synthesis:
User: "Help me synthesize these two images, with the style leaning towards the first one"
→ Use the image_composition tool and provide image URLs
Text-to-Video:
User: "Create a 5-second video: Scene of a pony crossing a river"
→ Use the text_to_video tool, set the prompt and duration
Image-to-Video:
User: "Add animation effects to this image"
→ Use the image_to_video tool and provide the image URL

核心能力

Core Capabilities

1. 文本生成图像

1. Text-to-Image

使用即梦 4.5 引擎从文本描述生成图像。
工具
text_to_image
参数:
  • prompt
    (必需):期望图像的文本描述
  • model
    (可选):模型版本(默认:jimeng-4.5)
  • ratio
    (可选):图像宽高比("1:1", "4:3", "3:4", "16:9", "9:16")
  • resolution
    (可选):分辨率预设("1k", "2k", "4k",默认:2k)
  • negativePrompt
    (可选):要在生成图像中避免的元素
常见宽高比:
  • 16:9 → 横向/宽屏(视频封面、Banner)
  • 1:1 → 正方形(头像、社交媒体)
  • 9:16 → 竖向/手机屏幕(短视频封面)
  • 4:3 → 标准横向(博客配图)
  • 3:4 → 标准竖向(人像照片)
使用示例:
python
undefined
Generate images from text descriptions using the Jimeng 4.5 engine.
Tool:
text_to_image
Parameters:
  • prompt
    (required): Text description of the desired image
  • model
    (optional): Model version (default: jimeng-4.5)
  • ratio
    (optional): Image aspect ratio ("1:1", "4:3", "3:4", "16:9", "9:16")
  • resolution
    (optional): Resolution preset ("1k", "2k", "4k", default: 2k)
  • negativePrompt
    (optional): Elements to avoid in the generated image
Common Aspect Ratios:
  • 16:9 → Landscape/widescreen (video covers, banners)
  • 1:1 → Square (avatars, social media)
  • 9:16 → Portrait/mobile screen (short video covers)
  • 4:3 → Standard landscape (blog illustrations)
  • 3:4 → Standard portrait (portrait photos)
Usage Example:
python
undefined

用户请求:"生成一张图片:夕阳下的海滩,有椰子树"

User request: "Generate an image: Beach at sunset with coconut trees"

{ "model": "jimeng-4.5", "prompt": "夕阳下的海滩,有椰子树", "ratio": "16:9", "resolution": "2k" }

**返回结果:**
返回包含多张图片 URL 的数组,可显示或下载。

**提示:**
- 更高分辨率(4k)适合印刷品和高质量展示
- 较低分辨率(1k)适合快速预览
- 使用描述性提示词以获得更好的结果
- 指定艺术风格、光照、氛围以增强控制
{ "model": "jimeng-4.5", "prompt": "Beach at sunset with coconut trees", "ratio": "16:9", "resolution": "2k" }

**Return Result:**
Returns an array containing multiple image URLs, which can be displayed or downloaded.

**Tips:**
- Higher resolution (4k) is suitable for print and high-quality displays
- Lower resolution (1k) is suitable for quick previews
- Use descriptive prompts for better results
- Specify art style, lighting, and atmosphere to enhance control

2. 图像合成

2. Image Synthesis

通过智能融合合并和混合多张图片。
工具
image_composition
参数:
  • prompt
    (必需):如何合成图片的描述
  • images
    (必需):要合成的 2-5 个图片 URL 数组
  • model
    (可选):模型版本(默认:jimeng-4.5)
  • ratio
    (可选):输出图像宽高比("1:1", "4:3", "3:4", "16:9", "9:16")
  • resolution
    (可选):分辨率预设("1k", "2k", "4k",默认:2k)
使用示例:
python
undefined
Merge and blend multiple images through intelligent fusion.
Tool:
image_composition
Parameters:
  • prompt
    (required): Description of how to synthesize the images
  • images
    (required): Array of 2-5 image URLs to synthesize
  • model
    (optional): Model version (default: jimeng-4.5)
  • ratio
    (optional): Output image aspect ratio ("1:1", "4:3", "3:4", "16:9", "9:16")
  • resolution
    (optional): Resolution preset ("1k", "2k", "4k", default: 2k)
Usage Example:
python
undefined

用户请求:"合成这两张图,保留第一张的风格"

User request: "Synthesize these two images, retaining the style of the first one"

{ "model": "jimeng-4.5", "prompt": "将两张图片无缝融合,保持第一张图片的艺术风格", "images": [ "https://example.com/image1.jpg", "https://example.com/image2.jpg" ], "ratio": "4:3", "resolution": "2k" }

**使用场景:**
- 将人像与背景融合
- 图片之间的风格迁移
- 创建艺术合成作品
- 合并多张照片的元素

**提示:**
- 在提示词中提供清晰的合成说明
- 图片应具有兼容的分辨率
- 描述期望的混合风格(无缝、艺术、真实)
{ "model": "jimeng-4.5", "prompt": "Seamlessly blend the two images while maintaining the artistic style of the first image", "images": [ "https://example.com/image1.jpg", "https://example.com/image2.jpg" ], "ratio": "4:3", "resolution": "2k" }

**Usage Scenarios:**
- Blend portraits with backgrounds
- Style transfer between images
- Create artistic composite works
- Merge elements from multiple photos

**Tips:**
- Provide clear synthesis instructions in the prompt
- Images should have compatible resolutions
- Describe the desired blending style (seamless, artistic, realistic)

3. 文本生成视频

3. Text-to-Video

从文本描述创建短视频。
工具
text_to_video
参数:
  • prompt
    (必需):视频场景的文本描述
  • model
    (可选):模型版本(默认:jimeng-video-3.0)
  • ratio
    (可选):视频宽高比("16:9", "9:16", "4:3", "3:4", "1:1")
  • resolution
    (可选):预设分辨率("480p", "720p", "1080p")
分辨率预设:
  • "480p" → 快速预览
  • "720p" → 平衡质量/速度(推荐)
  • "1080p" → 高质量
使用示例:
python
undefined
Create short videos from text descriptions.
Tool:
text_to_video
Parameters:
  • prompt
    (required): Text description of the video scene
  • model
    (optional): Model version (default: jimeng-video-3.0)
  • ratio
    (optional): Video aspect ratio ("16:9", "9:16", "4:3", "3:4", "1:1")
  • resolution
    (optional): Preset resolution ("480p", "720p", "1080p")
Resolution Presets:
  • "480p" → Quick preview
  • "720p" → Balanced quality/speed (recommended)
  • "1080p" → High quality
Usage Example:
python
undefined

用户请求:"生成5秒视频:小猫在钓鱼"

User request: "Generate a 5-second video: Kitten fishing"

{ "model": "jimeng-video-3.0", "prompt": "一只橘色小猫坐在河边,手持鱼竿专注地钓鱼,阳光明媚", "ratio": "16:9", "resolution": "720p" }

**视频特性:**
- 时长:通常 3-5 秒
- 格式:MP4
- 生成时间:30-60 秒
- 帧率:24-30 fps

**提示:**
- 包含场景细节、动作和氛围
- 保持提示词专注于单一清晰的动作
- 指定一天中的时间、天气或情绪以获得更好的结果
- 从 720p 开始以平衡质量和速度
{ "model": "jimeng-video-3.0", "prompt": "An orange kitten sitting by the river, holding a fishing rod and focusing on fishing, sunny weather", "ratio": "16:9", "resolution": "720p" }

**Video Features:**
- Duration: Typically 3-5 seconds
- Format: MP4
- Generation Time: 30-60 seconds
- Frame Rate: 24-30 fps

**Tips:**
- Include scene details, actions, and atmosphere
- Keep prompts focused on a single clear action
- Specify time of day, weather, or mood for better results
- Start with 720p to balance quality and speed

4. 图像生成视频动画

4. Image-to-Video Animation

为静态图像添加运动和动画效果。
工具
image_to_video
参数:
  • prompt
    (必需):期望动画效果的描述
  • file_paths
    (必需):要添加动画的图片 URL 数组
  • model
    (可选):模型版本(默认:jimeng-video-3.0)
  • ratio
    (可选):视频宽高比("16:9", "9:16", "4:3", "3:4", "1:1")
  • resolution
    (可选):预设分辨率("480p", "720p", "1080p")
使用示例:
python
undefined
Add motion and animation effects to static images.
Tool:
image_to_video
Parameters:
  • prompt
    (required): Description of the desired animation effect
  • file_paths
    (required): Array of image URLs to animate
  • model
    (optional): Model version (default: jimeng-video-3.0)
  • ratio
    (optional): Video aspect ratio ("16:9", "9:16", "4:3", "3:4", "1:1")
  • resolution
    (optional): Preset resolution ("480p", "720p", "1080p")
Usage Example:
python
undefined

用户请求:"让这张照片动起来,添加轻柔的镜头缩放"

User request: "Animate this photo with gentle camera zoom"

{ "model": "jimeng-video-3.0", "prompt": "添加轻柔的运动效果和自然的镜头缩放,营造电影感", "file_paths": ["https://example.com/photo.jpg"], "ratio": "16:9", "resolution": "720p" }

**动画类型:**
- 人物动作(Character motion)
- 镜头运动(Camera movements)
- 场景转换(Scene transitions)
- 环境效果(Environmental effects:风、雨等)

**提示:**
- 描述期望的运动类型
- 选择效果时考虑图像内容
- 人像照片适合细微的动作
- 风景照片适合平移/缩放效果
{ "model": "jimeng-video-3.0", "prompt": "Add gentle motion effects and natural camera zoom to create a cinematic feel", "file_paths": ["https://example.com/photo.jpg"], "ratio": "16:9", "resolution": "720p" }

**Animation Types:**
- Character motion
- Camera movements
- Scene transitions
- Environmental effects (wind, rain, etc.)

**Tips:**
- Describe the desired type of motion
- Consider image content when selecting effects
- Portrait photos suit subtle movements
- Landscape photos suit pan/zoom effects

工作流程指南

Workflow Guide

决策树

Decision Tree

收到用户请求
    ├─ 包含"生成图片"或"create image"?
    │   └─ 是 → 使用 text_to_image
    ├─ 包含"合成"或"merge/blend images"?
    │   └─ 是 → 使用 image_composition
    ├─ 包含"生成视频"或"create video"?
    │   └─ 是 → 使用 text_to_video
    └─ 包含"动画"或"animate image"?
        └─ 是 → 使用 image_to_video
Receive User Request
    ├─ Contains "generate image" or "create image"?
    │   └─ Yes → Use text_to_image
    ├─ Contains "synthesize" or "merge/blend images"?
    │   └─ Yes → Use image_composition
    ├─ Contains "generate video" or "create video"?
    │   └─ Yes → Use text_to_video
    └─ Contains "animate" or "animate image"?
        └─ Yes → Use image_to_video

参数提取

Parameter Extraction

处理用户请求时:
  1. 提取提示词:用户对期望内容的描述
  2. 识别宽高比:提取尺寸偏好(横向/竖向/正方形)对应 ratio 参数
  3. 解析分辨率需求:寻找质量要求,对应 resolution 参数
  4. 收集图片 URL:用于合成和动画任务
When processing user requests:
  1. Extract Prompt: User's description of the desired content
  2. Identify Aspect Ratio: Extract size preferences (landscape/portrait/square) corresponding to the ratio parameter
  3. Parse Resolution Requirements: Look for quality requirements corresponding to the resolution parameter
  4. Collect Image URLs: For synthesis and animation tasks

错误处理

Error Handling

如果工具执行失败:
  1. 检查服务器状态:验证 jimeng-mcp-server 是否运行
  2. 验证 API 密钥:确保 JIMENG_API_KEY 已配置
  3. 检查参数:确认所有必需字段已提供
  4. 检查图片 URL:验证合成/动画的 URL 是否可访问
  5. 清晰报告错误:解释问题并建议解决方案
常见错误:
  • API key not configured
    :在环境中设置 JIMENG_API_KEY
  • Server not responding
    :启动 jimeng-free-api-all Docker 容器
  • Invalid image URL
    :确保 URL 公开可访问
  • Generation timeout
    :大型视频可能需要 60+ 秒
If tool execution fails:
  1. Check Server Status: Verify if jimeng-mcp-server is running
  2. Validate API Key: Ensure JIMENG_API_KEY is configured
  3. Check Parameters: Confirm all required fields are provided
  4. Check Image URLs: Verify URLs for synthesis/animation are accessible
  5. Report Errors Clearly: Explain the problem and suggest solutions
Common Errors:
  • API key not configured
    : Set JIMENG_API_KEY in the environment
  • Server not responding
    : Start the jimeng-free-api-all Docker container
  • Invalid image URL
    : Ensure the URL is publicly accessible
  • Generation timeout
    : Large videos may take 60+ seconds

高级用法

Advanced Usage

组合多个工具

Combine Multiple Tools

对于复杂的创意任务,可以链式使用工具:
示例:创建动画艺术作品
  1. 使用
    text_to_image
    生成基础图像
  2. 使用
    image_to_video
    为结果添加动画
示例:合成和优化
  1. 使用
    image_composition
    合成图片
  2. 使用调整后的提示词生成变体
For complex creative tasks, tools can be used in a chain:
Example: Create Animated Artwork
  1. Use
    text_to_image
    to generate a base image
  2. Use
    image_to_video
    to add animation to the result
Example: Synthesize and Optimize
  1. Use
    image_composition
    to synthesize images
  2. Generate variants with adjusted prompts

优化技巧

Optimization Tips

加快生成速度:
  • 使用较低分辨率(720p 而非 1080p,或 1k 而非 2k)
  • 保持提示词简洁但具有描述性
提高质量:
  • 使用详细、具体的提示词
  • 根据场景选择合适的 ratio(宽高比)
  • 使用更高的 resolution(2k 或 4k)
  • 指定艺术风格和技术
  • 包含光照和氛围描述
Speed Up Generation:
  • Use lower resolution (720p instead of 1080p, or 1k instead of 2k)
  • Keep prompts concise yet descriptive
Improve Quality:
  • Use detailed, specific prompts
  • Select appropriate ratio based on the scene
  • Use higher resolution (2k or 4k)
  • Specify art style and techniques
  • Include lighting and atmosphere descriptions

批量处理

Batch Processing

当用户请求多次生成时:
  1. 按顺序处理请求(一次一个)
  2. 为每个项目提供进度更新
  3. 在最终响应前收集所有结果
  4. 考虑资源限制(API 配额)
When users request multiple generations:
  1. Process requests sequentially (one at a time)
  2. Provide progress updates for each item
  3. Collect all results before final response
  4. Consider resource limits (API quotas)

故障排除

Troubleshooting

服务器连接问题

Server Connection Issues

症状:工具返回连接错误
解决方案:
  1. 检查 jimeng-free-api-all Docker 容器是否运行:
    bash
    docker ps | grep jimeng
  2. 验证服务器是否可访问:
    bash
    curl http://127.0.0.1:8001/health
  3. 如有需要重启 Docker 容器
Symptom: Tool returns connection errors
Solutions:
  1. Check if the jimeng-free-api-all Docker container is running:
    bash
    docker ps | grep jimeng
  2. Verify server accessibility:
    bash
    curl http://127.0.0.1:8001/health
  3. Restart the Docker container if needed

API 密钥问题

API Key Issues

症状:"Invalid API key"或身份验证错误
解决方案:
  1. 验证 .env 文件中的 JIMENG_API_KEY
  2. 从即梦网站 cookies 获取新的 API 密钥(sessionid 值)
  3. 确保密钥格式正确(无额外空格或引号)
Symptom: "Invalid API key" or authentication errors
Solutions:
  1. Verify JIMENG_API_KEY in the .env file
  2. Obtain a new API key from Jimeng website cookies (sessionid value)
  3. Ensure the key format is correct (no extra spaces or quotes)

生成质量问题

Generation Quality Issues

症状:质量差或意外结果
解决方案:
  1. 使用更具体的细节优化提示词
  2. 调整
    ratio
    参数选择合适的宽高比
  3. 尝试不同的
    resolution
    分辨率
  4. 添加
    negativePrompt
    以排除不需要的元素
Symptom: Poor quality or unexpected results
Solutions:
  1. Optimize prompts with more specific details
  2. Adjust the
    ratio
    parameter to select an appropriate aspect ratio
  3. Try different
    resolution
    settings
  4. Add
    negativePrompt
    to exclude unwanted elements

超时错误

Timeout Errors

症状:生成时间过长或超时
解决方案:
  1. 视频生成通常需要 30-60 秒 - 请耐心等待
  2. 如果持续超时,尝试较低分辨率
  3. 检查服务器资源使用情况
  4. 验证到即梦 API 的网络连接
Symptom: Generation takes too long or times out
Solutions:
  1. Video generation typically takes 30-60 seconds - please be patient
  2. If timeouts persist, try lower resolution
  3. Check server resource usage
  4. Verify network connection to Jimeng API

资源

Resources

references/

references/

  • setup_guide.md
    :详细的安装和配置说明
  • api_reference.md
    :所有工具的完整 API 文档
  • setup_guide.md
    : Detailed installation and configuration instructions
  • api_reference.md
    : Complete API documentation for all tools

项目链接

Project Links

最佳实践

Best Practices

  1. 始终在尝试生成前验证服务器状态
  2. 根据用例和速度要求使用适当的分辨率(ratio 控制比例,resolution 控制清晰度)
  3. 提供详细的提示词以获得更好的生成质量
  4. 优雅地处理错误并提供清晰的用户反馈
  5. 处理多个请求时考虑速率限制
  6. 在复杂合成前先用简单提示词测试
  7. 缓存常用参数,如首选 ratio 和 resolution
  1. Always Verify Server Status Before Attempting Generation
  2. Use Appropriate Resolution Based on Use Case and Speed Requirements (ratio controls aspect ratio, resolution controls clarity)
  3. Provide Detailed Prompts for Better Generation Quality
  4. Handle Errors Gracefully and Provide Clear User Feedback
  5. Consider Rate Limits When Processing Multiple Requests
  6. Test with Simple Prompts Before Complex Synthesis
  7. Cache Frequently Used Parameters such as preferred ratio and resolution

限制

Limitations

  • 免费层限制:官方即梦 API 每天 66 积分
  • 视频时长:通常限制为 3-10 秒
  • 生成时间:视频可能需要 30-60 秒生成
  • 图像合成:2-3 张图片效果最佳,最多支持 5 张
  • 服务器依赖:需要 jimeng-free-api-all 后端运行
  • 网络要求:必须有互联网访问以调用即梦 API
  • Free Tier Limits: Official Jimeng API allows 66 credits per day
  • Video Duration: Typically limited to 3-10 seconds
  • Generation Time: Videos may take 30-60 seconds to generate
  • Image Synthesis: Best results with 2-3 images, maximum 5 images supported
  • Server Dependency: Requires jimeng-free-api-all backend to run
  • Network Requirements: Internet access required to call Jimeng API