← Back to Skills Marketplace
umrzcz-831

Kling Image Generate

by umrjs · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ⚠ suspicious
113
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install kling-image-generate
Description
可灵AI图像生成API工具。支持文生图、图生图、多图参考生成、图像Omni、扩图等功能。使用环境变量KLING_ACCESS_KEY和KLING_SECRET_KEY进行鉴权。当用户需要生成AI图像、图片编辑、图像扩展等任务时使用此技能。
README (SKILL.md)

可灵图像生成

🇨🇳 中文 | 🇬🇧 English

可灵AI图像生成服务,提供文生图、图生图、扩图等多种图像生成和编辑能力。

🔒 安全说明: 本技能需要调用可灵AI官方 API (api-beijing.klingai.com),并使用用户提供的 API Key 进行 JWT 鉴权。所有凭证仅存储在本地环境变量中,不会上传或共享。

快速开始

1. 配置环境变量

export KLING_ACCESS_KEY="your_access_key"
export KLING_SECRET_KEY="your_secret_key"

2. 运行脚本

# 文生图(推荐带进度版本)
python3 scripts/generate_image_with_progress.py \
  --prompt "一只可爱的猫咪,皮克斯风格" \
  --model kling-v3 \
  --n 2 \
  --aspect_ratio 1:1 \
  --wait

# 图生图
python3 scripts/generate_image_with_progress.py \
  --prompt "保持原图风格,添加花朵装饰" \
  --image "https://example.com/image.png" \
  --image_reference subject \
  --wait

脚本清单

脚本 用途 推荐度
generate_image_with_progress.py 图像生成(带进度显示) ⭐ 推荐
generate_image.py 图像生成(基础版) 可选
generate_omni_image.py Omni多图生成 按需
expand_image.py 图像扩图 按需
query_task.py 查询任务状态 工具
list_tasks.py 获取任务列表 工具

核心功能使用

文生图

python3 scripts/generate_image_with_progress.py \
  --prompt "描述你想要的图像内容" \
  --model kling-v3 \
  --n 1 \
  --aspect_ratio 1:1 \
  --resolution 2k \
  --wait

常用参数:

  • --model: 模型(kling-v3, kling-v2-1, kling-v1-5 等)
  • --n: 生成数量 1-9
  • --aspect_ratio: 1:1, 16:9, 9:16, 4:3 等
  • --resolution: 1k, 2k
  • --wait: 等待任务完成并显示进度

图生图

python3 scripts/generate_image_with_progress.py \
  --prompt "基于参考图的描述" \
  --image "https://example.com/ref.jpg" \
  --image_reference subject \
  --image_fidelity 0.7 \
  --wait

参考类型:

  • subject: 主体参考(保持人物/物体主体)
  • face: 面部参考(保持面部特征)

Omni多图生成

支持多图参考、风格迁移等高级功能:

python3 scripts/generate_omni_image.py \
  --prompt "将\x3C\x3C\x3Cimage_1>>>的风格应用到\x3C\x3C\x3Cimage_2>>>上" \
  --images "url1,url2" \
  --model kling-v3-omni \
  --resolution 2k \
  --wait

扩图

智能扩展图像边界:

# 手动指定扩展比例
python3 scripts/expand_image.py \
  --image "https://example.com/img.jpg" \
  --up 0.5 --down 0.5 --left 0.5 --right 0.5 \
  --prompt "扩展区域的描述" \
  --wait

# 自动计算比例
python3 scripts/expand_image.py \
  --image "https://example.com/img.jpg" \
  --auto_ratio \
  --width 1024 --height 1024 \
  --aspect_ratio 16:9 \
  --wait

任务管理

查询任务状态

python3 scripts/query_task.py --task_id "xxx"

获取任务列表

python3 scripts/list_tasks.py --api_type generation --page 1

详细参考

Usage Guidance
Before installing: (1) Note that the package requires KLING_ACCESS_KEY and KLING_SECRET_KEY (the registry metadata incorrectly omitted them) — only provide keys you trust and consider using a dedicated/limited account. (2) Confirm you trust the API host api-beijing.klingai.com and are comfortable the service will receive JWT-authenticated requests. (3) Avoid supplying an untrusted callback_url (it can cause results to be posted to an external endpoint). (4) Install dependencies in an isolated environment (virtualenv) and review the scripts yourself; if you later suspect key leakage, rotate the keys. If you want higher assurance, ask the publisher for a homepage or source repo and a corrected metadata entry that lists the required env vars.
Capability Analysis
Type: OpenClaw Skill Name: kling-image-generate Version: 1.0.1 The skill bundle is a legitimate integration for the Kling AI image generation service. It provides scripts (e.g., generate_image_with_progress.py, expand_image.py) to interact with the official Kling AI API (api-beijing.klingai.com). Authentication is handled securely by generating JWT tokens locally using environment variables (KLING_ACCESS_KEY, KLING_SECRET_KEY), and there is no evidence of credential exfiltration, unauthorized network calls, or malicious prompt injection.
Capability Assessment
Purpose & Capability
The scripts and SKILL.md implement a client for the Kling AI image API (text->image, image->image, omni, expansion). The requested credentials (KLING_ACCESS_KEY, KLING_SECRET_KEY) and dependencies (requests, JWT libraries) are coherent with that purpose. However, registry metadata lists no required env vars/primary credential while the SKILL.md and all scripts clearly require the two KLING_* environment variables — this metadata mismatch is an inconsistency to be aware of.
Instruction Scope
SKILL.md instructs users to set the two KLING_* env vars and run included Python scripts; the scripts only call the documented api-beijing.klingai.com endpoints and do not attempt to read unrelated system files or other credentials. One operational note: the scripts accept an optional callback_url parameter (which will be invoked by the remote service) — if you supply a third-party callback URL you could direct generated results to an external endpoint, so treat callback_url as a potential exfil vector if misused.
Install Mechanism
No install specification is included (instruction- + script bundle). The included requirements.txt (requests, PyJWT, cryptography) matches the code's usage. There are no external downloads or obscure install URLs in the package.
Credentials
The skill requires KLING_ACCESS_KEY and KLING_SECRET_KEY for JWT authentication — this is appropriate and necessary for the stated API calls. The concern is that the package/registry metadata omitted these required env variables (declared as 'none'), which is an internal inconsistency and could mislead less-technical users into installing without supplying keys. No other unrelated secrets are requested.
Persistence & Privilege
The skill does not request persistent 'always' inclusion and does not modify other skills or system-wide configuration. It runs as user-invoked scripts and has normal, limited privileges.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install kling-image-generate
  3. After installation, invoke the skill by name or use /kling-image-generate
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
- Added a security notice specifying API usage and JWT authentication requirements. - Clarified that API credentials are stored only in local environment variables and not shared. - No changes to core functionality or usage instructions.
v1.0.0
kling-image-generate 1.0.0 - 首次发布:集成可灵AI图像生成API工具,支持文生图、图生图、多图参考生成、图像Omni、扩图等核心功能。 - 提供多种脚本,支持基础与进阶的图像生成、扩图及任务管理功能演示和调用。 - 中文详细文档,包含环境变量配置、常用参数说明和功能脚本举例。 - 支持多模型选择、分辨率与比例可调,适用于多场景AI图像生成需求。
Metadata
Slug kling-image-generate
Version 1.0.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is Kling Image Generate?

可灵AI图像生成API工具。支持文生图、图生图、多图参考生成、图像Omni、扩图等功能。使用环境变量KLING_ACCESS_KEY和KLING_SECRET_KEY进行鉴权。当用户需要生成AI图像、图片编辑、图像扩展等任务时使用此技能。 It is an AI Agent Skill for Claude Code / OpenClaw, with 113 downloads so far.

How do I install Kling Image Generate?

Run "/install kling-image-generate" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Kling Image Generate free?

Yes, Kling Image Generate is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Kling Image Generate support?

Kling Image Generate is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Kling Image Generate?

It is built and maintained by umrjs (@umrzcz-831); the current version is v1.0.1.

💬 Comments