SuperAPI AI Directory

image-gen-skill

Design & creation

View repository

Updated 10-16 08:52

About this skill

AI image generation

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

  1. When the user expresses an intent to generate an image, directly call generateImage
  2. If the user specifies an image style or size, pass in the corresponding parameters
  3. AI is responsible for optimizing the prompt to improve generation quality, but maintains the user's original intent
  4. After returning the result, display it through the image-result-card card
  5. 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 fileID can be used permanently,tempUrl is valid for only 24 hours