Image Generate
Scenarios
When you need to generate an image based on a text description, use this skill to call the image_generate function.
Steps
- 1. Prepare a clear and specific
prompt. - Run the script
python scripts/image_generate.py "<prompt>". Before running, navigate to the corresponding directory. - The script will return the generated image URL.
Authentication and Credentials
- - First, it will try to read the
MODEL_IMAGE_API_KEY or ARK_API_KEY environment variables. - If not configured, it will try to use
VOLCENGINE_ACCESS_KEY and VOLCENGINE_SECRET_KEY to get the Ark API Key.
Output Format
- - The console will output the generated image URL.
- If the call fails, it will print the error information.
Examples
CODEBLOCK0
图像生成
应用场景
当您需要根据文本描述生成图像时,使用此技能调用image_generate函数。
操作步骤
- 1. 准备清晰具体的提示词。
- 运行脚本python scripts/image_generate.py <提示词>。运行前请先切换到对应目录。
- 脚本将返回生成的图像URL。
认证与凭证
- - 首先会尝试读取MODELIMAGEAPIKEY或ARKAPIKEY环境变量。
- 如果未配置,则会尝试使用VOLCENGINEACCESSKEY和VOLCENGINESECRET_KEY获取Ark API密钥。
输出格式
- - 控制台将输出生成的图像URL。
- 如果调用失败,将打印错误信息。
示例
bash
python scripts/image_generate.py 一只可爱的猫