Merge branch 'feature/add-prompt-translate'

# Conflicts:
#	requirements_versions.txt
#	webui.py
This commit is contained in:
Manuel Schmid
2023-11-26 00:14:12 +01:00
4 changed files with 28 additions and 3 deletions
+6
View File
@@ -44,6 +44,7 @@ def worker():
from modules.util import remove_empty_str, HWC3, resize_image, \
get_image_shape_ceil, set_image_shape_ceil, get_shape_ceil, resample_image
from modules.upscaler import perform_upscale
from modules.translator import translate2en
try:
async_gradio_app = shared.gradio_root
@@ -128,6 +129,7 @@ def worker():
prompt = args.pop()
negative_prompt = args.pop()
translate_prompts = args.pop()
style_selections = args.pop()
performance_selection = args.pop()
aspect_ratios_selection = args.pop()
@@ -203,6 +205,10 @@ def worker():
modules.patch.adm_scaler_end = advanced_parameters.adm_scaler_end = 0.0
steps = 8
if translate_prompts:
prompt = translate2en(prompt, 'prompt')
negative_prompt = translate2en(negative_prompt, 'negative prompt')
modules.patch.adaptive_cfg = advanced_parameters.adaptive_cfg
print(f'[Parameters] Adaptive CFG = {modules.patch.adaptive_cfg}')