From 3d12a32f539f9d62c7717a76bff00337f4853fe9 Mon Sep 17 00:00:00 2001 From: NON906 Date: Mon, 7 Aug 2023 15:18:19 +0900 Subject: [PATCH] =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.py | 21 ++++++++++++++++----- settings/chatgpt_txt2img.json | 3 +++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/scripts/main.py b/scripts/main.py index e6bb412..9aa2f4c 100644 --- a/scripts/main.py +++ b/scripts/main.py @@ -61,11 +61,22 @@ def on_ui_tabs(): else: txt2img_params['prompt'] += ', ' + request_prompt - sampler_index = 0 - for sampler_loop_index, sampler_loop in enumerate(sd_samplers.samplers): - if sampler_loop.name == txt2img_params['sampler_index']: - sampler_index = sampler_loop_index - txt2img_params['sampler_index'] = sampler_index + if isinstance(txt2img_params['sampler_index'], str): + sampler_index = 0 + for sampler_loop_index, sampler_loop in enumerate(sd_samplers.samplers): + if sampler_loop.name == txt2img_params['sampler_index']: + sampler_index = sampler_loop_index + txt2img_params['sampler_index'] = sampler_index + + if isinstance(txt2img_params['hr_sampler_index'], str): + if 'hr_sampler_index' in txt2img_params.keys(): + hr_sampler_index = 0 + for sampler_loop_index, sampler_loop in enumerate(sd_samplers.samplers): + if sampler_loop.name == txt2img_params['hr_sampler_index']: + hr_sampler_index = txt2img_params['hr_sampler_index'] + txt2img_params['hr_sampler_index'] = hr_sampler_index + else: + txt2img_params['hr_sampler_index'] = 0 last_arg_index = 1 for script in modules.scripts.scripts_txt2img.scripts: diff --git a/settings/chatgpt_txt2img.json b/settings/chatgpt_txt2img.json index ad66f5d..80545e4 100644 --- a/settings/chatgpt_txt2img.json +++ b/settings/chatgpt_txt2img.json @@ -24,5 +24,8 @@ "hr_second_pass_steps": 0, "hr_resize_x": 0, "hr_resize_y": 0, + "hr_sampler_index": "", + "hr_prompt": "", + "hr_negative_prompt": "", "override_settings_texts": "" } \ No newline at end of file