fix:generate wrong in layerdiffuse when negative is empty #80

This commit is contained in:
yolain
2024-03-09 12:07:51 +08:00
parent 184edc17a2
commit 8752ea0f77
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -276,7 +276,7 @@ def advanced_encode(clip, text, token_normalization, weight_interpretation, w_ma
pass3 = [x for x in pass3 if x != '']
if len(pass3) == 0:
return ''
pass3 = ['']
# pass3_str = [f'[{x}]' for x in pass3]
# print(f"CLIP: {str.join(' + ', pass3_str)}")
+5 -5
View File
@@ -5,14 +5,14 @@ from ..wildcards import process_with_loras
from nodes import ConditioningConcat, ConditioningCombine, ConditioningAverage, ConditioningSetTimestepRange
def prompt_to_cond(type, model, clip, clip_skip, lora_stack, text, positive_token_normalization, positive_weight_interpretation, a1111_prompt_style ,my_unique_id, prompt, easyCache, can_load_lora=True):
def prompt_to_cond(type, model, clip, clip_skip, lora_stack, text, prompt_token_normalization, prompt_weight_interpretation, a1111_prompt_style ,my_unique_id, prompt, easyCache, can_load_lora=True):
styles_selector = is_linked_styles_selector(prompt, my_unique_id, type)
title = "正面提示词" if type == 'positive' else "负面提示词"
log_node_warn("正在处理" + title + "...")
positive_seed = find_wildcards_seed(my_unique_id, text, prompt)
model, clip, positive, positive_decode, show_prompt, pipe_lora_stack = process_with_loras(
model, clip, text, cond_decode, show_prompt, pipe_lora_stack = process_with_loras(
text, model, clip, type, positive_seed, can_load_lora, lora_stack, easyCache)
wildcard_prompt = positive_decode if show_prompt or styles_selector else ""
wildcard_prompt = cond_decode if show_prompt or styles_selector else ""
clipped = clip.clone()
if clip_skip != 0:
@@ -20,8 +20,8 @@ def prompt_to_cond(type, model, clip, clip_skip, lora_stack, text, positive_toke
log_node_warn("正在处理" + title + "编码...")
steps = find_nearest_steps(my_unique_id, prompt)
return (advanced_encode(clipped, positive, positive_token_normalization,
positive_weight_interpretation, w_max=1.0,
return (advanced_encode(clipped, text, prompt_token_normalization,
prompt_weight_interpretation, w_max=1.0,
apply_to_pooled='enable',
a1111_prompt_style=a1111_prompt_style, steps=steps), wildcard_prompt, model, clipped)