diff --git a/fooocus_version.py b/fooocus_version.py index 0b950301..f72e4b71 100644 --- a/fooocus_version.py +++ b/fooocus_version.py @@ -1 +1 @@ -version = '1.0.59' +version = '1.0.60' diff --git a/modules/async_worker.py b/modules/async_worker.py index 51cd2db5..9e9cb3dd 100644 --- a/modules/async_worker.py +++ b/modules/async_worker.py @@ -59,7 +59,8 @@ def worker(): n_txt = apply_style_negative(style_selction, negative_prompt) n_cond = pipeline.process_prompt(n_txt) outputs.append(['preview', (9, 'Encoding positive text ...', None)]) - p_txt = apply_style_positive(style_selction, prompt) + p_txt_a, p_txt_b = apply_style_positive(style_selction, prompt) + p_txt = p_txt_a + p_txt_b p_cond = pipeline.process_prompt(p_txt) for i in range(image_number): @@ -76,9 +77,13 @@ def worker(): for i in range(image_number): outputs.append(['preview', (5, f'Preparing positive text #{i + 1} ...', None)]) current_seed = seed + i - p_txt = pipeline.expand_txt(prompt, current_seed) - print(f'Expanded positive prompt: \n\n{p_txt}\n\n') - p_txt = apply_style_positive(style_selction, p_txt) + + p_txt_a, p_txt_b = apply_style_positive(style_selction, prompt) + p_txt_e = pipeline.expand_txt(p_txt_a, current_seed) + print(f'Expanded prompt: \n\n{p_txt_e}\n\n') + + p_txt = p_txt_e + p_txt_b + tasks.append(dict( prompt=prompt, negative_prompt=negative_prompt, diff --git a/modules/expansion.py b/modules/expansion.py index 0942423c..3f66a1db 100644 --- a/modules/expansion.py +++ b/modules/expansion.py @@ -6,6 +6,7 @@ from modules.path import fooocus_expansion_path fooocus_magic_split = [ ', extremely', ', trending', + ', with', ', perfect', ', intricate', '. The', diff --git a/modules/sdxl_styles.py b/modules/sdxl_styles.py index 3026cb13..36cdb490 100644 --- a/modules/sdxl_styles.py +++ b/modules/sdxl_styles.py @@ -961,7 +961,10 @@ aspect_ratios = {str(v[0]) + '×' + str(v[1]): v for k, v in SD_XL_BASE_RATIOS.i def apply_style_positive(style, txt): p, n = styles.get(style, default_style) - return p.replace('{prompt}', txt) + ps = p.split('{prompt}') + if len(ps) != 2: + return txt, '' + return ps[0] + txt, ps[1] def apply_style_negative(style, txt): diff --git a/update_log.md b/update_log.md index 0ca2e6e7..478f6df5 100644 --- a/update_log.md +++ b/update_log.md @@ -1,3 +1,7 @@ +### 1.0.60 + +* Tune the balance between style and Prompt Expansion. + ### 1.0.56 * Begin to use magic split.