返回 AiToEarn
1 ---
2 name: image-creation
3 description: Generate or edit raster images for social posts, product shots, covers, mockups, and variants. Use when the user asks to create, edit, restyle, adapt, or redesign images based on provided images, or batch-generate bitmap images, or mentions posters, covers, product photos, illustrations, or reference-image generation.
4 allowed-tools:
5 - list_image_models
6 - generate_image
7 ---
8
9 # Image Creation
10
11 Generate or edit raster images with `list_image_models` and `generate_image`.
12
13 Shared prompt guidance: `references/prompting.md`.
14 Copy/paste recipes: `references/sample-prompts.md`.
15
16 ## Tools
17
18 - `list_image_models`: call first. Use only returned `name`, `sizes`, `qualities`, `styles`, `maxInputImages`, and pricing. Do not invent model ids or sizes.
19 - `generate_image`: `prompt` required; `model` optional (omit to use the default `gpt-image-2.5-sunburst`); optional `images`, `size`, `quality`, `style`.
20 - Default model: `gpt-image-2.5-sunburst` when the catalog lists it; otherwise use another GPT Image 2.5 model or the closest available model.
21 - Default size when the user has no size preference (1080p class): 16:9 -> `1536x864`, 9:16 -> `864x1536`, 1:1 -> `1024x1024`; otherwise pick the catalog size matching the requested aspect.
22 - No `images` → new generation.
23 - One or more `images` (URLs) → reference/edit generation. Do not exceed `maxInputImages`.
24 - Credit (积分) estimate runs automatically. If the user must confirm, wait. Do not retry a rejected cost.
25
26 Do not call other image APIs, CLIs, or local scripts.
27
28 ## When to use
29
30 - New image: concept, product shot, cover, poster, social asset, mockup
31 - New image guided by reference images (style, composition, mood, subject)
32 - Adapt or redesign an image or design the user provided (change format, layout, device framing, restyle) while keeping its content
33 - Edit an existing image (object change, background, lighting, compositing, restyle)
34 - Many assets or variants for one request
35
36 ## When not to use
37
38 - Matching an existing SVG/vector icon or logo system
39 - Simple shapes, diagrams, or icons that should be SVG, HTML/CSS, or canvas
40 - A small edit when the source is already an editable native file
41 - The user wants deterministic code-native output instead of a bitmap
42
43 ## Decision tree
44
45 1. **Intent:** were images provided, and what role do they play?
46 2. **Execution:** one asset or many assets/variants?
47
48 Intent:
49
50 - User provided images with the request → the images MUST be passed in `images`. Generate from scratch without them only if the user explicitly says the images are irrelevant or inspiration-only. Ignoring provided images and inventing content is a failure mode.
51 - User wants to change an existing image while keeping parts of it → **edit**. Pass those image URLs in `images` and list invariants in the prompt.
52 - User gives images as style/composition/mood/subject references → **generate with references**. Still pass URLs in `images`, and label each role in the prompt.
53 - User gives an image or design to adapt, redesign, or translate into another format/framing → **generate with references**, grounded in the image's real content (see Workflow step 2).
54 - No images → **generate**.
55
56 Execution:
57
58 - Distinct assets need distinct `generate_image` calls and distinct prompts.
59 - Variants of one prompt still use one call per variant, with a single targeted change in each prompt.
60
61 Assume a new image unless the user clearly asks to change an existing one.
62
63 ## Workflow
64
65 1. Call `list_image_models` and pick `model` / `size` / `quality` / `style` from that catalog. When the user has no model preference, use `gpt-image-2.5-sunburst` if listed; otherwise use another GPT Image 2.5 model or the closest available model. If the user names a target device, format, or aspect (e.g. landscape, poster, phone), pick the size that matches it; otherwise use the default 1080p-class size (16:9 -> `1536x864`, 9:16 -> `864x1536`, 1:1 -> `1024x1024`). **Default-confirmation rule**: when the user has no preference, use these defaults directly. Before generating with any non-default model, size, quality, or style, briefly tell the user why the default is not suitable and which option you plan to use, then wait for their explicit confirmation; never switch silently. If the user already specified that model/size/quality/style in their request, their choice stands and no extra confirmation is needed.
66 2. Inspect every image the user provided: identify its actual subject, visible text and its language, colors, and layout. The prompt must describe what is really in the image — never substitute invented content for it.
67 3. Collect prompt, verbatim text, constraints/avoid list, and any input image URLs.
68 4. Label every input image role: edit target, style reference, compositing insert, or adaptation base.
69 5. If the request is a photo, illustration, sprite, product image, or other raster asset, use `generate_image`. If it should match repo-native SVG/vector/code, edit those instead.
70 6. Shape the prompt:
71 - Specific user prompt → normalize, do not add creative requirements.
72 - Generic prompt → add only detail that materially improves the result. See `references/prompting.md`.
73 - Grounded on a user image → reproduce its real content faithfully (original text and language, palette, layout) and describe only the requested changes. List what must be preserved as invariants.
74 7. Call `generate_image` once per requested asset or variant.
75 8. Inspect the result: subject, style, composition, text accuracy, invariants.
76 9. Iterate with one targeted change. Repeat invariants on every edit.
77 10. Report: write the returned image URL(s) verbatim in your reply (the frontend renders them as previews), plus the final prompt, model, and size. Omitting the URL is a failed delivery. State briefly what came from the input images and what was changed; do not append generic advice unrelated to the images.
78
79 ## Transparent images
80
81 This runtime has no alpha or background-removal tool. `generate_image` returns an image URL, not a local transparent PNG.
82
83 If the user asks for a cutout or transparent background:
84
85 1. Prompt a perfectly flat solid chroma-key background (`#00ff00` by default; `#ff00ff` for green subjects).
86 2. Require no shadows, gradients, floor, reflections, or key color inside the subject.
87 3. Tell the user the result is a keyed image URL they can cut out later. Do not claim a true alpha PNG.
88
89 ## Prompt schema
90
91 ```text
92 Use case: <taxonomy slug>
93 Asset type: <where the asset will be used>
94 Primary request: <user's main prompt>
95 Input images: <Image 1: role; Image 2: role> (optional)
96 Scene/backdrop: <environment>
97 Subject: <main subject>
98 Style/medium: <photo/illustration/3D/etc>
99 Composition/framing: <wide/close/top-down; placement>
100 Lighting/mood: <lighting + mood>
101 Color palette: <palette notes>
102 Materials/textures: <surface details>
103 Text (verbatim): "<exact text>"
104 Constraints: <must keep/must avoid>
105 Avoid: <negative constraints>
106 ```
107
108 Use only the lines that help. For edits, list invariants: `change only X; keep Y unchanged`.
109
110 ## Use-case taxonomy
111
112 Generate: `photorealistic-natural`, `product-mockup`, `ui-mockup`, `infographic-diagram`, `scientific-educational`, `ads-marketing`, `productivity-visual`, `logo-brand`, `illustration-story`, `stylized-concept`, `historical-scene`.
113
114 Edit: `text-localization`, `identity-preserve`, `precise-object-edit`, `lighting-weather`, `background-extraction`, `style-transfer`, `compositing`, `sketch-to-render`.
115
116 ## Examples
117
118 ### Generation
119
120 ```text
121 Use case: product-mockup
122 Asset type: landing page hero
123 Primary request: a minimal hero image of a ceramic coffee mug
124 Style/medium: clean product photography
125 Composition/framing: wide composition with usable negative space for page copy if needed
126 Lighting/mood: soft studio lighting
127 Constraints: no logos, no text, no watermark
128 ```
129
130 ### Edit
131
132 ```text
133 Use case: precise-object-edit
134 Asset type: product photo background replacement
135 Primary request: replace only the background with a warm sunset gradient
136 Input images: Image 1: edit target
137 Constraints: change only the background; keep the product and its edges unchanged; no text; no watermark
138 ```
139
139 lines MARKDOWN