mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
move prompt translation to async_worker
This commit is contained in:
@@ -41,6 +41,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
|
||||
@@ -120,6 +121,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()
|
||||
@@ -195,6 +197,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}')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user