make image gen size configurable
Build and Push Container / build-and-push (push) Successful in 1m29s
Build and Push Container / build-and-push (push) Successful in 1m29s
This commit is contained in:
@@ -295,6 +295,7 @@ def image_generation(
|
||||
openai_api_key: str,
|
||||
model: str = "gen",
|
||||
n: int = 1,
|
||||
size: str = "1024x1024",
|
||||
) -> str:
|
||||
"""Generate an image using the given prompt.
|
||||
|
||||
@@ -304,6 +305,7 @@ def image_generation(
|
||||
openai_api_key: The API key for authentication.
|
||||
model: The model to use for image generation.
|
||||
n: Number of images to generate.
|
||||
size: The size of the generated image, e.g. "1024x1024".
|
||||
|
||||
Returns:
|
||||
The base64 encoded image data. Decode and write to a file.
|
||||
@@ -318,7 +320,7 @@ def image_generation(
|
||||
response = client.images.generate(
|
||||
prompt=prompt,
|
||||
n=n,
|
||||
size="768x768",
|
||||
size=size,
|
||||
model=model,
|
||||
timeout=120.0,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user