mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix web ui issues
This commit is contained in:
parent
ded3f13a33
commit
1dfaaa2a57
@ -1258,7 +1258,7 @@ class InvokeAIWebServer:
|
||||
parsed_prompt, _ = get_prompt_structure(
|
||||
generation_parameters["prompt"])
|
||||
tokens = None if type(parsed_prompt) is Blend else \
|
||||
get_tokens_for_prompt(self.generate.model, parsed_prompt)
|
||||
get_tokens_for_prompt(self.generate.model.tokenizer, parsed_prompt)
|
||||
attention_maps_image_base64_url = None if attention_maps_image is None \
|
||||
else image_to_dataURL(attention_maps_image)
|
||||
|
||||
|
@ -44,19 +44,14 @@ def get_uc_and_c_and_ec(prompt_string, model, log_tokens=False, skip_normalize_l
|
||||
return uc, c, ec
|
||||
|
||||
|
||||
def get_prompt_structure(prompt_string, model, skip_normalize_legacy_blend: bool = False) -> (
|
||||
def get_prompt_structure(prompt_string, skip_normalize_legacy_blend: bool = False) -> (
|
||||
Union[FlattenedPrompt, Blend], FlattenedPrompt):
|
||||
"""
|
||||
parse the passed-in prompt string and return tuple (positive_prompt, negative_prompt)
|
||||
"""
|
||||
compel = Compel(tokenizer=model.tokenizer,
|
||||
text_encoder=model.text_encoder,
|
||||
textual_inversion_manager=model.textual_inversion_manager,
|
||||
dtype_for_device_getter=torch_dtype)
|
||||
|
||||
positive_prompt_string, negative_prompt_string = split_prompt_to_positive_and_negative(prompt_string)
|
||||
positive_prompt = compel.parse_prompt_string(positive_prompt_string)
|
||||
negative_prompt = compel.parse_prompt_string(negative_prompt_string)
|
||||
positive_prompt = Compel.parse_prompt_string(positive_prompt_string)
|
||||
negative_prompt = Compel.parse_prompt_string(negative_prompt_string)
|
||||
|
||||
return positive_prompt, negative_prompt
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user