Kling AI Image Generation for Openclaw

A comprehensive suite of CLI tools for high-fidelity AI image generation, referencing, and canvas expansion using the Kling AI API.

umrzcz-831
v1.0.1
Mar 20, 2026
0
712
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install kling-image-generate

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install kling-image-generate using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Kling AI Image Generation?

The Kling AI Image Generation skill is a powerful integration designed for developers and creators who need programmatically controlled, high-quality visual assets. It leverages the Kling AI official API to provide a robust set of features including text-to-image (T2I), image-to-image (I2I), and advanced Omni-model capabilities for multi-image style transfers.

This Openclaw Skills contribution focuses on reliability and transparency, offering progress-tracking scripts and comprehensive task management. By utilizing local environment variables for JWT authentication, it ensures that your API credentials remain secure while providing professional-grade features like 2K resolution support and intelligent image outpainting.

Kling AI Image Generation Use Cases

  • Automated generation of marketing assets and character designs using text prompts.
  • Maintaining character consistency across multiple images using subject or face referencing.
  • Extending existing artwork boundaries with intelligent outpainting (expansion).
  • Batch processing image generation tasks with real-time progress monitoring.
  • Complex style transfers and multi-image compositions using the Omni-model.

How Kling AI Image Generation Works

  1. The user provides an English or Chinese text prompt and optional reference images via the CLI scripts.
  2. The skill signs a JWT token using the KLING_ACCESS_KEY and KLING_SECRET_KEY stored in the local environment.
  3. A request is dispatched to the Kling AI API (api-beijing.klingai.com) to initiate a generation task.
  4. The script retrieves a task ID and, if the wait flag is used, polls the status endpoint to monitor progress.
  5. Once completed, the script returns the high-resolution image URLs and logs the task metadata.

Kling AI Image Generation Setup

First, ensure you have your API credentials from Kling AI. Set up your local environment as follows:

# Configure your API credentials
export KLING_ACCESS_KEY="your_access_key"
export KLING_SECRET_KEY="your_secret_key"

# Run a test generation with the progress script
python3 scripts/generate_image_with_progress.py \
  --prompt "A cute cat in Pixar style" \
  --model kling-v3 \
  --aspect_ratio 1:1 \
  --wait

Kling AI Image Generation Data Schema & Taxonomy

The skill interacts with the Kling AI task system. Below are the key data components used during operations:

Component Description
Model IDs Supports kling-v3, kling-v2-1, and kling-v1-5 for various quality tiers.
Reference Types subject (retains body/object) or face (retains facial features).
Task Metadata Includes task_id, status (processing/completed), and result URLs.
Image Specs Configurable aspect ratios (1:1, 16:9, etc.) and resolutions (1k, 2k).

Kling AI Image Generation Advanced Features

  • Multi-image Omni support: Apply the style of one image to the subject of another via the kling-v3-omni model.
  • Intelligent Outpainting: Automatically calculate expansion ratios or manually specify up/down/left/right padding percentages.
  • Progress Tracking: Integrated polling mechanism in generate_image_with_progress.py for real-time terminal feedback.
  • Task Management: Built-in utilities for listing historical tasks and querying specific task statuses by ID.
  • Fidelity Control: Adjustable image_fidelity parameters to balance creativity versus reference adherence.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*