Trigger scenarios
Examples of user wording:
- Free painting: "Draw an orange cat dozing next to a coffee cup", "Generate a landscape painting under the starry sky"
- Product images: "Help me generate a product display image of a Nordic-style handmade coffee pot"
- Illustration creation: "Draw a cyberpunk-style city illustration", "Generate a children's picture book-style short story illustration"
- Style creation: "Paint a peony in watercolor style", "An Impressionist sunset"
Out of scope
- Text generation requests → not within the scope of this skill, handled by text-gen-skill
- Image editing (modifying existing images) → not within the scope of this skill, handled by image-edit-skill
- Requests to recognize/analyze content after uploading an image → not within the scope of this skill
API chain
generateImage: Generate images based on prompt, supporting parameters such as style, size, and quantity
Usage order
- When the user expresses an intent to generate an image, directly call generateImage
- If the user specifies an image style or size, pass in the corresponding parameters
- AI is responsible for optimizing the prompt to improve generation quality, but maintains the user's original intent
- After returning the result, display it through the
image-result-cardcard - Images are automatically persisted to cloud storage, but the user should still be prompted to save them promptly
Design constraints
- Must be called through a cloud function; the mini program SDK does not support image generation
- Generated images are automatically uploaded to cloud storage for persistence (see cloud function ai/image.js for details)
- Cloud function timeout configured to 120 seconds (image generation is slower)
- The returned
fileIDcan be used permanently,tempUrlis valid for only 24 hours