From dc9192f1038da3f6e893dd3a0b78384d82fb6aa1 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Wed, 5 Apr 2023 23:55:13 +0200 Subject: [PATCH] working img2img upscale option --- matrix_pygmalion_bot/ai/runpod_pygmalion.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/matrix_pygmalion_bot/ai/runpod_pygmalion.py b/matrix_pygmalion_bot/ai/runpod_pygmalion.py index 73ab64b..d43523e 100644 --- a/matrix_pygmalion_bot/ai/runpod_pygmalion.py +++ b/matrix_pygmalion_bot/ai/runpod_pygmalion.py @@ -277,7 +277,7 @@ async def serverless_automatic_request(payload, cmd, api_url: str, api_key: str) # Make the request r = requests.post(endpoint, json=input_data, headers=headers) r_json = r.json() - logger.info(r_json) + logger.debug(r_json) if r.status_code == 200: status = r_json["status"] @@ -292,7 +292,7 @@ async def serverless_automatic_request(payload, cmd, api_url: str, api_key: str) endpoint = api_url + "status/" + job_id r = requests.get(endpoint, headers=headers) r_json = r.json() - logger.info(r_json) + logger.debug(r_json) status = r_json["status"] if status == 'IN_PROGRESS': await asyncio.sleep(DELAY) @@ -315,10 +315,14 @@ async def generate_image_automatic(input_prompt: str, negative_prompt: str, api_ payload = { "prompt": input_prompt, "nagative_prompt": negative_prompt, - "steps": 20, + "steps": 25, "seed": -1, "width": 512, "height": 768, + "batch_size": 3, +# "enable_hr": True, +# "hr_scale": 2, +# "hr_upscaler": "ESRGAN_4x", "restore_faces": True, # "gfpgan_visibility": 0.5, # "codeformer_visibility": 0.5, @@ -335,7 +339,7 @@ async def generate_image_automatic(input_prompt: str, negative_prompt: str, api_ count = 0 for i in output['images']: payload = { - "images": [i], + "init_images": [i], "prompt": input_prompt, "nagative_prompt": negative_prompt, "steps": 20,