VectorNode Image Generation
GPT Image (gpt-image-2) generation and editing via VectorNode relay API.
Auto-routing: short prompts → token billing · long prompts → per-request billing.
Trigger
Use when: "生成图片", "generate image", "create illustration", "画一张", "编辑图片", "edit image", "GPT生图", "gpt image".
Quick Start
# Generation (auto-route billing)
python3 ~/.openclaw/skills/vectornode-image-gen/scripts/vectornode_gen.py \
-p "你的提示词" \
-o "/path/to/output.png"
# Edit existing image
python3 ~/.openclaw/skills/vectornode-image-gen/scripts/vectornode_gen.py \
-p "add a sunset background" \
-i "/path/to/input.png" \
-o "/path/to/output.png"
# Force billing mode
python3 ~/.openclaw/skills/vectornode-image-gen/scripts/vectornode_gen.py \
-p "long detailed prompt..." \
-o "/path/to/output.png" \
--billing per-request # or token
Routing Logic
| Prompt Length |
Billing |
Model |
Best For |
| < 300 chars |
Token |
gpt-image-2 |
Simple prompts, quick iterations |
| ≥ 300 chars |
Per-request |
gpt-image-2-all |
Detailed prompts, content covers |
Threshold configurable via VECTORNODE_ROUTE_THRESHOLD env var (default: 300).
Parameters
| Flag |
Required |
Default |
Description |
-p, --prompt |
✅ |
— |
Image prompt (max 1000 chars for gen) |
-o, --output |
✅ |
— |
Output file path (.png/.jpg/.webp) |
-i, --image |
❌ |
— |
Input image for edit mode |
-m, --mask |
❌ |
— |
Mask image for edit (transparent areas = edit zone) |
-s, --size |
❌ |
1024x1024 |
1024x1024, 1536x1024, 1024x1536, 2048x2048, etc. |
-n, --count |
❌ |
1 |
Number of images (1-10) |
-q, --quality |
❌ |
auto |
low, medium, high, auto |
--billing |
❌ |
auto |
auto, token, per-request |
--background |
❌ |
auto |
opaque, transparent, auto (edit mode only) |
--moderation |
❌ |
auto |
low, auto |
API Endpoints
| Mode |
Endpoint |
Method |
Content-Type |
| Generate |
/v1/images/generations |
POST |
application/json |
| Edit |
/v1/images/edits |
POST |
multipart/form-data |
Configuration
API credentials read from (in priority order):
- Environment variables:
VECTORNODE_API_KEY, VECTORNODE_BASE_URL
~/.openclaw/workspace/.env file
Supported Sizes
1024x1024 — Square (default)
1536x1024 — Landscape 3:2
1024x1536 — Portrait 2:3
2048x2048 — 2K Square
2048x1152 — 2K Landscape
3840x2160 — 4K Landscape
2160x3840 — 4K Portrait
auto — Model decides
Constraints: max dimension ≤ 3840px, aspect ratio ≤ 3:1, pixel range 655360–8294400.
Output Formats
png, jpeg, webp. Transparent background requires png or webp + --background transparent.
Workflow
- Determine mode: has
-i → edit, otherwise → generate
- Auto-route billing if
--billing auto:
- Prompt < threshold chars → token billing (
gpt-image-2)
- Prompt ≥ threshold chars → per-request (
gpt-image-2-all)
- Call API, decode base64 response, save to output path
- Return output path for downstream use
Integration with Content Workflow
When generating content covers, combine with content-cover-gen skill for prompt design:
1. Read content-cover-gen SKILL.md for visual metaphor methodology
2. Design prompt with visual metaphor + Chinese text
3. Call vectornode-image-gen with the designed prompt
4. Use output image as article cover
Error Handling
- API errors surfaced with HTTP status + response body
- Network timeout: 120s
- Retry: 1 automatic retry on 5xx
- Invalid image format: validated before upload (PNG < 50MB, mask PNG < 4MB)
1---2name: vectornode-image-gen3description: GPT image generation/editing via VectorNode relay; auto-routes token vs per-request billing based on prompt length.4---5
6# VectorNode Image Generation
7
8GPT Image (gpt-image-2) generation and editing via VectorNode relay API.
9Auto-routing: short prompts → token billing · long prompts → per-request billing.
10
11## Trigger
12
13Use when: "生成图片", "generate image", "create illustration", "画一张", "编辑图片", "edit image", "GPT生图", "gpt image".
14
15## Quick Start
16
17```bash
18# Generation (auto-route billing)
19python3 ~/.openclaw/skills/vectornode-image-gen/scripts/vectornode_gen.py \
20 -p "你的提示词" \
21 -o "/path/to/output.png"
22
23# Edit existing image
24python3 ~/.openclaw/skills/vectornode-image-gen/scripts/vectornode_gen.py \
25 -p "add a sunset background" \
26 -i "/path/to/input.png" \
27 -o "/path/to/output.png"
28
29# Force billing mode
30python3 ~/.openclaw/skills/vectornode-image-gen/scripts/vectornode_gen.py \
31 -p "long detailed prompt..." \
32 -o "/path/to/output.png" \
33 --billing per-request # or token
34```
35
36## Routing Logic
37
38| Prompt Length | Billing | Model | Best For |
39|---|---|---|---|
40| < 300 chars | Token | `gpt-image-2` | Simple prompts, quick iterations |
41| ≥ 300 chars | Per-request | `gpt-image-2-all` | Detailed prompts, content covers |
42
43Threshold configurable via `VECTORNODE_ROUTE_THRESHOLD` env var (default: 300).
44
45## Parameters
46
47| Flag | Required | Default | Description |
48|---|---|---|---|
49| `-p, --prompt` | ✅ | — | Image prompt (max 1000 chars for gen) |
50| `-o, --output` | ✅ | — | Output file path (.png/.jpg/.webp) |
51| `-i, --image` | ❌ | — | Input image for edit mode |
52| `-m, --mask` | ❌ | — | Mask image for edit (transparent areas = edit zone) |
53| `-s, --size` | ❌ | `1024x1024` | `1024x1024`, `1536x1024`, `1024x1536`, `2048x2048`, etc. |
54| `-n, --count` | ❌ | `1` | Number of images (1-10) |
55| `-q, --quality` | ❌ | `auto` | `low`, `medium`, `high`, `auto` |
56| `--billing` | ❌ | `auto` | `auto`, `token`, `per-request` |
57| `--background` | ❌ | `auto` | `opaque`, `transparent`, `auto` (edit mode only) |
58| `--moderation` | ❌ | `auto` | `low`, `auto` |
59
60## API Endpoints
61
62| Mode | Endpoint | Method | Content-Type |
63|---|---|---|---|
64| Generate | `/v1/images/generations` | POST | `application/json` |
65| Edit | `/v1/images/edits` | POST | `multipart/form-data` |
66
67## Configuration
68
69API credentials read from (in priority order):
701. Environment variables: `VECTORNODE_API_KEY`, `VECTORNODE_BASE_URL`
712. `~/.openclaw/workspace/.env` file
72
73## Supported Sizes
74
75- `1024x1024` — Square (default)
76- `1536x1024` — Landscape 3:2
77- `1024x1536` — Portrait 2:3
78- `2048x2048` — 2K Square
79- `2048x1152` — 2K Landscape
80- `3840x2160` — 4K Landscape
81- `2160x3840` — 4K Portrait
82- `auto` — Model decides
83
84Constraints: max dimension ≤ 3840px, aspect ratio ≤ 3:1, pixel range 655360–8294400.
85
86## Output Formats
87
88`png`, `jpeg`, `webp`. Transparent background requires `png` or `webp` + `--background transparent`.
89
90## Workflow
91
921. Determine mode: has `-i` → edit, otherwise → generate
932. Auto-route billing if `--billing auto`:
94 - Prompt < threshold chars → token billing (`gpt-image-2`)
95 - Prompt ≥ threshold chars → per-request (`gpt-image-2-all`)
963. Call API, decode base64 response, save to output path
974. Return output path for downstream use
98
99## Integration with Content Workflow
100
101When generating content covers, combine with **content-cover-gen** skill for prompt design:
102
103```
1041. Read content-cover-gen SKILL.md for visual metaphor methodology
1052. Design prompt with visual metaphor + Chinese text
1063. Call vectornode-image-gen with the designed prompt
1074. Use output image as article cover
108```
109
110## Error Handling
111
112- API errors surfaced with HTTP status + response body
113- Network timeout: 120s
114- Retry: 1 automatic retry on 5xx
115- Invalid image format: validated before upload (PNG < 50MB, mask PNG < 4MB)