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:
@@ -38,6 +38,7 @@ EMBEDDING_ENDPOINT_KEY: str = os.getenv("EMBEDDING_ENDPOINT_KEY", "placeholder")
|
||||
CHAT_MODEL: str = os.getenv("CHAT_MODEL", "")
|
||||
COMPLETION_MODEL: str = os.getenv("COMPLETION_MODEL", "")
|
||||
IMAGE_GEN_MODEL: str = os.getenv("IMAGE_GEN_MODEL", "")
|
||||
IMAGE_GEN_SIZE: str = os.getenv("IMAGE_GEN_SIZE", "1024x1024")
|
||||
IMAGE_EDIT_MODEL: str = os.getenv("IMAGE_EDIT_MODEL", "")
|
||||
EMBEDDING_MODEL: str = os.getenv("EMBEDDING_MODEL", "")
|
||||
|
||||
|
||||
@@ -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,
|
||||
)
|
||||
|
||||
@@ -25,6 +25,7 @@ from vibe_bot.config import (
|
||||
IMAGE_GEN_ENDPOINT,
|
||||
IMAGE_GEN_ENDPOINT_KEY,
|
||||
IMAGE_GEN_MODEL,
|
||||
IMAGE_GEN_SIZE,
|
||||
MAX_COMPLETION_TOKENS,
|
||||
TTS_MODEL_PATH,
|
||||
TTS_SPEED,
|
||||
@@ -746,6 +747,7 @@ async def doodlebob(ctx: CommandsContext[Bot], *, message: str) -> None:
|
||||
openai_url=IMAGE_GEN_ENDPOINT,
|
||||
openai_api_key=IMAGE_GEN_ENDPOINT_KEY,
|
||||
model=IMAGE_GEN_MODEL,
|
||||
size=IMAGE_GEN_SIZE,
|
||||
)
|
||||
|
||||
if not image_b64:
|
||||
|
||||
Reference in New Issue
Block a user