Skip to content

OpenAI format API: image generation with seed #2903

Answered by BuT9l3b
BuT9l3b asked this question in Q&A
Discussion options

You must be logged in to vote

I was able to run it through extra_body.

from openai import OpenAI


client = OpenAI(
    base_url="http://localhost:1337/v1",
    api_key="test"
)

extra_body = {
    "seed": 2596412
}

response = client.images.generate(
    model="flux",
    prompt="cat",
    response_format="url",
    n = 1,
    extra_body=extra_body,
)


print(response.data[0].url)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by BuT9l3b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant