API 提供三种主要功能:
from openai import OpenAI
client = OpenAI(
base_url="https://api.gpts.vin/v1",
api_key=key
)
response = client.images.generate(
model="dall-e-3",
prompt="a white siamese cat",
size="1024x1024",
quality="standard",
n=1,
)
image_url = response.data[0].url
from openai import OpenAI
client = OpenAI(
base_url="https://api.gpts.vin/v1",
api_key=key
)
response = client.images.edit((
model="dall-e-2",
image=open("sunlit_lounge.png", "rb"),
mask=open("mask.png", "rb"),
prompt="A sunlit indoor lounge area with a pool containing a flamingo",
n=1,
size="1024x1024"
)
image_url = response.data[0].url
from openai import OpenAI
client = OpenAI(
base_url="https://api.gpts.vin/v1",
api_key=key
)
response = client.images.create_variation(
model="dall-e-2",
image=open("corgi_and_cat_paw.png", "rb"),
n=1,
size="1024x1024"
)
image_url = response.data[0].url
I NEED to test how the tool works with extremely simple prompts.
DO NOT add any detail, just use it AS-IS: