import requests
url = "https://api.chenyu.cn/v1/images/edits"
headers = {"Authorization": "Bearer your_api_key"}
data = {
"model": "doubao-seedream-5-0-lite-260128",
"prompt": "把背景改成浅蓝色,保持主体不变",
"size": "1024x1024"
}
files = {
"image": open("input.png", "rb")
}
response = requests.post(url, headers=headers, data=data, files=files)
print(response.json()["data"][0]["url"])