From 2c61a04bcceac019c1169bbd77827177a56ed316 Mon Sep 17 00:00:00 2001 From: ducoterra Date: Mon, 17 Aug 2026 10:42:46 -0400 Subject: [PATCH] make image gen size configurable --- vibe_bot/config.py | 1 + vibe_bot/llama_wrapper.py | 4 +++- vibe_bot/main.py | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/vibe_bot/config.py b/vibe_bot/config.py index 90cbcd4..6dde2be 100644 --- a/vibe_bot/config.py +++ b/vibe_bot/config.py @@ -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", "") diff --git a/vibe_bot/llama_wrapper.py b/vibe_bot/llama_wrapper.py index 77cef23..bbcc48c 100644 --- a/vibe_bot/llama_wrapper.py +++ b/vibe_bot/llama_wrapper.py @@ -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, ) diff --git a/vibe_bot/main.py b/vibe_bot/main.py index 4d61cd5..dbb1dbd 100644 --- a/vibe_bot/main.py +++ b/vibe_bot/main.py @@ -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: