Visual Design — Image Generation & Editing
Generate new images or edit existing ones via the backend image API.
Be patient, it takes about 2 minutes to generate an image each time.
Authentication (Required First)
Before using this skill, authentication must be completed. Run the auth script first:
# Authenticate: checks env token / cached token / browser login
python3 <skill-dir>/scripts/skywork_auth.py || exit 1
Token priority:
- Environment variable
SKYBOT_TOKEN → if set, use directly
- Cached token file
~/.skywork_token → validate via API, if valid, use it
- No valid token → opens browser for login, polls until complete, saves token
IMPORTANT - Login URL handling: If script output contains a line starting with [LOGIN_URL], you MUST immediately send that URL to the user in a clickable message (e.g. "Please open this link to log in: "). The user may be in an environment where the browser cannot open automatically, so always surface the login URL.
Usage
Run the script using absolute path (do NOT cd to skill directory):
Generate new image:
python3 <SKILL_DIR>/scripts/generate_image.py --prompt "description" --filename "output.png" [--aspect-ratio 3:4] [--resolution 1K|2K|4K]
Edit existing image:
python3 <SKILL_DIR>/scripts/generate_image.py --prompt "edit instructions" --filename "output.png" --input-image "source.png" [--aspect-ratio 3:4] [--resolution 2K]
Edit with multiple reference images:
python3 <SKILL_DIR>/scripts/generate_image.py --prompt "combine these styles" --filename "output.png" -i "ref1.png" -i "ref2.png"
Always run from the user's working directory so images save there.
When to Generate vs Edit
- Generation (
--prompt only): Creating new images from scratch — posters, logos, illustrations, photos, infographics.
- Editing (
--prompt + --input-image): User provides existing image(s) and wants modifications — style changes, element addition/removal, color adjustments, format conversion.
- Notice: Edit api supports character resemblance of up to 4 characters and the fidelity of up to 10 objects in a single workflow
If the user uploads/references images and wants changes, always use --input-image.
Resolution
- 1K — ~1024px, fast drafts
- 2K (default) — ~2048px, good for most deliverables
- 4K — ~4096px, final high-res output
Map user requests: "low/draft" → 1K, "normal/medium/2K" → 2K, "high-res/hi-res/4K/ultra" → 4K.
Aspect Ratio
Supported ratios: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9.
Selection guidance:
- 1:1 — Social media avatars, icons, album covers
- 3:4 / 4:3 — General posters, presentations
- 4:5 / 5:4 — Instagram posts, portraits
- 9:16 / 16:9 — Mobile stories / desktop wallpapers, video covers
- 2:3 / 3:2 — Print posters, book covers
- 21:9 — Ultra-wide banners, cinema format
If the user doesn't specify, omit --aspect-ratio and let the API decide.
Filename Convention
Pattern: yyyy-mm-dd-hh-mm-ss-descriptive-name.png
Examples:
- "A serene Japanese garden" →
2026-03-10-14-23-05-japanese-garden.png
- "sunset over mountains" →
2026-03-10-15-30-12-sunset-mountains.png
- Unclear context →
2026-03-10-17-12-48-x9k2.png
Preflight
command -v python3 (must exist)
- If editing: verify each
--input-image file exists
Common Failures
Error: Input image not found: → wrong path; verify --input-image file exists
HTTP error 500 → backend service error; retry or check server status
Request failed: Connection refused → backend service unavailable; ensure the service is running
- Insufficient benefit: The script or log may show a message like
Insufficient benefit. Please upgrade your account at {url}, meaning the user's benefit level does not meet the requirement for this skill.
How to reply when benefit is insufficient
When you detect the above, reply in the user's current language — do not echo the English message. Use this pattern:
- Convey: "Sorry, image generation failed. This skill requires upgrading your Skywork membership to use." then a single call-to-action link.
- Format: One short sentence in the user's language + a link like
[Upgrade now →](url) or the equivalent in their language.
- URL: Extract the upgrade URL from the log/script output (e.g. the
at https://... part).
Output
- Script prints the local file path and the OSS URL.
- Depending on the platform, use the most appropriate way to deliver the image (e.g. send as image message, display inline, or print the URLs). By default, return both the local path and OSS URL to the user. The OSS URL ensures cross-platform accessibility.
Design Scenarios
Match the user's request to a scenario and read the corresponding file for specialized workflow:
- E-commerce product image: See scenarios/e-commerce.md
- Storyboard: See scenarios/storyboard.md
- Infographic: See scenarios/infographic.md
- Logo: See scenarios/logo.md
- Branding / VI: See scenarios/branding.md
- Brochure: See scenarios/brochure.md
- Social media: See scenarios/social-media.md
- Poster: See scenarios/poster.md
Prompt Engineering
Prompts Best Practices
Follow these principles for quality prompts using the image API for generation or editing:
- Describe the scene, don't just list keywords. A narrative, descriptive paragraph produces much better results than disconnected words. The model's core strength is deep language understanding.
- Weak: "cat, sunset, beach"
- Strong: "A ginger tabby cat sitting on a sandy beach at golden hour, facing the camera with soft warm backlighting, shallow depth of field, ocean waves blurred in the background"
- Be hyper-specific. The more detail you provide, the more control you have. Include all visual details: style, colors, composition, lighting, background, textures.
- Provide context and intent. Explain the purpose of the image — the model's understanding of context influences the output.
- Use step-by-step instructions for complex scenes with many elements. Break the prompt into layers: foreground, middle ground, background.
- Use "semantic negative prompts." Instead of "no cars," describe positively: "an empty, deserted street with no signs of traffic."
- Control the camera. Use photographic and cinematic terms: "wide-angle shot", "macro shot", "low-angle perspective", "bird's eye view", "rule of thirds", "shallow depth of field".
- Time perception. If the result needs real-time timeliness, mention the current time context in the prompt.
- Text in images. Place text content within double quotation marks:
A movie poster with the title "INCEPTION" in large silver metallic letters at the top
- Clearly specify and emphasize the elements that require modification. Describe reference images by their order (first image, second image), not by filename.
1---2name: skywork-design3description: Generate or edit images via backend Skywork Image API. Use for any image creation, poster design, logo design, visual asset generation, or image modification request. Supports text-to-image and image-to-image editing with aspect ratio and resolution control.4---5
6# Visual Design — Image Generation & Editing
7
8Generate new images or edit existing ones via the backend image API.
9Be patient, it takes about 2 minutes to generate an image each time.
10
11---
12
13## Authentication (Required First)
14
15Before using this skill, authentication must be completed. Run the auth script first:
16
17```bash
18# Authenticate: checks env token / cached token / browser login
19python3 <skill-dir>/scripts/skywork_auth.py || exit 1
20```
21
22**Token priority**:
231. Environment variable `SKYBOT_TOKEN` → if set, use directly
242. Cached token file `~/.skywork_token` → validate via API, if valid, use it
253. No valid token → opens browser for login, polls until complete, saves token
26
27**IMPORTANT - Login URL handling**: If script output contains a line starting with `[LOGIN_URL]`, you **MUST** immediately send that URL to the user in a clickable message (e.g. "Please open this link to log in: <url>"). The user may be in an environment where the browser cannot open automatically, so always surface the login URL.
28
29---
30
31## Usage
32
33Run the script using absolute path (do NOT cd to skill directory):
34
35**Generate new image:**
36```bash
37python3 <SKILL_DIR>/scripts/generate_image.py --prompt "description" --filename "output.png" [--aspect-ratio 3:4] [--resolution 1K|2K|4K]
38```
39
40**Edit existing image:**
41```bash
42python3 <SKILL_DIR>/scripts/generate_image.py --prompt "edit instructions" --filename "output.png" --input-image "source.png" [--aspect-ratio 3:4] [--resolution 2K]
43```
44
45**Edit with multiple reference images:**
46```bash
47python3 <SKILL_DIR>/scripts/generate_image.py --prompt "combine these styles" --filename "output.png" -i "ref1.png" -i "ref2.png"
48```
49
50Always run from the user's working directory so images save there.
51
52## When to Generate vs Edit
53
54- **Generation** (`--prompt` only): Creating new images from scratch — posters, logos, illustrations, photos, infographics.
55- **Editing** (`--prompt` + `--input-image`): User provides existing image(s) and wants modifications — style changes, element addition/removal, color adjustments, format conversion.
56 - Notice: Edit api supports character resemblance of up to 4 characters and the fidelity of up to 10 objects in a single workflow
57
58If the user uploads/references images and wants changes, always use `--input-image`.
59
60## Resolution
61
62- **1K** — ~1024px, fast drafts
63- **2K** (default) — ~2048px, good for most deliverables
64- **4K** — ~4096px, final high-res output
65
66Map user requests: "low/draft" → 1K, "normal/medium/2K" → 2K, "high-res/hi-res/4K/ultra" → 4K.
67
68## Aspect Ratio
69
70Supported ratios: `1:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, `21:9`.
71
72Selection guidance:
73- **1:1** — Social media avatars, icons, album covers
74- **3:4 / 4:3** — General posters, presentations
75- **4:5 / 5:4** — Instagram posts, portraits
76- **9:16 / 16:9** — Mobile stories / desktop wallpapers, video covers
77- **2:3 / 3:2** — Print posters, book covers
78- **21:9** — Ultra-wide banners, cinema format
79
80If the user doesn't specify, omit `--aspect-ratio` and let the API decide.
81
82## Filename Convention
83
84Pattern: `yyyy-mm-dd-hh-mm-ss-descriptive-name.png`
85
86Examples:
87- "A serene Japanese garden" → `2026-03-10-14-23-05-japanese-garden.png`
88- "sunset over mountains" → `2026-03-10-15-30-12-sunset-mountains.png`
89- Unclear context → `2026-03-10-17-12-48-x9k2.png`
90
91## Preflight
92
93- `command -v python3` (must exist)
94- If editing: verify each `--input-image` file exists
95
96## Common Failures
97
98- `Error: Input image not found:` → wrong path; verify `--input-image` file exists
99- `HTTP error 500` → backend service error; retry or check server status
100- `Request failed: Connection refused` → backend service unavailable; ensure the service is running
101- **Insufficient benefit**: The script or log may show a message like `Insufficient benefit. Please upgrade your account at {url}`, meaning the user's benefit level does not meet the requirement for this skill.
102
103### How to reply when benefit is insufficient
104
105When you detect the above, **reply in the user's current language** — do not echo the English message. Use this pattern:
106
107- Convey: "Sorry, image generation failed. This skill requires upgrading your Skywork membership to use." then a single call-to-action link.
108- **Format**: One short sentence in the user's language + a link like `[Upgrade now →](url)` or the equivalent in their language.
109- **URL**: Extract the upgrade URL from the log/script output (e.g. the `at https://...` part).
110
111## Output
112
113- Script prints the local file path and the OSS URL.
114- Depending on the platform, use the most appropriate way to deliver the image (e.g. send as image message, display inline, or print the URLs). By default, return both the local path and OSS URL to the user. The OSS URL ensures cross-platform accessibility.
115
116## Design Scenarios
117
118Match the user's request to a scenario and read the corresponding file for specialized workflow:
119
120- **E-commerce product image**: See [scenarios/e-commerce.md](scenarios/e-commerce.md)
121- **Storyboard**: See [scenarios/storyboard.md](scenarios/storyboard.md)
122- **Infographic**: See [scenarios/infographic.md](scenarios/infographic.md)
123- **Logo**: See [scenarios/logo.md](scenarios/logo.md)
124- **Branding / VI**: See [scenarios/branding.md](scenarios/branding.md)
125- **Brochure**: See [scenarios/brochure.md](scenarios/brochure.md)
126- **Social media**: See [scenarios/social-media.md](scenarios/social-media.md)
127- **Poster**: See [scenarios/poster.md](scenarios/poster.md)
128
129## Prompt Engineering
130
131### Prompts Best Practices
132
133Follow these principles for quality prompts using the image API for generation or editing:
134
135- **Describe the scene, don't just list keywords.** A narrative, descriptive paragraph produces much better results than disconnected words. The model's core strength is deep language understanding.
136 - Weak: "cat, sunset, beach"
137 - Strong: "A ginger tabby cat sitting on a sandy beach at golden hour, facing the camera with soft warm backlighting, shallow depth of field, ocean waves blurred in the background"
138- **Be hyper-specific.** The more detail you provide, the more control you have. Include all visual details: style, colors, composition, lighting, background, textures.
139- **Provide context and intent.** Explain the purpose of the image — the model's understanding of context influences the output.
140- **Use step-by-step instructions** for complex scenes with many elements. Break the prompt into layers: foreground, middle ground, background.
141- **Use "semantic negative prompts."** Instead of "no cars," describe positively: "an empty, deserted street with no signs of traffic."
142- **Control the camera.** Use photographic and cinematic terms: "wide-angle shot", "macro shot", "low-angle perspective", "bird's eye view", "rule of thirds", "shallow depth of field".
143- **Time perception.** If the result needs real-time timeliness, mention the current time context in the prompt.
144- **Text in images.** Place text content within double quotation marks:
145 > A movie poster with the title "INCEPTION" in large silver metallic letters at the top
146- Clearly specify and emphasize the elements that require modification. Describe reference images by their order (first image, second image), not by filename.