Use cases
When you need to generate an image based on a text description, use this skill to call the image_generate function.
Usage steps
- Prepare a clear and specific
prompt。 - Run the script
python scripts/image_generate.py "<prompt>". Before running, cd to the corresponding directory. - The script will return the URL of the generated image.
Authentication and credential sources
- Preferentially read the
MODEL_IMAGE_API_KEYorARK_API_KEYenvironment variable. - If not configured, it will try to use
VOLCENGINE_ACCESS_KEYandVOLCENGINE_SECRET_KEYto obtain the Ark API Key.
Output format
- Output the URL of the generated image.
- If the call fails, an error message will be printed.
Example
python scripts/image_generate.py "一只可爱的猫"