mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
speed up
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
|||||||
version = '1.0.50'
|
version = '1.0.51'
|
||||||
|
|||||||
+13
-10
@@ -53,15 +53,15 @@ def worker():
|
|||||||
pipeline.refresh_refiner_model(refiner_model_name)
|
pipeline.refresh_refiner_model(refiner_model_name)
|
||||||
pipeline.refresh_loras(loras)
|
pipeline.refresh_loras(loras)
|
||||||
|
|
||||||
outputs.append(['preview', (5, 'Encoding negative text ...', None)])
|
|
||||||
n_txt = apply_style_negative(style_selction, negative_prompt)
|
|
||||||
n_cond = pipeline.process_prompt(n_txt)
|
|
||||||
|
|
||||||
tasks = []
|
tasks = []
|
||||||
if raw_mode:
|
if raw_mode:
|
||||||
|
outputs.append(['preview', (5, 'Encoding negative text ...', None)])
|
||||||
|
n_txt = apply_style_negative(style_selction, negative_prompt)
|
||||||
|
n_cond = pipeline.process_prompt(n_txt)
|
||||||
outputs.append(['preview', (9, 'Encoding positive text ...', None)])
|
outputs.append(['preview', (9, 'Encoding positive text ...', None)])
|
||||||
p_txt = apply_style_positive(style_selction, prompt)
|
p_txt = apply_style_positive(style_selction, prompt)
|
||||||
p_cond = pipeline.process_prompt(p_txt)
|
p_cond = pipeline.process_prompt(p_txt)
|
||||||
|
|
||||||
for i in range(image_number):
|
for i in range(image_number):
|
||||||
tasks.append(dict(
|
tasks.append(dict(
|
||||||
prompt=prompt,
|
prompt=prompt,
|
||||||
@@ -74,24 +74,27 @@ def worker():
|
|||||||
))
|
))
|
||||||
else:
|
else:
|
||||||
for i in range(image_number):
|
for i in range(image_number):
|
||||||
outputs.append(['preview', (9, f'Preparing positive text #{i + 1} ...', None)])
|
outputs.append(['preview', (5, f'Preparing positive text #{i + 1} ...', None)])
|
||||||
current_seed = seed + i
|
current_seed = seed + i
|
||||||
|
|
||||||
p_txt = pipeline.expand_txt(prompt, current_seed)
|
p_txt = pipeline.expand_txt(prompt, current_seed)
|
||||||
print(f'Expanded positive prompt: {p_txt}')
|
print(f'Expanded positive prompt: \n\n{p_txt}\n\n')
|
||||||
|
|
||||||
p_txt = apply_style_positive(style_selction, p_txt)
|
p_txt = apply_style_positive(style_selction, p_txt)
|
||||||
tasks.append(dict(
|
tasks.append(dict(
|
||||||
prompt=prompt,
|
prompt=prompt,
|
||||||
negative_prompt=negative_prompt,
|
negative_prompt=negative_prompt,
|
||||||
seed=current_seed,
|
seed=current_seed,
|
||||||
n_cond=n_cond,
|
|
||||||
real_positive_prompt=p_txt,
|
real_positive_prompt=p_txt,
|
||||||
real_negative_prompt=n_txt
|
|
||||||
))
|
))
|
||||||
|
|
||||||
|
outputs.append(['preview', (9, 'Encoding negative text ...', None)])
|
||||||
|
n_txt = apply_style_negative(style_selction, negative_prompt)
|
||||||
|
n_cond = pipeline.process_prompt(n_txt)
|
||||||
|
|
||||||
for i, t in enumerate(tasks):
|
for i, t in enumerate(tasks):
|
||||||
outputs.append(['preview', (12, f'Encoding positive text #{i + 1} ...', None)])
|
outputs.append(['preview', (12, f'Encoding positive text #{i + 1} ...', None)])
|
||||||
t['p_cond'] = pipeline.process_prompt(t['real_positive_prompt'])
|
t['p_cond'] = pipeline.process_prompt(t['real_positive_prompt'])
|
||||||
|
t['real_negative_prompt'] = n_txt
|
||||||
|
t['n_cond'] = n_cond
|
||||||
|
|
||||||
if performance_selction == 'Speed':
|
if performance_selction == 'Speed':
|
||||||
steps = 30
|
steps = 30
|
||||||
|
|||||||
@@ -968,5 +968,7 @@ def apply_style_negative(style, txt):
|
|||||||
p, n = styles.get(style, default_style)
|
p, n = styles.get(style, default_style)
|
||||||
if n == '':
|
if n == '':
|
||||||
return txt
|
return txt
|
||||||
|
elif txt == '':
|
||||||
|
return n
|
||||||
else:
|
else:
|
||||||
return n + ', ' + txt
|
return n + ', ' + txt
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
### 1.0.51
|
||||||
|
|
||||||
|
* Speed up Prompt Expansion a bit.
|
||||||
|
|
||||||
### 1.0.50
|
### 1.0.50
|
||||||
|
|
||||||
* Prompt expansion and a "Raw mode" to turn it off (similar to Midjourney's "raw").
|
* Prompt expansion and a "Raw mode" to turn it off (similar to Midjourney's "raw").
|
||||||
|
|||||||
Reference in New Issue
Block a user