mirror of
https://github.com/vladmandic/automatic
synced 2026-09-18 16:54:33 +02:00
Run black for formatting, fix pylint errors, and change to warning.
This commit is contained in:
@@ -63,7 +63,7 @@ def process_diffusers(p: StableDiffusionProcessing, seeds, prompts, negative_pro
|
||||
pooled = None
|
||||
negative_embed = None
|
||||
negative_pooled = None
|
||||
if shared.opts.data['prompt_attention'] != 'Fixed attention':
|
||||
if shared.opts.data['prompt_attention'] in {'Compel parser', 'Full parser'}:
|
||||
prompt_embed, pooled, negative_embed, negative_pooled = prompt_parser_diffusers.compel_encode_prompt(model, prompt, negative_prompt, prompt_2, negative_prompt_2, is_refiner)
|
||||
if 'prompt' in possible:
|
||||
if hasattr(model, 'text_encoder') and 'prompt_embeds' in possible and prompt_embed is not None:
|
||||
|
||||
@@ -9,10 +9,11 @@ import modules.prompt_parser as prompt_parser
|
||||
def convert_to_compel(prompt: str):
|
||||
if prompt is None:
|
||||
return None
|
||||
# TODO: 100 should be steps, but doesn't actually matter because we can't schedule yet
|
||||
all_schedules = prompt_parser.get_learned_conditioning_prompt_schedules(
|
||||
prompt, 100
|
||||
)[0]
|
||||
)[
|
||||
0
|
||||
]
|
||||
output_list = prompt_parser.parse_prompt_attention(all_schedules[0][1])
|
||||
converted_prompt = []
|
||||
for subprompt, weight in output_list:
|
||||
@@ -28,9 +29,10 @@ def convert_to_compel(prompt: str):
|
||||
def compel_encode_prompt(pipeline: typing.Any, *args, **kwargs):
|
||||
compel_encode_fn = COMPEL_ENCODE_FN_DICT.get(type(pipeline), None)
|
||||
if compel_encode_fn is None:
|
||||
raise TypeError(
|
||||
shared.log.warning(
|
||||
f"Compel encoding not yet supported for {type(pipeline).__name__}."
|
||||
)
|
||||
return (None,) * 4
|
||||
return compel_encode_fn(pipeline, *args, **kwargs)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user