Skill: dlazyai/dlazy-image-generate (version 1.1.1)

--- name: dlazy-image-generate version: 1.1.1 description: Image generation skill. Automatically selects the best dlazy CLI image model based on the prompt. metadata: {"clawdbot":{"emoji":"🤖","requires":{"bins":["npm","npx"]},"install":"npm install -g @dlazy/cli@1.0.9","installAlternative":"npx @dlazy/cli@1.0.9","homepage":"https://github.com/dlazyai/cli","source":"https://github.com/dlazyai/cli","author":"dlazyai","license":"see-repo","npm":"https://www.npmjs.com/package/@dlazy/cli","configLocation":"~/.dlazy/config.json","apiEndpoints":["api.dlazy.com","files.dlazy.com"]},"openclaw":{"systemPrompt":"When this skill is called, use dlazy <subcommand>."}} --- # dlazy-image-generate [English](./SKILL.md) · [中文](./SKILL-cn.md) Image generation skill. Automatically selects the best dlazy CLI image model based on the prompt. ## Trigger Keywords - generate image - draw picture - text to image ## Authentication All requests require a dLazy API key. The recommended way to authenticate is: ```bash This runs a device-code flow (also works in remote shells) and **automatically saves your API key** to the local CLI config — no manual copy/paste required. ### Alternative: Set the Key Manually If you already have an API key, you can save it directly: ```bash dlazy auth set YOUR_API_KEY ``` The CLI saves the key in your user config directory (`~/.dlazy/config.json` on macOS/Linux, `%USERPROFILE%\.dlazy\config.json` on Windows), with file permissions restricted to your OS user account. You can also supply the key per-invocation via the `DLAZY_API_KEY` environment variable. ### Getting Your API Key Manually 1. Sign in or create an account at [dlazy.com](https://dlazy.com) 2. Go to [dlazy.com/dashboard/organization/api-key](https://dlazy.com/dashboard/organization/api-key) 3. Copy the key shown in the API Key section Each key is scoped to your dLazy organization and can be **rotated or revoked at any time** from the same dashboard. ## About & Provenance - **CLI source code**: [github.com/dlazyai/cli](https://github.com/dlazyai/cli) - **Maintainer**: dlazyai - **npm package**: `@dlazy/cli` (pinned to `1.0.9` in this skill's install spec) - **Homepage**: [dlazy.com](https://dlazy.com) You can install on demand without persisting a global binary by running: ```bash npx @dlazy/cli@1.0.9 <command> ``` Or, if you prefer a global install, the skill's `metadata.clawdbot.install` field declares the exact pinned version (`npm install -g @dlazy/cli@1.0.9`). Review the GitHub source before installing. ## How It Works This skill is a thin client over the dLazy hosted API. When you invoke it: - Prompts and parameters you provide are sent to the dLazy API endpoint (`api.dlazy.com`) for inference. - Any local file paths you pass to image / video / audio fields are uploaded to dLazy's media storage (`files.dlazy.com`) so the model can read them — the same flow as any cloud-based generation API. - Generated output URLs returned by the API are hosted on `files.dlazy.com`. This is the standard SaaS pattern; the skill itself does not access network or filesystem resources beyond what the dLazy CLI already handles. See [dlazy.com](https://dlazy.com) for the full service terms. ## Piping Between Commands Every `dlazy` invocation prints a JSON envelope on stdout. Any flag value can be a **pipe reference** that pulls from the upstream command's envelope, so you can chain steps without copying URLs by hand. | Reference | Resolves to | | ------------------ | --------------------------------------------------------------- | | `-` | Upstream's natural value for this field (scalar or array) | | `@N` | The N-th output's primary value (e.g. `@0` = first output url) | | `@N.<jsonpath>` | Drill into the N-th output (`@0.url`, `@1.meta.fps`) | | `@*` | All outputs' primary values as an array | | `@stdin` | The whole upstream JSON envelope | | `@stdin:<jsonpath>` | Jsonpath into the whole envelope (`@stdin:result.outputs[0].url`) | ### Examples ```bash # Generate an image and feed its url straight into image-to-video dlazy seedream-4.5 --prompt "a red fox in snow" \ | dlazy kling-v3 --image - --prompt "fox starts running" # Generate an image, then add TTS narration over a still dlazy seedream-4.5 --prompt "lighthouse at dawn" \ | dlazy keling-tts --text "Welcome to the coast." --image @0.url # Fan-out: pass every upstream output url into a batch step dlazy seedream-4.5 --prompt "city skyline" --n 4 \ | dlazy superres --images @* ``` > Required flags can be entirely sourced from the pipe — `--field -` satisfies the requirement when an upstream value exists. If stdin is empty, the CLI fails with `code: "no_stdin"`. ## Usage This skill handles all image generation requests by selecting the best `dlazy` image model. ### Available Image Models - `dlazy gpt-image-2`: GPT Image 2 model for text-to-image and image editing. Supports generating images from text as well as editing and synthesizing images with reference inputs. - `dlazy seedream-4.5`: High-quality text-to-image/image-to-image model, suitable for posters, realism, and creative scenes. Supports prompt + multiple reference images, outputting single high-res images (2K/4K). - `dlazy seedream-5.0-lite`: Lightweight high-speed image generation model, suitable for batch generation, sketches, and low-cost iteration. Supports prompt + reference images, outputting 2K/3K images. - `dlazy banana2`: General text-to-image model (optional 1 reference image), emphasizes speed and cost-effectiveness. Suitable for quick visual drafts, social media posts, and multi-size generation. - `dlazy banana-pro`: High-quality text-to-image model (optional 1 reference image), suitable for key visuals, product shots, and brand style generation with higher detail requirements. - `dlazy grok-4.2`: Minimalist text-to-image model, requires only prompt. Suitable for quick creative validation or scenarios with average quality requirements. - `dlazy recraft-v3`: Stylized text-to-image model, supports aspect ratio and style control (realism/illustration, etc.). Suitable for brand KV, posters, and consistent visual content. - `dlazy recraft-v3-svg`: Text-to-vector model, outputs SVG/vector-style results. Suitable for logos, icons, line art, and scalable design assets. - `dlazy recraft-v4`: 1MP raster image generation with refined design judgment. Suitable for everyday creative work and fast iteration. - `dlazy recraft-v4-vector`: Text-to-vector model that outputs SVG results. Suitable for logos, icons, and scalable design assets. - `dlazy recraft-v4-pro`: 4MP high-resolution raster image generation. Suitable for print-ready assets and large-scale use. - `dlazy recraft-v4-pro-vector`: High-fidelity text-to-vector model with 4MP-tier quality. Suitable for production-grade SVG assets and detailed illustrations. - `dlazy mj-imagine`: Midjourney style generation, supports aspect ratio, Bot type, and output position (grid/U1-U4). Suitable for artistic and strongly stylized creative generation. - `dlazy kling-image-o1`: Kling image model, supports '<image_1>' placeholder in prompt for reference image binding. Suitable for multi-image constraints and high-fidelity generation. - `dlazy viduq2-t2i`: Vidu image generation model, supports text + reference image, aspect ratio, and resolution control. Suitable for character art, cover images, and high-res generation. - `dlazy jimeng-t2i`: Jimeng high-res text-to-image model, supports multi-ratio ultra-clear output and reference image constraints, suitable for commercial visuals and refined generation. - `dlazy imageseg`: Image matting tool: separates foreground from background and returns transparent background URL, suitable for product image processing, character cutout, and composition. - `dlazy image-replicate`: Image replicate tool: analyzes the visuals, composition, colors, lighting, and style of the source image, builds a replicate prompt, and hands it off to Seedream 4.5 to generate a new image in the same style. - `dlazy superres`: Image super-resolution tool: enhances image clarity and details, returning enhanced URL, suitable for low-res asset restoration and upscaling. **CRITICAL INSTRUCTION FOR AGENT**: 1. Select the most appropriate image model. 2. Run `dlazy <model_name> -h` to check parameters. 3. Execute the command. ## Error Handling | Code | Error Type | Example Message | | ---- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | | 401 | Unauthorized (No API Key) | `ok: false, code: "unauthorized", message: "API key is missing or invalid"` | | 501 | Missing required parameter | `error: required option '--prompt <prompt>' not specified` | | 502 | Local file read error | `Error: Image file/Video file not found: C:\path\to\your\file` | | 503 | API request failed (no balance) | `ok: false, code: "insufficient_balance"` | | 503 | API request failed (server error) | `HTTP status code error (500 server crash)` | | 504 | Asynchronous task execution failed | `=== Generation Failed ===` / `{Specific error reason returned by backend, for example "Prompt violates safety policy"}` | > **AGENT CRITICAL INSTRUCTION**: > 1. If the execution result returns `code: "insufficient_balance"`, you MUST explicitly inform the user that their credits are insufficient and guide them to recharge: [https://dlazy.com/dashboard/organization/settings?tab=credits](https://dlazy.com/dashboard/organization/settings?tab=credits) > 2. If the execution result returns `code: "unauthorized"` or indicates missing API key, you MUST inform the user to get their API key from [https://dlazy.com/dashboard/organization/api-key](https://dlazy.com/dashboard/organization/api-key) and save it using `dlazy auth set <key>` and resume the task. ## Tips Visit https://dlazy.com for more information.

path: SKILL-cn.md
content: ---
name: dlazy-image-generate
version: 1.1.1
description: 图片生成技能。根据提示词自动选择最佳的 dlazy CLI 图片生成模型。
metadata: {"clawdbot":{"emoji":"🤖","requires":{"bins":["npm","npx"]},"install":"npm install -g @dlazy/cli@1.0.9","installAlternative":"npx @dlazy/cli@1.0.9","homepage":"https://github.com/dlazyai/cli","source":"https://github.com/dlazyai/cli","author":"dlazyai","license":"see-repo","npm":"https://www.npmjs.com/package/@dlazy/cli","configLocation":"~/.dlazy/config.json","apiEndpoints":["api.dlazy.com","files.dlazy.com"]},"openclaw":{"systemPrompt":"当调用此技能时，请自动选择对应的 dlazy 子命令执行。"}}
---

# dlazy-image-generate

[English](./SKILL.md) · [中文](./SKILL-cn.md)


图片生成技能。根据提示词自动选择最佳的 dlazy CLI 图片生成模型。

## Trigger Keywords /## 触发关键词

- 生成图片
- 画图
- 文生图

## 身份验证 (Authentication)

所有请求都需要 dLazy API key。**推荐使用** `dlazy login` 完成登录：

```bash
dlazy login
```

该命令使用设备码流程（远程终端也可用），登录成功后 **自动把 API key 写入本地 CLI 配置**，无需手动复制粘贴。

### 备选：手动设置 API Key

如果你已有 API key，也可以直接保存：

```bash
dlazy auth set YOUR_API_KEY
```

CLI 会把 key 保存在你的用户配置目录（macOS/Linux 上为 `~/.dlazy/config.json`，Windows 上为 `%USERPROFILE%\.dlazy\config.json`），文件权限仅限当前操作系统用户访问。你也可以用 `DLAZY_API_KEY` 环境变量按次传入。

### 手动获取 API Key

1. 登录或在 [dlazy.com](https://dlazy.com) 创建账号
2. 访问 [dlazy.com/dashboard/organization/api-key](https://dlazy.com/dashboard/organization/api-key)
3. 复制 API Key 区域显示的密钥

每个 key 都属于你自己的 dLazy 组织，可在同一控制面板**随时轮换或吊销**。




## 关于与来源 (Provenance)

- **CLI 源代码**: [github.com/dlazyai/cli](https://github.com/dlazyai/cli)
- **维护者**: dlazyai
- **npm 包名**: `@dlazy/cli`（本技能 install 字段固定到 `1.0.9` 版本）
- **官网**: [dlazy.com](https://dlazy.com)

如果你不希望在系统上长期保留一个全局 CLI，可以按需运行：

```bash
npx @dlazy/cli@1.0.9 <command>
```

如选择全局安装，技能的 `metadata.clawdbot.install` 字段已固定到 `npm install -g @dlazy/cli@1.0.9`。安装前建议先到 GitHub 仓库审阅源码。

## 工作原理

此技能是 dLazy 托管 API 的轻量封装。调用时：

- 你提供的提示词与参数会发送到 dLazy API（`api.dlazy.com`）进行推理。
- 传入图像 / 视频 / 音频字段的本地文件路径会被 CLI 上传到 dLazy 媒体存储（`files.dlazy.com`），以便模型读取 —— 与任何云端生成 API 的流程一致。
- API 返回的生成结果 URL 由 `files.dlazy.com` 托管。

这是标准的 SaaS 调用模式；技能本身不会越权访问网络或文件系统，所有动作都由 dLazy CLI 完成。完整服务条款请参见 [dlazy.com](https://dlazy.com)。

## 命令间管道 (Piping)

每次 `dlazy` 调用都会向 stdout 输出一个 JSON 信封。任意参数都可以使用 **管道引用** 直接从上游命令的信封里取值，避免手工复制 URL。

| 引用语法              | 含义                                                            |
| --------------------- | --------------------------------------------------------------- |
| `-`                   | 上游为该字段提供的自然值（标量或数组按字段类型自动选取）        |
| `@N`                  | 第 N 个 output 的主值（如 `@0` 为第一个 output 的 url）         |
| `@N.<jsonpath>`       | 进入第 N 个 output 的字段（`@0.url`, `@1.meta.fps`）            |
| `@*`                  | 所有 output 的主值组成的数组                                    |
| `@stdin`              | 上游完整的 JSON 信封                                            |
| `@stdin:<jsonpath>`   | 在完整信封上做 jsonpath（`@stdin:result.outputs[0].url`）       |

### 示例

```bash
# 文生图后直接把图喂给图生视频
dlazy seedream-4.5 --prompt "雪地里的红狐" \
  | dlazy kling-v3 --image - --prompt "狐狸开始奔跑"

# 文生图 + TTS 配音（拿第一个 output 的 url 作为画面）
dlazy seedream-4.5 --prompt "黎明的灯塔" \
  | dlazy keling-tts --text "欢迎来到海岸。" --image @0.url

# 批量分发：把上游所有 output 的 url 一次性传给批处理步骤
dlazy seedream-4.5 --prompt "城市天际线" --n 4 \
  | dlazy superres --images @*
```

> 必填参数也可以完全由管道提供 —— 当上游存在对应值时，`--field -` 即可满足必填校验。若 stdin 为空，CLI 会以 `code: "no_stdin"` 报错。

## 使用方法

此技能处理所有图片生成请求，通过选择最佳的 `dlazy` 图片模型。

### 可用的图片模型

- `dlazy gpt-image-2`: GPT Image 2 文生图及图片编辑模型。支持纯文本生成图片，也支持传入参考图进行图像编辑与合成。
- `dlazy seedream-4.5`: 高质量文生图/参考图生图模型，适合海报、写实与创意场景。支持 prompt + 多张参考图，输出单张高分辨率图片（2K/4K）。
- `dlazy seedream-5.0-lite`: 轻量高速图像生成模型，适合批量出图、草图探索与低成本迭代。支持 prompt + 参考图，输出 2K/3K 图片。
- `dlazy banana2`: 通用文生图模型（可选 1 张参考图），强调速度与性价比。适合快速视觉草稿、社媒配图与多尺寸比例生成。
- `dlazy banana-pro`: 高质量文生图模型（可选 1 张参考图），适合细节要求更高的主视觉、产品图与品牌风格图生成。
- `dlazy grok-4.2`: 极简文生图模型，仅需 prompt。适合快速验证创意或对质量要求一般的即时出图场景。
- `dlazy recraft-v3`: 风格化文生图模型，支持比例与风格控制（写实/插画等）。适合品牌 KV、海报与风格统一的视觉内容。
- `dlazy recraft-v3-svg`: 文本到矢量图模型，输出偏 SVG/矢量风格结果。适合 Logo、图标、线稿与可无损缩放的设计素材生成。
- `dlazy recraft-v4`: 1MP 栅格图像生成，具备更精炼的设计判断力。适合日常创意工作和快速迭代场景。
- `dlazy recraft-v4-vector`: 文本到矢量图模型，输出 SVG 结果。适合 Logo、图标与可无损缩放的设计素材。
- `dlazy recraft-v4-pro`: 4MP 高分辨率栅格图像生成。适合可印刷级素材与大幅面应用场景。
- `dlazy recraft-v4-pro-vector`: 高保真文本到矢量模型，4MP 级品质。适合生产级 SVG 素材与精细插画。
- `dlazy mj-imagine`: Midjourney 风格出图入口，支持画幅、Bot 类型与输出位（grid/U1-U4）。适合艺术化、风格强烈的创意图生成。
- `dlazy kling-image-o1`: Kling 图像模型，支持在 prompt 中使用 '<image_1>' 占位符进行参考图绑定。适合多图条件约束与高保真生成。
- `dlazy viduq2-t2i`: Vidu 图像生成模型，支持文本+参考图、比例与分辨率控制。适合角色图、封面图和高分辨率图像生成。
- `dlazy jimeng-t2i`: 即梦高分辨率文生图模型，支持多比例超清输出与参考图约束，适合商业视觉与精细化出图。
- `dlazy imageseg`: 图像抠图工具：分离前景与背景并返回透明底结果 URL，适合商品图处理、人物抠像与二次合成。
- `dlazy image-replicate`: 图片复刻工具：分析源图的画面、构图、色彩、光线与风格，生成复刻提示词并交由 Seedream 4.5 生成同风格新图。
- `dlazy superres`: 图像超分工具：提升图片清晰度与细节并返回增强后 URL，适合低清素材修复与二次放大输出。

> **智能体关键指令**:
>
> 1. 选择最合适的图片模型。
> 2. 运行 `dlazy <model_name> -h` 查看参数。
> 3. 执行命令。


## 错误处理

| Code | 错误类型                         | 示例信息                                                                                                                 |
| ---- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| 401  | 未授权 (API Key缺失或无效)       | `ok: false, code: "unauthorized", message: "API key is missing or invalid"`                                                              |
| 501  | 缺少必填参数                     | `error: required option '--prompt <prompt>' not specified`                                                               |
| 502  | 本地文件读取失败                 | `Error: Image file/Video file not found: C:\path\to\your\file`                                                           |
| 503  | API 请求失败（余额不足）         | `ok: false, code: "insufficient_balance"` |
| 503  | API 请求失败（服务端错误）       | `HTTP status code error (500 server crash)`                                                                              |
| 504  | 异步任务执行失败                 | `=== Generation Failed ===` / `{后端返回的具体失败原因，比如 "Prompt violates safety policy"}`                             |

> **智能体关键指令**: 
> 1. 如果执行结果返回 `code: "insufficient_balance"` 且提示余额不足（Insufficient balance），您必须明确告知用户当前积分不足，并引导用户点击以下链接前往充值：[https://dlazy.com/dashboard/organization/settings?tab=credits](https://dlazy.com/dashboard/organization/settings?tab=credits)
> 2. 如果执行结果返回 `code: "unauthorized"` 或提示缺少 API Key，您必须明确告知用户前往 [https://dlazy.com/dashboard/organization/api-key](https://dlazy.com/dashboard/organization/api-key) 获取 API Key 并使用 `dlazy auth set <key>` 保存，然后继续执行任务。

## Tips

Visit https://dlazy.com for more information.

Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (MEDIUM)