使用 Flux Kontext Max 模型进行精准图像编辑
flux-kontext-max
from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.weelinking.com/v1" ) # 需使用 OpenAI 的 edits 或 images.edit 接口 (取决于具体兼容实现,通常为 images.edit) response = client.images.edit( model="flux-kontext-max", image=open("original.png", "rb"), mask=open("mask.png", "rb"), prompt="A red rose in the hand", n=1, size="1024x1024" ) print(response.data[0].url)