mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
make concepts library work with Web UI (#1608)
## The concepts library now works with the Web UI This PR makes it possible to include a Hugging Face concepts library <style-or-subject-trigger> in the WebUI prompts. The metadata seems to be correctly handled.
This commit is contained in:
commit
8999a5564b
@ -436,6 +436,9 @@ class Generate:
|
||||
self.sampler_name = sampler_name
|
||||
self._set_sampler()
|
||||
|
||||
# apply the concepts library to the prompt
|
||||
prompt = self.concept_lib().replace_concepts_with_triggers(prompt, lambda concepts: self.load_concepts(concepts))
|
||||
|
||||
# bit of a hack to change the cached sampler's karras threshold to
|
||||
# whatever the user asked for
|
||||
if karras_max is not None and isinstance(self.sampler,KSampler):
|
||||
|
@ -352,8 +352,6 @@ def main_loop(gen, opt):
|
||||
last_results.append([path, seed])
|
||||
|
||||
if operation == 'generate':
|
||||
# load any <embeddings> from the SD concepts library
|
||||
opt.prompt = gen.concept_lib().replace_concepts_with_triggers(opt.prompt, lambda concepts: gen.load_concepts(concepts))
|
||||
catch_ctrl_c = infile is None # if running interactively, we catch keyboard interrupts
|
||||
opt.last_operation='generate'
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user