Install
openclaw skills install img2imgGenerate images from text descriptions using DALL-E 3 while adhering to usage policies and avoiding realistic human faces.
openclaw skills install img2img当用户提到"图生图"、"AI 画图"、"生成图片"、"画一个"等时激活。
使用 DALL-E 根据文字描述生成图片。
用户发送描述文字,我调用 DALL-E 生成图片并发送。
使用 OpenAI DALL-E 3 API 生成图片:
import openai
import base64
import os
api_key = os.environ.get("API_KEY")
client = openai.OpenAI(api_key=api_key)
response = client.images.generate(
model="dall-e-3",
prompt="描述文字",
size="1024x1024",
quality="standard",
n=1,
)
image_url = response.data[0].url