From 647ae6f442bd8967318d2bea751982170e423ab2 Mon Sep 17 00:00:00 2001 From: Arnab Ahamed Siam Date: Mon, 1 Jan 2024 19:43:02 +0600 Subject: [PATCH] text to image aspect ratio support added --- modules/api/api.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/api/api.py b/modules/api/api.py index 463e2d1b..e2d903dd 100644 --- a/modules/api/api.py +++ b/modules/api/api.py @@ -296,7 +296,8 @@ def text2imggenerateapi(self, prompt: str = Body(title='user prompt'), cfg_scale: float = Body(None, title="cfg scale"), batch_size: int = Body(1, title="no of image to produce at a single batch which may produce same type image"), style: str = Body("base", title='selected style of user'), - size: int = Body(768, title = 'height & width of generated image')): + height: int = Body(512, title = 'height of generated image'), + width: int = Body(512, title = 'width of generated image')): start_time = time.time() utc_time = datetime.datetime.now(timezone.utc) @@ -330,7 +331,7 @@ def text2imggenerateapi(self, prompt: str = Body(title='user prompt'), n_iter = batch_count, batch_size = batch_size, cfg_scale = cfg_scale if cfg_scale else data.cfg, - height = size, width = size, + height = height, width = width, seed = seed, denoising_strength = data.denoising_strength)