i (#36)
This commit is contained in:
parent
8720e435f5
commit
59aa2aedeb
|
|
@ -1 +1 @@
|
||||||
version = '1.0.20'
|
version = '1.0.21'
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ def worker():
|
||||||
pipeline.refresh_base_model(base_model_name)
|
pipeline.refresh_base_model(base_model_name)
|
||||||
pipeline.refresh_refiner_model(refiner_model_name)
|
pipeline.refresh_refiner_model(refiner_model_name)
|
||||||
pipeline.refresh_loras(loras)
|
pipeline.refresh_loras(loras)
|
||||||
|
pipeline.clean_prompt_cond_caches()
|
||||||
|
|
||||||
p_txt, n_txt = apply_style(style_selction, prompt, negative_prompt)
|
p_txt, n_txt = apply_style(style_selction, prompt, negative_prompt)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -102,18 +102,41 @@ refresh_base_model(modules.path.default_base_model_name)
|
||||||
refresh_refiner_model(modules.path.default_refiner_model_name)
|
refresh_refiner_model(modules.path.default_refiner_model_name)
|
||||||
refresh_loras([(modules.path.default_lora_name, 0.5), ('None', 0.5), ('None', 0.5), ('None', 0.5), ('None', 0.5)])
|
refresh_loras([(modules.path.default_lora_name, 0.5), ('None', 0.5), ('None', 0.5), ('None', 0.5), ('None', 0.5)])
|
||||||
|
|
||||||
|
positive_conditions_cache = None
|
||||||
|
negative_conditions_cache = None
|
||||||
|
positive_conditions_refiner_cache = None
|
||||||
|
negative_conditions_refiner_cache = None
|
||||||
|
|
||||||
|
|
||||||
|
def clean_prompt_cond_caches():
|
||||||
|
global positive_conditions_cache, negative_conditions_cache, \
|
||||||
|
positive_conditions_refiner_cache, negative_conditions_refiner_cache
|
||||||
|
positive_conditions_cache = None
|
||||||
|
negative_conditions_cache = None
|
||||||
|
positive_conditions_refiner_cache = None
|
||||||
|
negative_conditions_refiner_cache = None
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
@torch.no_grad()
|
@torch.no_grad()
|
||||||
def process(positive_prompt, negative_prompt, steps, switch, width, height, image_seed, callback):
|
def process(positive_prompt, negative_prompt, steps, switch, width, height, image_seed, callback):
|
||||||
positive_conditions = core.encode_prompt_condition(clip=xl_base_patched.clip, prompt=positive_prompt)
|
global positive_conditions_cache, negative_conditions_cache, \
|
||||||
negative_conditions = core.encode_prompt_condition(clip=xl_base_patched.clip, prompt=negative_prompt)
|
positive_conditions_refiner_cache, negative_conditions_refiner_cache
|
||||||
|
|
||||||
|
positive_conditions = core.encode_prompt_condition(clip=xl_base_patched.clip, prompt=positive_prompt) if positive_conditions_cache is None else positive_conditions_cache
|
||||||
|
negative_conditions = core.encode_prompt_condition(clip=xl_base_patched.clip, prompt=negative_prompt) if negative_conditions_cache is None else negative_conditions_cache
|
||||||
|
|
||||||
|
positive_conditions_cache = positive_conditions
|
||||||
|
negative_conditions_cache = negative_conditions
|
||||||
|
|
||||||
empty_latent = core.generate_empty_latent(width=width, height=height, batch_size=1)
|
empty_latent = core.generate_empty_latent(width=width, height=height, batch_size=1)
|
||||||
|
|
||||||
if xl_refiner is not None:
|
if xl_refiner is not None:
|
||||||
|
positive_conditions_refiner = core.encode_prompt_condition(clip=xl_refiner.clip, prompt=positive_prompt) if positive_conditions_refiner_cache is None else positive_conditions_refiner_cache
|
||||||
|
negative_conditions_refiner = core.encode_prompt_condition(clip=xl_refiner.clip, prompt=negative_prompt) if negative_conditions_refiner_cache is None else negative_conditions_refiner_cache
|
||||||
|
|
||||||
positive_conditions_refiner = core.encode_prompt_condition(clip=xl_refiner.clip, prompt=positive_prompt)
|
positive_conditions_refiner_cache = positive_conditions_refiner
|
||||||
negative_conditions_refiner = core.encode_prompt_condition(clip=xl_refiner.clip, prompt=negative_prompt)
|
negative_conditions_refiner_cache = negative_conditions_refiner
|
||||||
|
|
||||||
sampled_latent = core.ksampler_with_refiner(
|
sampled_latent = core.ksampler_with_refiner(
|
||||||
model=xl_base_patched.unet,
|
model=xl_base_patched.unet,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
### 1.0.20
|
### 1.0.20
|
||||||
|
|
||||||
|
* Speed-up text encoder
|
||||||
|
|
||||||
|
### 1.0.20
|
||||||
|
|
||||||
* Re-write UI to use async codes: (1) for faster start, and (2) for better live preview.
|
* Re-write UI to use async codes: (1) for faster start, and (2) for better live preview.
|
||||||
* Removed opencv dependency
|
* Removed opencv dependency
|
||||||
* Plan to support Linux soon
|
* Plan to support Linux soon
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue