Image Generator Skill
Use this skill to generate image assets from user descriptions and to create reference-URL-guided variants or edit-style regenerated images. This skill creates image files; it does not analyze images, OCR text, extract tables, or diagnose screenshots.
Supported Tasks
generate_image: text-to-image generation for article illustrations, marketing assets, poster concepts, product concepts, ecommerce scenes, illustrations, icons, and cover drafts.edit_image: reference-URL-guided variants and edit-style regeneration such as background change, color change, adding elements, removing elements, and style transfer.
Important: the current backend does not pass reference images as structured image-edit inputs through adapter.ImageRequest; it passes a signed reference image URL inside the prompt. Treat edit_image as prompt-plus-reference-URL regeneration, not precise in-place editing or guaranteed reference adherence.
Workflow
- Determine whether the user wants text-to-image generation or reference-image editing/variants.
- If the user request is casual, vague, incomplete, or not already written as a professional image prompt, first use
prompt-professionalizerto produce an optimized image prompt and parameter suggestions. - If required image decisions are still missing after prompt professionalization, call
request_user_inputbefore calling any image tool. - Read exactly one reference document for the selected task or use case.
- Build a concise generation prompt that includes subject, scene, composition, style, color, lighting, intended use, and prohibited elements when provided.
- Choose or confirm aspect ratio and number of candidates.
- Call
call_skill_toolwithtool_nameset togenerate_imageoredit_image. - In the final answer, mention the generated file names, usage notes, and any copyright or brand compliance reminder. Do not paste raw image bytes or base64.
Clarification Workflow
Call request_user_input instead of writing a plain clarification when a missing decision blocks useful generation. Ask 1-4 focused questions. Options must be concrete answers that can be used directly. A single question may contain at most 5 options.
Ask when:
- The user only says "生成图片", "做张图", "generate an image", or similar without a usable prompt.
- The intended use is unclear and affects composition, such as article image versus poster versus ecommerce scene.
- The aspect ratio is missing.
- The style is missing and the user's request implies a visual direction matters.
- The user asks for a reference-image variant but no reference image is available.
- The user asks for local editing but does not specify the edit target or desired result.
- The request involves brand logos, real people, product photos, commercial use, or likely rights-sensitive material.
Example request_user_input payload:
{
"message": "我可以生成图片,但需要先确认关键参数。",
"questions": [
{
"id": "usage",
"question": "图片主要用于什么场景?",
"options": [
{ "label": "文章配图", "description": "偏叙事和视觉吸引。" },
{ "label": "活动海报", "description": "偏醒目构图和传播感。" },
{ "label": "产品概念图", "description": "突出产品形态和使用场景。" },
{ "label": "营销素材", "description": "突出卖点和品牌调性。" },
{ "label": "电商场景图", "description": "突出商品和环境。" }
]
},
{
"id": "aspect_ratio",
"question": "需要什么尺寸比例?",
"options": [
{ "label": "1:1", "description": "适合头像、商品主图、社媒方图。" },
{ "label": "16:9", "description": "适合文章头图、横版展示。" },
{ "label": "9:16", "description": "适合手机海报、短视频封面。" },
{ "label": "4:3", "description": "适合通用展示图。" }
]
}
]
}
After calling request_user_input, stop the turn and wait for the user's answer.
References
Read exactly one reference after choosing the task:
| Requested task | Read reference |
|---|---|
| Text-to-image, generic image generation, illustration | text-to-image.md |
| Reference image variant, keep main subject, create alternatives | reference-variant.md |
| Background change, color change, add/remove element, style transfer | image-edit.md |
| Marketing asset, social media visual, campaign creative | marketing-material.md |
| Poster concept, cover draft, event key visual | poster-concept.md |
| Product concept, ecommerce product scene, product lifestyle image | product-scene.md |
| Style choice, realistic, illustration, flat, 3D, guofeng, tech | style-guide.md |
Tool Usage
generate_image accepts:
prompt: required image description.style: optional style:auto,realistic,illustration,flat,3d,guofeng,tech,poster,product,icon, orcover.aspect_ratio: optional ratio:1:1,16:9,9:16, or4:3. Defaults to1:1.count: optional number of candidates, 1-4. Defaults to 1.negative_prompt: optional prohibited elements or undesired visual traits.reference_image: optional current-user reference image file object or file ID. The tool places a signed reference image URL in the prompt for loose visual guidance; it is not a structured image input.filename: optional base filename without path separators.lifecycle: optional file lifecycle:persistentortemporary. Defaults topersistent.providerandmodel: optional explicit image model selection; usually omit.
edit_image accepts:
image: required current-user reference image file object or file ID. The tool places a signed reference image URL in the prompt for loose visual guidance; it is not a structured image input.edit_instruction: required edit or variant instruction.edit_type: optional:auto,variant,background,color,add_element,remove_element, orstyle_transfer.style,aspect_ratio,count,negative_prompt,filename,lifecycle,provider, andmodel: same asgenerate_image.
Constraints
- Before calling
generate_imageoredit_image, useprompt-professionalizerwhen the user's request is casual, vague, incomplete, or not already a professional image prompt. Direct tool calls are allowed only when the prompt and key parameters are already complete. - Do not generate illegal, pornographic, exploitative, hateful, fraudulent, or clearly harmful imagery.
- Do not generate graphic violence or sexual content.
- Do not generate or imitate a specific living person's likeness.
- Do not create deceptive official documents, IDs, receipts, signatures, watermarks, or brand impersonation materials.
- For brand logos, recognizable people, product photos, or commercial assets, remind the user to confirm copyright, trademark, portrait rights, and brand compliance before commercial use.
- Do not claim that generated images are legally cleared for commercial use.
- Do not handle OCR, image recognition, table extraction, or screenshot diagnosis in this skill; image generation and image editing are the only supported tasks here.
- If generation fails or does not match expectations, offer to regenerate with refined prompt, style, ratio, or negative prompt.