mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
make concepts library work with Web UI
This PR makes it possible to include a Hugging Face concepts library <style-or-subject-trigger> in the WebUI prompt. The metadata seems to be correctly handled.
This commit is contained in:
parent
45e51bac9a
commit
62cda009dd
@ -436,6 +436,9 @@ class Generate:
|
|||||||
self.sampler_name = sampler_name
|
self.sampler_name = sampler_name
|
||||||
self._set_sampler()
|
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
|
# bit of a hack to change the cached sampler's karras threshold to
|
||||||
# whatever the user asked for
|
# whatever the user asked for
|
||||||
if karras_max is not None and isinstance(self.sampler,KSampler):
|
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])
|
last_results.append([path, seed])
|
||||||
|
|
||||||
if operation == 'generate':
|
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
|
catch_ctrl_c = infile is None # if running interactively, we catch keyboard interrupts
|
||||||
opt.last_operation='generate'
|
opt.last_operation='generate'
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user